From 5a0798284782c87aaeb812f5b45bc88d2b693f3c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 9 Apr 2022 10:53:16 +0200 Subject: [PATCH] auth-backend: remove dead code Signed-off-by: Patrik Oldsberg --- .../resolvers/CatalogAuthResolverContext.ts | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts b/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts index 1e2ec1685e..a55bf0789a 100644 --- a/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts +++ b/plugins/auth-backend/src/lib/resolvers/CatalogAuthResolverContext.ts @@ -138,39 +138,4 @@ export class CatalogAuthResolverContext implements AuthResolverContext { }); return { token }; } - /* - async expandCatalogOwnership(query: { entityRefs: string[] }) { - const { entityRefs } = query; - - const compoundRefs = entityRefs.map(ref => - parseEntityRef(ref.toLocaleLowerCase('en-US'), { - defaultKind: 'user', - defaultNamespace: DEFAULT_NAMESPACE, - }), - ); - const stringRefs = compoundRefs.map(e => stringifyEntityRef(e)); - - const { token } = await this.tokenManager.getToken(); - const { items: entities } = await this.catalogApi.getEntities( - { - filter: compoundRefs.map(ref => ({ - kind: ref.kind, - 'metadata.namespace': ref.namespace, - 'metadata.name': ref.name, - })), - }, - { token }, - ); - - if (compoundRefs.length !== entities.length) { - const found = entities.map(e => stringifyEntityRef(e)); - const missing = stringRefs.filter(ref => !found.includes(ref)); - throw new NotFoundError(`Entities not found for refs ${missing.join()}`); - } - - const memberOf = entities.flatMap(e => getDefaultOwnershipEntityRefs(e)); - - return Array.from(new Set(memberOf)); - } -*/ }