-
Notifications
You must be signed in to change notification settings - Fork 11
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
Changes from 7 commits
463cf49
119eea0
16d40e7
9868b84
a632c6f
f2d9392
875cbcc
71649fa
18e1446
564e3ce
80cec0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,6 +43,49 @@ Running Edge in Docker with our recommended setup: | |||||
docker run -it -p 3063:3063 -e STRICT=true -e UPSTREAM_URL=<yourunleashinstance> unleashorg/unleash-edge:<mostrecentversion> edge | ||||||
``` | ||||||
|
||||||
## Edge behaviors | ||||||
|
||||||
As of version 19.2.0, Unleash Edge now supports two behaviors when running in edge mode: **strict** and **dynamic**. We recommend adopting the new **strict** behavior, while **dynamic** remains as a legacy option that will be deprecated and removed in a future release. | ||||||
|
||||||
For legacy reasons, **dynamic** behavior is still the default. However, a warning will be logged at startup to indicate its deprecation. | ||||||
|
||||||
Please note that these behaviors are mutually exclusive. | ||||||
|
||||||
### Strict behavior | ||||||
|
||||||
If started with the `--strict` flag or the `STRICT` environment variable, Edge now starts with strict behavior and must | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" |
||||||
with. | ||||||
|
||||||
E.g. if you start with one wildcard token with access to development `*:development.<somelongrandomstring` and later a | ||||||
client comes with a | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could take this and the paragraph below out |
||||||
started with has. | ||||||
|
||||||
E.g. If you start with one wildcard token with access to the development | ||||||
environment `*:development.<somelongrandomstring>` and your clients use various tokens with access to specific projects | ||||||
in the development environment, Edge will filter features to only grant access to the narrower scope. | ||||||
|
||||||
### Dynamic behavior | ||||||
|
||||||
With dynamic behavior, Edge behaves as it has since v1.0.0. Any new client tokens are validated against upstream and if | ||||||
found | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just feels a bit more friendly
Suggested change
|
||||||
19.2.0 | ||||||
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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's true. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Changed text to |
||||||
|
||||||
## Deploying | ||||||
|
||||||
See our page on [Deploying Edge](./docs/deploying.md) | ||||||
|
@@ -121,7 +164,8 @@ See more about available logging and log levels at https://docs.rs/env_logger/la | |||||
|
||||||
- Old Edge version. In order to guarantee metrics on newer Unleash versions, you will need to be using Edge v17.0.0 or | ||||||
newer | ||||||
- Old SDK clients. We've noticed that some clients, particularly early Python (1.x branch) as well as earlier .NET SDKs (we | ||||||
- Old SDK clients. We've noticed that some clients, particularly early Python (1.x branch) as well as earlier .NET | ||||||
SDKs (we | ||||||
recommend you use 4.1.5 or newer) struggle to post metrics with the strict headers Edge requires. | ||||||
|
||||||
## Development | ||||||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it