auth-backend: remove deprecated identity exports

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-06-17 12:17:29 +02:00
parent ba0cb5b99b
commit 36e4377480
7 changed files with 5 additions and 56 deletions
+1 -1
View File
@@ -20,4 +20,4 @@ export { DatabaseKeyStore } from './DatabaseKeyStore';
export { MemoryKeyStore } from './MemoryKeyStore';
export { FirestoreKeyStore } from './FirestoreKeyStore';
export { KeyStores } from './KeyStores';
export type { KeyStore, TokenIssuer, TokenParams } from './types';
export type { KeyStore, TokenParams } from './types';
+1 -3
View File
@@ -37,12 +37,10 @@ export type TokenParams = {
};
};
// TODO(Rugvip): This should at least be made internal
/**
* A TokenIssuer is able to issue verifiable ID Tokens on demand.
*
* @public
* @deprecated This interface is deprecated and will be removed in a future release.
* @internal
*/
export type TokenIssuer = {
/**
+1 -1
View File
@@ -21,7 +21,7 @@
*/
export * from './service/router';
export type { TokenIssuer, TokenParams } from './identity';
export type { TokenParams } from './identity';
export * from './providers';
// flow package provides 2 functions
@@ -1,41 +0,0 @@
/*
* Copyright 2021 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
RELATION_MEMBER_OF,
stringifyEntityRef,
UserEntity,
} from '@backstage/catalog-model';
import { TokenParams } from '../../identity';
/**
* @deprecated use {@link getDefaultOwnershipEntityRefs} instead
*/
export function getEntityClaims(entity: UserEntity): TokenParams['claims'] {
const userRef = stringifyEntityRef(entity);
const membershipRefs =
entity.relations
?.filter(
r => r.type === RELATION_MEMBER_OF && r.targetRef.startsWith('group:'),
)
.map(r => r.targetRef) ?? [];
return {
sub: userRef,
ent: [userRef, ...membershipRefs],
};
}
@@ -15,4 +15,3 @@
*/
export { CatalogIdentityClient } from './CatalogIdentityClient';
export { getEntityClaims } from './helpers';
@@ -31,7 +31,6 @@ import {
isError,
NotAllowedError,
} from '@backstage/errors';
import { TokenIssuer } from '../../identity/types';
import { defaultCookieConfigurer, readState, verifyNonce } from './helpers';
import { postMessageResponse, ensuresXRequestedWith } from '../flow';
import {
@@ -52,8 +51,6 @@ export type Options = {
cookieDomain: string;
cookiePath: string;
appOrigin: string;
/** @deprecated This option is no longer needed */
tokenIssuer?: TokenIssuer;
isOriginAllowed: (origin: string) => boolean;
callbackUrl: string;
};
@@ -61,10 +58,7 @@ export class OAuthAdapter implements AuthProviderRouteHandlers {
static fromConfig(
config: AuthProviderConfig,
handlers: OAuthHandlers,
options: Pick<
Options,
'providerId' | 'persistScopes' | 'tokenIssuer' | 'callbackUrl'
>,
options: Pick<Options, 'providerId' | 'persistScopes' | 'callbackUrl'>,
): OAuthAdapter {
const { origin: appOrigin } = new URL(config.appUrl);
@@ -25,8 +25,7 @@ import {
} from '@backstage/catalog-model';
import { ConflictError, InputError, NotFoundError } from '@backstage/errors';
import { Logger } from 'winston';
import { TokenIssuer } from '../..';
import { TokenParams } from '../../identity';
import { TokenIssuer, TokenParams } from '../../identity/types';
import { AuthResolverContext } from '../../providers';
import { AuthResolverCatalogUserQuery } from '../../providers/types';
import { CatalogIdentityClient } from '../catalog';