From 4a019712b443a63d4a217e085aa9df530368b3d4 Mon Sep 17 00:00:00 2001 From: Tim Hansen Date: Tue, 3 Aug 2021 08:25:40 -0600 Subject: [PATCH] Tweak method name Signed-off-by: Tim Hansen --- .changeset/beige-colts-pump.md | 2 +- docs/auth/identity-resolver.md | 6 +++--- .../src/lib/catalog/CatalogIdentityClient.test.ts | 4 ++-- .../auth-backend/src/lib/catalog/CatalogIdentityClient.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.changeset/beige-colts-pump.md b/.changeset/beige-colts-pump.md index a6c5fe1e1c..c85a260b31 100644 --- a/.changeset/beige-colts-pump.md +++ b/.changeset/beige-colts-pump.md @@ -2,4 +2,4 @@ '@backstage/plugin-auth-backend': patch --- -Added `resolveCatalogMemberClaims` utility to query the catalog for additional authentication claims within sign-in resolvers. +Added `resolveCatalogMembership` utility to query the catalog for additional authentication claims within sign-in resolvers. diff --git a/docs/auth/identity-resolver.md b/docs/auth/identity-resolver.md index 0dc1c7434e..482d4d0314 100644 --- a/docs/auth/identity-resolver.md +++ b/docs/auth/identity-resolver.md @@ -134,7 +134,7 @@ export default async function createPlugin({ const ent = await externalSystemClient.getUsernames(email); // Resolve group membership from the Backstage catalog - const fullEnt = await ctx.catalogIdentityClient.resolveCatalogMemberClaims({ + const fullEnt = await ctx.catalogIdentityClient.resolveCatalogMembership({ sub, ent, logger: ctx.logger, @@ -149,8 +149,8 @@ export default async function createPlugin({ ... ``` -The `resolveCatalogMemberClaims` method will retrieve the `sub` and `ent` -entities from the catalog, if possible, and check for +The `resolveCatalogMembership` method will retrieve the `sub` and `ent` entities +from the catalog, if possible, and check for [memberOf](../features/software-catalog/well-known-relations.md#memberof-and-hasmember) relations to add additional entity claims. diff --git a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts index f5c3219e10..c55ae17919 100644 --- a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts +++ b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts @@ -67,7 +67,7 @@ describe('CatalogIdentityClient', () => { }); }); - it('resolveCatalogMemberClaims resolves membership', async () => { + it('resolveCatalogMembership resolves membership', async () => { const mockUsers: Array = [ { apiVersion: 'backstage.io/v1beta1', @@ -118,7 +118,7 @@ describe('CatalogIdentityClient', () => { tokenIssuer, }); - const claims = await client.resolveCatalogMemberClaims({ + const claims = await client.resolveCatalogMembership({ sub: 'inigom', ent: ['User:default/imontoya', 'User:reality/mpatinkin'], }); diff --git a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts index 7b29ed859b..179843839c 100644 --- a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts +++ b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.ts @@ -86,7 +86,7 @@ export class CatalogIdentityClient { * * Returns a superset of the `ent` argument that can be passed directly to `issueToken` as `ent`. */ - async resolveCatalogMemberClaims({ + async resolveCatalogMembership({ sub, ent, logger,