feat: Use JsonValue for JWT claim values

Signed-off-by: David Zemon <david@zemon.name>
This commit is contained in:
David Zemon
2022-09-19 08:00:18 -05:00
parent dba3c15c96
commit c8e837da5b
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -706,7 +706,7 @@ export type TokenParams = {
claims: {
sub: string;
ent?: string[];
} & Record<string, string | string[]>;
} & Record<string, JsonValue>;
};
// @public (undocumented)
+5 -2
View File
@@ -14,6 +14,8 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/types';
/** Represents any form of serializable JWK */
export interface AnyJWK extends Record<string, string> {
use: 'sig';
@@ -33,14 +35,15 @@ export type TokenParams = {
* the subject claim, `sub`. It is common to also list entity ownership relations in the
* `ent` list. Additional claims may also be added at the developer's discretion except
* for the following list, which will be overwritten by the TokenIssuer: `iss`, `aud`,
* `iat`, and `exp`.
* `iat`, and `exp`. The Backstage team also maintains the right add new claims in the future
* without listing the change as a "breaking change".
*/
claims: {
/** The token subject, i.e. User ID */
sub: string;
/** A list of entity references that the user claims ownership through */
ent?: string[];
} & Record<string, string | string[]>;
} & Record<string, JsonValue>;
};
/**