From 579afd0d3205548261334d476900721e19413561 Mon Sep 17 00:00:00 2001 From: Frank Kong Date: Fri, 14 Jun 2024 16:55:00 -0400 Subject: [PATCH 1/2] chore(auth-node): allow declarative signin resolvers to take precedence Signed-off-by: Frank Kong --- .changeset/neat-socks-cheer.md | 5 +++++ plugins/auth-node/src/oauth/createOAuthProviderFactory.ts | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/neat-socks-cheer.md diff --git a/.changeset/neat-socks-cheer.md b/.changeset/neat-socks-cheer.md new file mode 100644 index 0000000000..5e2879b0a3 --- /dev/null +++ b/.changeset/neat-socks-cheer.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +allow declarative sign in resolvers declared in `signInResolverFactories` to take precedence over the statically defined sign in resolvers in `signInResolver` for the `createOAuthProviderFactory`. diff --git a/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts b/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts index a3387b7038..fccfcb94de 100644 --- a/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts +++ b/plugins/auth-node/src/oauth/createOAuthProviderFactory.ts @@ -43,11 +43,10 @@ export function createOAuthProviderFactory(options: { return ctx => { return OAuthEnvironmentHandler.mapConfig(ctx.config, envConfig => { const signInResolver = - options.signInResolver ?? readDeclarativeSignInResolver({ config: envConfig, signInResolverFactories: options.signInResolverFactories ?? {}, - }); + }) ?? options.signInResolver; return createOAuthRouteHandlers({ authenticator: options.authenticator, From f71e33bc6de94a785048c20d78a86b97b0926f14 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 6 Aug 2024 13:26:28 +0200 Subject: [PATCH 2/2] Update .changeset/neat-socks-cheer.md Signed-off-by: Patrik Oldsberg --- .changeset/neat-socks-cheer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/neat-socks-cheer.md b/.changeset/neat-socks-cheer.md index 5e2879b0a3..ffc76bec3f 100644 --- a/.changeset/neat-socks-cheer.md +++ b/.changeset/neat-socks-cheer.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-auth-node': patch +'@backstage/plugin-auth-node': minor --- -allow declarative sign in resolvers declared in `signInResolverFactories` to take precedence over the statically defined sign in resolvers in `signInResolver` for the `createOAuthProviderFactory`. +**BREAKING**: Sign-in resolvers configured via `.signIn.resolvers` now take precedence over sign-in resolvers passed to `signInResolver` option of `createOAuthProviderFactory`. This effectively makes sign-in resolvers passed via the `signInResolver` the default one, which you can then override through configuration.