-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track authentication mode per-auth-token
Previously, we taught Janus to accept authentication tokens presented in HTTP requests as either `DAP-Auth-Token: <token>` or `Authorization: Bearer <token>`. However, we also want a Janus leader to be able to work with a DAP helper that expects only one or the other authentication mode. The `task_aggregator_auth_tokens` and `task_collector_auth_tokens` tables now have columns that track the type of auth token, which is either `DAP_AUTH` or `BEARER`. `send_request_to_helper` will now consult this value to decide how it should authenticate requests. We didn't strictly need this column in `task_collector_auth_tokens` as the leader's collection job handlers will still accept either kind of token, but it's nice to have consistent handling of these types across the two tables. The distinction between DAP-Auth-Token and bearer tokens is plumbed up from `janus_core` through `janus_aggregator` by combining `janus_core::task::AuthenticationToken` with `janus_collector::Authentication` into an enum that distingishes between the two authentication modes and can produce suitable HTTP header names and values. Note that we track authentication mode per-token and not per-task. This means that it's possible for a task to use two different kinds of tokens. A task defined in YAML and provisioned via `janus_cli` may use Bearer tokens, but this isn't yet possible via `janus_aggregator_api`, which still assumes it is receiving or generating `DAP-Auth-Token`-form tokens. The aggregator API for creating tasks will have to change to accomodate the distinction between token types, and that will arrive in a later change so that it can be coordinated with `divviup-api`. Part of #472
- Loading branch information
1 parent
d8498ab
commit a3f657e
Showing
17 changed files
with
443 additions
and
359 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
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
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
Oops, something went wrong.