mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Require at least one scope for API key granular mode (#31253)
Currently, if creating an API key in "granular" mode, and not selecting any scopes, a globally scoped API key is created. This can be surprising and is not ideal. Having a key with no scopes isn't useful in the first place, so this PR adds client- and server side validations to check that at least one scope is selected if using "granular" mode.
This commit is contained in:
@@ -5478,6 +5478,7 @@ en:
|
||||
When using scopes, you can restrict an API key to a specific set of endpoints.
|
||||
You can also define which parameters will be allowed. Use commas to separate multiple values.
|
||||
title: Scopes
|
||||
one_or_more: At least one scope must be selected.
|
||||
granular: Granular
|
||||
read_only: Read-only
|
||||
global: Global
|
||||
|
||||
@@ -847,6 +847,9 @@ en:
|
||||
attributes:
|
||||
linkable_type:
|
||||
invalid: "is not valid"
|
||||
api_key:
|
||||
base:
|
||||
at_least_one_granular_scope: "at least one must be selected"
|
||||
|
||||
uncategorized_category_name: "Uncategorized"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user