-
Notifications
You must be signed in to change notification settings - Fork 67
Text check for rollout #1171
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
Merged
Merged
Text check for rollout #1171
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
26709fb
Fix temporary key and contact point msgs
krivard c75f227
Removed exceptions no longer in use
krivard 88ed92d
whitespace and comments
krivard 6f8b018
Synced rollout warnings to approved comms
krivard e6d45d6
Merge branch 'api-keys' into krivard/api-keys-text-check
krivard ea8624a
Apply suggestions from code review
krivard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -22,28 +22,22 @@ | |
| API_KEY_SOFT_WARNING = API_KEY_HARD_WARNING - timedelta(days=14) | ||
|
|
||
| # rollout warning messages | ||
| # intended usage: in place of API_KEY_WARNING_TEXT | ||
| # phase 1 / soft warning: ROLLOUT_WARNING_RATE_LIMIT or ROLLOUT_WARNING_MULTIPLES | ||
| # phase 2 / hard warning: (ROLLOUT_WARNING_RATE_LIMIT + PHASE_2_STOPGAP) or (ROLLOUT_WARNING_MULTIPLES + PHASE_2_STOPGAP) | ||
|
|
||
| ROLLOUT_WARNING_RATE_LIMIT = "This request exceeded the anonymous limit on requests per minute." | ||
| ROLLOUT_WARNING_MULTIPLES = "This request exceeded the anonymous limit on selected multiples." | ||
| _ROLLOUT_WARNING_AD_FRAGMENT = "To be exempt from this limit, authenticate your requests with an API key, which will be enforced starting {}. Registration now available at {}.".format( | ||
| API_KEY_REQUIRED_STARTING_AT, API_KEY_REGISTRATION_FORM_LINK_LOCAL | ||
| ) | ||
| ROLLOUT_WARNING_RATE_LIMIT = "This request exceeded the rate limit on anonymous requests, which will be enforced starting {}.".format(API_KEY_REQUIRED_STARTING_AT) | ||
| ROLLOUT_WARNING_MULTIPLES = "This request exceeded the anonymous limit on selected multiples, which will be enforced starting {}.".format(API_KEY_REQUIRED_STARTING_AT) | ||
| _ROLLOUT_WARNING_AD_FRAGMENT = "To be exempt from this limit, authenticate your requests with a free API key, now available at {}.".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
|
|
||
| PHASE_1_2_STOPGAP = ( # todo: add temporary key | ||
| PHASE_1_2_STOPGAP = ( | ||
| "A temporary public key `{}` is available for use between now and {} to give you time to register or adapt your requests without this message continuing to break your systems." | ||
| ).format(TEMPORARY_API_KEY, API_KEY_REQUIRED_STARTING_AT) | ||
| ).format(TEMPORARY_API_KEY, (API_KEY_REQUIRED_STARTING_AT + timedelta(days=7))) | ||
|
|
||
|
|
||
| # steady-state error messages | ||
| ERROR_MSG_RATE_LIMIT = "Rate limit exceeded for anonymous queries.\nTo remove this limit, register a free API key at {}".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| ERROR_MSG_MULTIPLES = "Requested too many multiples for anonymous queries.\nTo remove this limit, register a free API key at {}".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| ERROR_MSG_RATE_LIMIT = "Rate limit exceeded for anonymous queries. To remove this limit, register a free API key at {}".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| ERROR_MSG_MULTIPLES = "Requested too many multiples for anonymous queries. To remove this limit, register a free API key at {}".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| ERROR_MSG_INVALID_KEY = ( | ||
| "API key does not exist. Register a new key at {} or contact $CONTACT_POINT to troubleshoot".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| "API key does not exist. Register a new key at {} or contact [email protected] to troubleshoot".format(API_KEY_REGISTRATION_FORM_LINK_LOCAL) | ||
| ) | ||
| ERROR_MSG_INVALID_ROLE = "Provided API key does not have access to this endpoint, please contact $CONTACT_POINT." | ||
| ERROR_MSG_INVALID_ROLE = "Provided API key does not have access to this endpoint. Please contact [email protected]." | ||
|
|
||
|
|
||
| def resolve_auth_token() -> Optional[str]: | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.