-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Separate authentication from authorization (#5545) * Separate authentication from authorization Overhaul beater/authorization (now beater/auth) to provide two primary interfaces: Authenticator and Authorizer. Authenticator is responsible for authenticating a client (typically but not always an agent), returning authentication details (e.g. username for API Key) and an Authorizer for authorizing specific actions. The auth middleware and interceptor authenticate and store the returned Authorizer in request context, so it can be used by specific method handlers. Authorize accepts an auth.Action and auth.Resource to authorize. HTTP and gRPC status codes are changed to follow the semantics more correctly. Failure to authenticate leads to 401 (HTTP) and Unauthenticated (gRPC). Failure to authorize leads to 403 (HTTP) and PermissionDenied (gRPC). * tests/system: adjust test for API Key handling We no longer cache API Key credentials which are malformatted, i.e. where they're not base64-encoded id:key. Update the test to match the new behaviour. * tests/system: adjust to new RUM auth behaviour We now behave the same for RUM as for backend agents when auth is not configured. That is, no rate limiting and no agent config restriction. These only apply when auth is configured, so update the tests to configure auth. * Fix comments (cherry picked from commit b742bbf) # Conflicts: # changelogs/head.asciidoc * Delete head.asciidoc Co-authored-by: Andrew Wilkins <[email protected]>
- Loading branch information
1 parent
7bd1300
commit 83774cb
Showing
64 changed files
with
1,539 additions
and
1,679 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
...roved/integration/TestSourcemapHandler_AuthorizationMiddleware/Unauthorized.approved.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"error": "missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
"error": "authentication failed: missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
...ved/integration/TestConfigAgentHandler_AuthorizationMiddleware/Unauthorized.approved.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"error": "missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
"error": "authentication failed: missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
} |
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
3 changes: 0 additions & 3 deletions
3
beater/api/intake/test_approved/TestRateLimiting/LimiterAllowAll.approved.json
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
beater/api/intake/test_approved/TestRateLimiting/LimiterDeny.approved.json
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
beater/api/intake/test_approved/TestRateLimiting/LimiterDenyAll.approved.json
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...er/api/intake/test_approved/TestRateLimiting/LimiterPartiallyUsedLimitAllow.approved.json
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
beater/api/intake/test_approved/TestRateLimiting/LimiterPartiallyUsedLimitDeny.approved.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ation/backend/TestIntakeBackendHandler_AuthorizationMiddleware/Unauthorized.approved.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"error": "missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
"error": "authentication failed: missing or improperly formatted Authorization header: expected 'Authorization: Bearer secret_token' or 'Authorization: ApiKey base64(API key ID:API key)'" | ||
} |
Oops, something went wrong.