-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
refactor(config): support hot reloading #667
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aeneasr
force-pushed
the
reload
branch
10 times, most recently
from
May 9, 2022 07:25
3a0c952
to
fe64ab0
Compare
aeneasr
force-pushed
the
reload
branch
3 times, most recently
from
May 13, 2022 18:16
0899ea3
to
5f156bd
Compare
5 tasks
This patch updates the config system to be replacable and uses functions instead of struct fields. This allows implementing hot reloading mechanisms easily. BREAKING CHANGES: Please be aware that several internal APIs have changed, as well as public methods. Most notably, we added the context to all `Write*` metods. ```patch type OAuth2Provider interface { - WriteAuthorizeError(rw http.ResponseWriter, requester AuthorizeRequester, err error) + WriteAuthorizeError(ctx context.Context, rw http.ResponseWriter, requester AuthorizeRequester, err error) - WriteAuthorizeResponse(rw http.ResponseWriter, requester AuthorizeRequester, responder AuthorizeResponder) + WriteAuthorizeResponse(ctx context.Context, rw http.ResponseWriter, requester AuthorizeRequester, responder AuthorizeResponder) - WriteAccessError(rw http.ResponseWriter, requester AccessRequester, err error) + WriteAccessError(ctx context.Context, rw http.ResponseWriter, requester AccessRequester, err error) - WriteAccessResponse(rw http.ResponseWriter, requester AccessRequester, responder AccessResponder) + WriteAccessResponse(ctx context.Context, rw http.ResponseWriter, requester AccessRequester, responder AccessResponder) - WriteRevocationResponse(rw http.ResponseWriter, err error) + WriteRevocationResponse(ctx context.Context, rw http.ResponseWriter, err error) - WriteIntrospectionError(rw http.ResponseWriter, err error) + WriteIntrospectionError(ctx context.Context, rw http.ResponseWriter, err error) - WriteIntrospectionResponse(rw http.ResponseWriter, r IntrospectionResponder) + WriteIntrospectionResponse(ctx context.Context, rw http.ResponseWriter, r IntrospectionResponder) } ``` The default config struct has moved from package `github.com/ory/fosite/compose.Config` to `github.com/ory/fosite.Config`. Struct `github.com/ory/fosite.Fosite` no longer has any configuration parameters itself. Please note that the HMAC / global secret has to be set no longer in the compose call, but in the config initialization: ```patch -compose.ComposeAllEnabled(&compose.Config{}, store, secret, privateKey) +compose.ComposeAllEnabled(&fosite.Config{GlobalSecret: secret}, store, privateKey) ``` Many internal interfaces have been changed, usually adding `ctx context.Context` as the first parameter. Closes #666
cfryanr
added a commit
to vmware-tanzu/pinniped
that referenced
this pull request
Dec 14, 2022
Most of the changes in this commit are because of these fosite PRs which changed behavior and/or APIs in fosite: - ory/fosite#667 - ory/fosite#679 (from me!) - ory/fosite#675 - ory/fosite#688 Due to the changes in fosite PR #688, we need to bump our storage version for anything which stores the DefaultSession struct as JSON.
cfryanr
added a commit
to vmware-tanzu/pinniped
that referenced
this pull request
Dec 14, 2022
Most of the changes in this commit are because of these fosite PRs which changed behavior and/or APIs in fosite: - ory/fosite#667 - ory/fosite#679 (from me!) - ory/fosite#675 - ory/fosite#688 Due to the changes in fosite PR #688, we need to bump our storage version for anything which stores the DefaultSession struct as JSON.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch updates the config system to be replacable and uses functions instead of struct fields. This allows implementing hot reloading mechanisms easily.
BREAKING CHANGES: Please be aware that several internal APIs have changed, as well as public methods. Most notably, we added the context to all
Write*
metods.The default config struct has moved from package
github.com/ory/fosite/compose.Config
togithub.com/ory/fosite.Config
.Please note that the HMAC / global secret has to be set no longer in the compose call, but in the config initialization:
Closes #666