From b4fc6e316429ee549a998d8feb7e8f2b24609f7b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 15 Feb 2024 18:57:04 +0100 Subject: [PATCH] auth-node: deprecate getBearerTokenFromAuthorizationHeader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Co-authored-by: Carl-Erik Bergström Co-authored-by: blam Signed-off-by: Patrik Oldsberg --- .changeset/chilled-dolls-accept.md | 5 +++++ plugins/auth-node/api-report.md | 2 +- .../src/identity/getBearerTokenFromAuthorizationHeader.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilled-dolls-accept.md diff --git a/.changeset/chilled-dolls-accept.md b/.changeset/chilled-dolls-accept.md new file mode 100644 index 0000000000..1df2b0dc98 --- /dev/null +++ b/.changeset/chilled-dolls-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +Deprecated the `getBearerTokenFromAuthorizationHeader` function, which is being replaced by the new `HttpAuthService`. diff --git a/plugins/auth-node/api-report.md b/plugins/auth-node/api-report.md index 5c8c547442..26e11236d2 100644 --- a/plugins/auth-node/api-report.md +++ b/plugins/auth-node/api-report.md @@ -223,7 +223,7 @@ export class DefaultIdentityClient implements IdentityApi { // @public (undocumented) export function encodeOAuthState(state: OAuthState): string; -// @public +// @public @deprecated export function getBearerTokenFromAuthorizationHeader( authorizationHeader: unknown, ): string | undefined; diff --git a/plugins/auth-node/src/identity/getBearerTokenFromAuthorizationHeader.ts b/plugins/auth-node/src/identity/getBearerTokenFromAuthorizationHeader.ts index 8451cd6ab1..f9ed969144 100644 --- a/plugins/auth-node/src/identity/getBearerTokenFromAuthorizationHeader.ts +++ b/plugins/auth-node/src/identity/getBearerTokenFromAuthorizationHeader.ts @@ -24,6 +24,7 @@ * call it directly with e.g. the output of `req.header('authorization')` * without first checking that it exists. * + * @deprecated Use the `credentials` method of `HttpAuthService` from `@backstage/backend-plugin-api` instead * @public */ export function getBearerTokenFromAuthorizationHeader(