auth-backend: remove deprecated provider factory fields and types

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-06-17 12:17:11 +02:00
parent 894e3412cf
commit ba0cb5b99b
3 changed files with 3 additions and 43 deletions
@@ -35,7 +35,6 @@ export { providers, defaultAuthProviderFactories } from './providers';
export type {
AuthProviderConfig,
AuthProviderRouteHandlers,
AuthProviderFactoryOptions,
AuthProviderFactory,
AuthHandler,
AuthResolverCatalogUserQuery,
+3 -38
View File
@@ -14,11 +14,8 @@
* limitations under the License.
*/
import {
PluginEndpointDiscovery,
TokenManager,
} from '@backstage/backend-common';
import { CatalogApi, GetEntitiesRequest } from '@backstage/catalog-client';
import { GetEntitiesRequest } from '@backstage/catalog-client';
import { Entity } from '@backstage/catalog-model';
import { Config } from '@backstage/config';
import {
BackstageIdentityResponse,
@@ -26,10 +23,8 @@ import {
} from '@backstage/plugin-auth-node';
import express from 'express';
import { Logger } from 'winston';
import { TokenIssuer, TokenParams } from '../identity/types';
import { TokenParams } from '../identity/types';
import { OAuthStartRequest } from '../lib/oauth/types';
import { CatalogIdentityClient } from '../lib/catalog';
import { Entity } from '@backstage/catalog-model';
/**
* A query for a single user in the catalog.
@@ -69,13 +64,6 @@ export type AuthResolverCatalogUserQuery =
* @public
*/
export type AuthResolverContext = {
/** @deprecated Will be removed from the context, access it via a closure instead if needed */
logger: Logger;
/** @deprecated Use the `issueToken` method instead */
tokenIssuer: TokenIssuer;
/** @deprecated Use the `findCatalogUser` and `signInWithCatalogUser` methods instead, and the `getDefaultOwnershipEntityRefs` helper */
catalogIdentityClient: CatalogIdentityClient;
/**
* Issues a Backstage token using the provided parameters.
*/
@@ -204,35 +192,12 @@ export interface AuthProviderRouteHandlers {
logout?(req: express.Request, res: express.Response): Promise<void>;
}
/**
* @deprecated This type is deprecated and will be removed in a future release.
*/
export type AuthProviderFactoryOptions = {
providerId: string;
globalConfig: AuthProviderConfig;
config: Config;
logger: Logger;
tokenManager: TokenManager;
tokenIssuer: TokenIssuer;
discovery: PluginEndpointDiscovery;
catalogApi: CatalogApi;
};
export type AuthProviderFactory = (options: {
providerId: string;
globalConfig: AuthProviderConfig;
config: Config;
logger: Logger;
resolverContext: AuthResolverContext;
/** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
tokenManager: TokenManager;
/** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
tokenIssuer: TokenIssuer;
/** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
discovery: PluginEndpointDiscovery;
/** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
catalogApi: CatalogApi;
}) => AuthProviderRouteHandlers;
/** @public */
@@ -119,10 +119,6 @@ export async function createRouter(
},
config: providersConfig.getConfig(providerId),
logger,
tokenManager,
tokenIssuer,
discovery,
catalogApi,
resolverContext: CatalogAuthResolverContext.create({
logger,
catalogApi,