Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: strict and dynamic mode #477

Merged
merged 11 commits into from
Jul 5, 2024
Merged

Conversation

chriswk
Copy link
Member

@chriswk chriswk commented Jul 5, 2024

No description provided.

@chriswk chriswk requested review from nunogois and sighphyre July 5, 2024 07:16
@chriswk chriswk self-assigned this Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

CLI.md Outdated
@@ -48,7 +48,7 @@ This document contains the help content for the `unleash-edge` command-line prog
Default value: `3043`
* `--instance-id <INSTANCE_ID>` — Instance id. Used for metrics reporting

Default value: `01HX9QXY3MNKKAMP7XRS6RG2Q4`
Default value: `01J20TW2327N1JHE5XYHBE55KM`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm won't this be a new ulid every time?

Suggested change
Default value: `01J20TW2327N1JHE5XYHBE55KM`
Default value: Automatically generated ulid.

I guess the reason for this, and especially this change in the value, is that we just copy paste the CLI output 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, good point. I'll update the default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, no I won't since this is fully auto generated. For now we'll just accept that this will update each time we generate CLI.md

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I changed it to <GENERATED_ULID> now. We should see if we can have our generator replace that value automatically

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now we'll have to remember to replace the value with the placeholder again if we regenerate CLI.md

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, makes sense 👍 Either way just something I noticed that is out of scope for the PR, so no worries.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
chriswk and others added 2 commits July 5, 2024 10:28
Co-authored-by: Nuno Góis <[email protected]>
Co-authored-by: Nuno Góis <[email protected]>
README.md Outdated
be
given
tokens at startup.
Edge will lock down access for new tokens that have a wider or different access scope than the tokens it was started
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Edge will lock down access for new tokens that have a wider or different access scope than the tokens it was started
Edge will refuse access for new tokens that have a wider or different access scope than the tokens it was started

README.md Outdated
this behavior is still the default, but Edge will log that you should make a choice between dynamic or strict behavior.
If
you
explicitly choose dynamic behavior, Edge will warn about the planned deprecation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if you don't explicitly choose it and we default to it, we still show the warning. It behaves as shown in the PR description of #476

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Changed text to When dynamic behavior is selected (by default or by choice), Edge will print a warning about the planned deprecation

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some things in the behavior descriptions could be rephrased for clarity, but I think this is good for now 👍

@@ -32,7 +32,8 @@ This document contains the help content for the `unleash-edge` command-line prog
* `-b`, `--base-path <BASE_PATH>` — Which base path should this server listen for HTTP traffic on

Default value: ``
* `-w`, `--workers <WORKERS>` — How many workers should be started to handle requests. Defaults to number of physical cpus
* `-w`, `--workers <WORKERS>` — How many workers should be started to handle requests. Defaults to number of physical
cpus
Copy link
Member

@sighphyre sighphyre Jul 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really affect the markdown but what's going on here? IntelliJ enforcing a 120 character line?

Edit: Okay I changed my mind, it's happening everywhere and it makes the commit quite noisy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it

README.md Outdated
be
given
tokens at startup.
Edge will lock down access for new tokens that have a wider or different access scope than the tokens it was started
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is cool but I'd like to get a bit more specific in terms of what access means here. We do a nice job providing examples but I think we can do even better just by explaining what this is.

Let's lift this:

Strict behavior still allows using tokens (both frontend and client) with narrower access than what the tokens it was started with has.

And combine it with this section and then build on that. Something like...?

Edge will refuses requests from SDKs that have a wider or different access scope than the initial tokens. Specifically, this means incoming requests must have a token that exactly matches the environment and is bound to a project or projects specified in that token.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also tell a story on why this is valuable. Struggling to not go "full marketer" here but something like "this gives you more predictable control over which SDKs have access to Edge and prevents you from expanding the scope at runtime accidentally"

README.md Outdated
token accessing a different environment, say production `*:production.<somedifferentrandomstring>` Edge will return 403,
because that would change the scope of access.

Strict behavior still allows using tokens (both frontend and client) with narrower access than what the tokens it was
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could take this and the paragraph below out

README.md Outdated
to be valid, a refresh job will be configured with the minimum set of tokens that are able to fetch all projects and
environments Edge has seen. Set with `--dynamic` or the `DYNAMIC` environment variable. (19.2.0 / July 4th 2024): We're
looking to deprecate this
behavior. If your company needs this behavior, reach out to us on Slack, the final decision has not been made yet. In
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just feels a bit more friendly

Suggested change
behavior. If your company needs this behavior, reach out to us on Slack, the final decision has not been made yet. In
behavior. If you need this behavior, reach out to us on Slack, the final decision has not been made yet. In

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Left some thoughts but I think this tells the story we need it to tell

@chriswk chriswk merged commit 4dc72f3 into main Jul 5, 2024
10 checks passed
@chriswk chriswk deleted the task/readmeAddStrictDynamicMode branch July 5, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants