Merge pull request #12249 from fabbazon/allow-passing-algorithm-for-token

Allow passing algorithm for token
This commit is contained in:
Ben Lambert
2022-06-28 09:59:34 +02:00
committed by GitHub
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Added an option for the auth backend router to select the algorithm for the JWT token signing keys
+2
View File
@@ -650,6 +650,8 @@ export interface RouterOptions {
// (undocumented)
providerFactories?: ProviderFactories;
// (undocumented)
tokenFactoryAlgorithm?: string;
// (undocumented)
tokenManager: TokenManager;
}
@@ -44,6 +44,7 @@ export interface RouterOptions {
config: Config;
discovery: PluginEndpointDiscovery;
tokenManager: TokenManager;
tokenFactoryAlgorithm?: string;
providerFactories?: ProviderFactories;
}
@@ -56,6 +57,7 @@ export async function createRouter(
discovery,
database,
tokenManager,
tokenFactoryAlgorithm,
providerFactories,
} = options;
const router = Router();
@@ -71,6 +73,7 @@ export async function createRouter(
keyStore,
keyDurationSeconds,
logger: logger.child({ component: 'token-factory' }),
algorithm: tokenFactoryAlgorithm,
});
const catalogApi = new CatalogClient({ discoveryApi: discovery });