-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[authorizer] prepare Authorizer for SubjectId rollout #19195
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
Conversation
@@ -165,7 +166,8 @@ export type RequestContextSeed = Omit<RequestContext, "requestId" | "startTime" | |||
}; | |||
|
|||
/** | |||
* The context all our request-handling code should run in. | |||
* Creates a _root_ context request-handling code should run in. MANDATORY for any authorization to work. |
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.
if we never want to nest these, we should add a check and throw an error in case we do
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.
That's an excellent point. I will add an error log for now, and make a note to bump it to an error next week (after checking it does not break somewhere) to not defer progress here. 📓
it("all tests", async () => { | ||
interface Test { | ||
name: string; | ||
passed: Subject; |
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.
nit: passedSubjectId
would have helped me understanding the purpose of this
1f93161
to
133cab5
Compare
/unhold |
Description
Prepares the central function in
Authorizer
to switch the way we determineSubjectId
, and adds exhaustive tests for it.Summary generated by Copilot
🤖[deprecated] Generated by Copilot at 1f93161
Refactored and tested the authorization logic for handling different subjects in the request context. Moved some types and functions to separate files for better organization and readability. Added error handling and metrics for missing subject id when a feature flag is on. Improved the documentation and comments for the request context interface and related utilities.
Related Issue(s)
Related: EXP-1022
How to test
Documentation
Preview status
gitpod:summary
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold