-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add BrowserID support to Tokenserver
Closes #1215
- Loading branch information
Ethan Donowitz
committed
Feb 4, 2022
1 parent
aa93312
commit 79e9735
Showing
32 changed files
with
2,238 additions
and
1,007 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,9 +189,29 @@ impl Settings { | |
"mysql://[email protected]/tokenserver", | ||
)?; | ||
s.set_default("tokenserver.enabled", false)?; | ||
s.set_default("tokenserver.fxa_email_domain", "test.com")?; | ||
s.set_default( | ||
"tokenserver.fxa_browserid_audience", | ||
"https://token.stage.mozaws.net", | ||
)?; | ||
s.set_default( | ||
"tokenserver.fxa_browserid_issuer", | ||
"api-accounts.stage.mozaws.net", | ||
)?; | ||
s.set_default( | ||
"tokenserver.fxa_browserid_server_url", | ||
"https://verifier.stage.mozaws.net/v2", | ||
)?; | ||
s.set_default("tokenserver.fxa_browserid_request_timeout", 10)?; | ||
s.set_default( | ||
"tokenserver.fxa_email_domain", | ||
"api-accounts.stage.mozaws.net", | ||
)?; | ||
s.set_default("tokenserver.fxa_metrics_hash_secret", "secret")?; | ||
s.set_default("tokenserver.test_mode_enabled", false)?; | ||
s.set_default( | ||
"tokenserver.fxa_oauth_server_url", | ||
"https://oauth.stage.mozaws.net", | ||
)?; | ||
s.set_default("tokenserver.fxa_oauth_request_timeout", 10)?; | ||
s.set_default("tokenserver.node_type", "spanner")?; | ||
s.set_default("tokenserver.statsd_label", "syncstorage.tokenserver")?; | ||
|
||
|
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 |
---|---|---|
|
@@ -24,30 +24,12 @@ This functionality was previously provided by a [Python service](https://github. | |
|
||
## Configuration | ||
|
||
You can find example settings for Tokenserver in [config/local.example.toml](../../config/local.example.toml). The available settings are: | ||
|
||
| Option | Default value | Description | | ||
| --- | --- | --- | | ||
| `disable_syncstorage` | `false` | whether to disable the Sync Storage endpoints (see [Disabling Syncstorage](#disabling-syncstorage) for more information) | | ||
| `tokenserver.database_url` | `"mysql://[email protected]/tokenserver_rs"` | database DSN | | ||
| `tokenserver.database_pool_max_size` | `None` | the maximum number of connections in the database pool | | ||
| `tokenserver.database_pool_min_idle` | `None` | the minimum number of idle database connections to maintain at all times | | ||
| `tokenserver.database_pool_connection_timeout` | `Some(30)` | the timeout (in seconds) when waiting for an available connection | | ||
| `tokenserver.fxa_metrics_hash_secret` | `"secret"` | the secret used to hash users' FxA UIDs | | ||
| `tokenserver.fxa_email_domain` | `"api.accounts.firefox.com"` | the email domain used to contruct the FxA email address from the user's FxA UID | | ||
| `tokenserver.fxa_oauth_server_url` | `None` | the URL of the FxA OAuth server to be used to verify user's OAuth tokens | | ||
| `tokenserver.test_mode_enabled` | `false` | whether to enable Tokenserver's [test mode](#test-mode) | | ||
You can find example settings for Tokenserver in [config/local.example.toml](../../config/local.example.toml). The available settings are described in doc comments [here](../../src/tokenserver/settings.rs). | ||
|
||
### Disabling Syncstorage | ||
|
||
Tokenserver can be run as a standalone service by disabling the Sync Storage endpoints. This can be done simply by setting the `disable_syncstorage` setting to `true`. **Note that the Sync Storage settings must still be set even when those endpoints are disabled.** | ||
|
||
### Test Mode | ||
|
||
When Tokenserver's "test mode" is enabled, OAuth tokens are unpacked without being verified by FxA. Essentially, this allows one to "forge" an OAuth token as though it were created by FxA. This can be useful to test new functionality during development or to run integration tests. | ||
|
||
**NOTE:** This should **never** be run in production. | ||
|
||
### Connecting to Firefox | ||
|
||
1. Visit `about:config` in Firefox | ||
|
Oops, something went wrong.