auth-backend: remove deprecated provider exports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,8 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createAtlassianProvider } from './provider';
|
||||
export type {
|
||||
AtlassianAuthProvider,
|
||||
AtlassianProviderOptions,
|
||||
} from './provider';
|
||||
export { atlassian } from './provider';
|
||||
export type { AtlassianAuthProvider } from './provider';
|
||||
|
||||
@@ -58,6 +58,9 @@ export const atlassianDefaultAuthHandler: AuthHandler<OAuthResult> = async ({
|
||||
profile: makeProfileInfo(fullProfile, params.id_token),
|
||||
});
|
||||
|
||||
/**
|
||||
* @deprecated This export is deprecated and will be removed in the future.
|
||||
*/
|
||||
export class AtlassianAuthProvider implements OAuthHandlers {
|
||||
private readonly _strategy: AtlassianStrategy;
|
||||
private readonly signInResolver?: SignInResolver<OAuthResult>;
|
||||
@@ -161,25 +164,6 @@ export class AtlassianAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type AtlassianProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for atlassian auth
|
||||
*
|
||||
@@ -230,9 +214,3 @@ export const atlassian = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.atlassian.create` instead
|
||||
*/
|
||||
export const createAtlassianProvider = atlassian.create;
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createAuth0Provider } from './provider';
|
||||
export type { Auth0ProviderOptions } from './provider';
|
||||
export { auth0 } from './provider';
|
||||
|
||||
@@ -169,28 +169,6 @@ export class Auth0AuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type Auth0ProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for auth0 auth
|
||||
*
|
||||
@@ -249,9 +227,3 @@ export const auth0 = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.auth0.create` instead.
|
||||
*/
|
||||
export const createAuth0Provider = auth0.create;
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createAwsAlbProvider } from './provider';
|
||||
export type { AwsAlbProviderOptions, AwsAlbResult } from './provider';
|
||||
export { awsAlb } from './provider';
|
||||
export type { AwsAlbResult } from './provider';
|
||||
|
||||
@@ -211,28 +211,6 @@ export class AwsAlbAuthProvider implements AuthProviderRouteHandlers {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type AwsAlbProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<AwsAlbResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<AwsAlbResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for AWS ALB auth
|
||||
*
|
||||
@@ -282,9 +260,3 @@ export const awsAlb = createAuthProviderIntegration({
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.awsAlb.create` instead
|
||||
*/
|
||||
export const createAwsAlbProvider = awsAlb.create;
|
||||
|
||||
@@ -14,13 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export {
|
||||
createBitbucketProvider,
|
||||
bitbucketUsernameSignInResolver,
|
||||
bitbucketUserIdSignInResolver,
|
||||
} from './provider';
|
||||
export { bitbucket } from './provider';
|
||||
export type {
|
||||
BitbucketProviderOptions,
|
||||
BitbucketPassportProfile,
|
||||
BitbucketOAuthResult,
|
||||
} from './provider';
|
||||
|
||||
@@ -190,28 +190,6 @@ export class BitbucketAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type BitbucketProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for BitBucket auth
|
||||
*
|
||||
@@ -305,23 +283,3 @@ export const bitbucket = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.bitbucket.create` instead
|
||||
*/
|
||||
export const createBitbucketProvider = bitbucket.create;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.bitbucket.resolvers.usernameMatchingUserEntityAnnotation()` instead.
|
||||
*/
|
||||
export const bitbucketUsernameSignInResolver =
|
||||
bitbucket.resolvers.usernameMatchingUserEntityAnnotation();
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.bitbucket.resolvers.userIdMatchingUserEntityAnnotation()` instead.
|
||||
*/
|
||||
export const bitbucketUserIdSignInResolver =
|
||||
bitbucket.resolvers.userIdMatchingUserEntityAnnotation();
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020 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 { createGithubProvider } from './github';
|
||||
import { createGitlabProvider } from './gitlab';
|
||||
import { createGoogleProvider } from './google';
|
||||
import { createOAuth2Provider } from './oauth2';
|
||||
import { createOidcProvider } from './oidc';
|
||||
import { createOktaProvider } from './okta';
|
||||
import { createSamlProvider } from './saml';
|
||||
import { createAuth0Provider } from './auth0';
|
||||
import { createMicrosoftProvider } from './microsoft';
|
||||
import { createOneLoginProvider } from './onelogin';
|
||||
import { AuthProviderFactory } from './types';
|
||||
import { createAwsAlbProvider } from './aws-alb';
|
||||
import { createBitbucketProvider } from './bitbucket';
|
||||
import { createAtlassianProvider } from './atlassian';
|
||||
|
||||
export const factories: { [providerId: string]: AuthProviderFactory } = {
|
||||
google: createGoogleProvider(),
|
||||
github: createGithubProvider(),
|
||||
gitlab: createGitlabProvider(),
|
||||
saml: createSamlProvider(),
|
||||
okta: createOktaProvider(),
|
||||
auth0: createAuth0Provider(),
|
||||
microsoft: createMicrosoftProvider(),
|
||||
oauth2: createOAuth2Provider(),
|
||||
oidc: createOidcProvider(),
|
||||
onelogin: createOneLoginProvider(),
|
||||
awsalb: createAwsAlbProvider(),
|
||||
bitbucket: createBitbucketProvider(),
|
||||
atlassian: createAtlassianProvider(),
|
||||
};
|
||||
@@ -14,9 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createGcpIapProvider } from './provider';
|
||||
export type {
|
||||
GcpIapProviderOptions,
|
||||
GcpIapResult,
|
||||
GcpIapTokenInfo,
|
||||
} from './types';
|
||||
export { gcpIap } from './provider';
|
||||
export type { GcpIapResult, GcpIapTokenInfo } from './types';
|
||||
|
||||
@@ -117,9 +117,3 @@ export const gcpIap = createAuthProviderIntegration({
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.gcpIap.create` instead
|
||||
*/
|
||||
export const createGcpIapProvider = gcpIap.create;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { AuthHandler, AuthResponse, SignInResolver } from '../types';
|
||||
import { AuthResponse } from '../types';
|
||||
|
||||
/**
|
||||
* The header name used by the IAP.
|
||||
@@ -69,27 +69,3 @@ export type GcpIapProviderInfo = {
|
||||
* The shape of the response to return to callers.
|
||||
*/
|
||||
export type GcpIapResponse = AuthResponse<GcpIapProviderInfo>;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type GcpIapProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth
|
||||
* response into the profile that will be presented to the user. The default
|
||||
* implementation just provides the authenticated email that the IAP
|
||||
* presented.
|
||||
*/
|
||||
authHandler?: AuthHandler<GcpIapResult>;
|
||||
|
||||
/**
|
||||
* Configures sign-in for this provider.
|
||||
*/
|
||||
signIn: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<GcpIapResult>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createGithubProvider } from './provider';
|
||||
export type { GithubOAuthResult, GithubProviderOptions } from './provider';
|
||||
export { github } from './provider';
|
||||
export type { GithubOAuthResult } from './provider';
|
||||
|
||||
@@ -227,46 +227,6 @@ export class GithubAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type GithubProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<GithubOAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<GithubOAuthResult>;
|
||||
};
|
||||
|
||||
/**
|
||||
* The state encoder used to encode the 'state' parameter on the OAuth request.
|
||||
*
|
||||
* It should return a string that takes the state params (from the request), url encodes the params
|
||||
* and finally base64 encodes them.
|
||||
*
|
||||
* Providing your own stateEncoder will allow you to add addition parameters to the state field.
|
||||
*
|
||||
* It is typed as follows:
|
||||
* `export type StateEncoder = (input: OAuthState) => Promise<{encodedState: string}>;`
|
||||
*
|
||||
* Note: the stateEncoder must encode a 'nonce' value and an 'env' value. Without this, the OAuth flow will fail
|
||||
* (These two values will be set by the req.state by default)
|
||||
*
|
||||
* For more information, please see the helper module in ../../oauth/helpers #readState
|
||||
*/
|
||||
stateEncoder?: StateEncoder;
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for GitHub auth
|
||||
*
|
||||
@@ -381,9 +341,3 @@ export const github = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.github.create` instead
|
||||
*/
|
||||
export const createGithubProvider = github.create;
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createGitlabProvider } from './provider';
|
||||
export type { GitlabProviderOptions } from './provider';
|
||||
export { gitlab } from './provider';
|
||||
|
||||
@@ -178,31 +178,6 @@ export class GitlabAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type GitlabProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*
|
||||
* Set to `'email'` to use the default email-based sign in resolver, which will search
|
||||
* the catalog for a single user entity that has a matching `microsoft.com/email` annotation.
|
||||
*/
|
||||
signIn?: {
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for GitLab auth
|
||||
*
|
||||
@@ -254,9 +229,3 @@ export const gitlab = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.gitlab.create` instead
|
||||
*/
|
||||
export const createGitlabProvider = gitlab.create;
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createGoogleProvider, googleEmailSignInResolver } from './provider';
|
||||
export type { GoogleProviderOptions } from './provider';
|
||||
export { google } from './provider';
|
||||
|
||||
@@ -168,28 +168,6 @@ export class GoogleAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type GoogleProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for Google auth
|
||||
*
|
||||
@@ -272,16 +250,3 @@ export const google = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.google.create` instead.
|
||||
*/
|
||||
export const createGoogleProvider = google.create;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.google.resolvers.emailMatchingUserEntityAnnotation()` instead.
|
||||
*/
|
||||
export const googleEmailSignInResolver =
|
||||
google.resolvers.emailMatchingUserEntityAnnotation();
|
||||
|
||||
@@ -30,9 +30,7 @@ export * from './onelogin';
|
||||
export * from './saml';
|
||||
export * from './gcp-iap';
|
||||
|
||||
export { providers } from './providers';
|
||||
|
||||
export { factories as defaultAuthProviderFactories } from './factories';
|
||||
export { providers, defaultAuthProviderFactories } from './providers';
|
||||
|
||||
export type {
|
||||
AuthProviderConfig,
|
||||
|
||||
@@ -14,8 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export {
|
||||
createMicrosoftProvider,
|
||||
microsoftEmailSignInResolver,
|
||||
} from './provider';
|
||||
export type { MicrosoftProviderOptions } from './provider';
|
||||
export { microsoft } from './provider';
|
||||
|
||||
@@ -190,28 +190,6 @@ export class MicrosoftAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type MicrosoftProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for Microsoft auth
|
||||
*
|
||||
@@ -301,16 +279,3 @@ export const microsoft = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.microsoft.create` instead
|
||||
*/
|
||||
export const createMicrosoftProvider = microsoft.create;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.microsoft.resolvers.emailMatchingUserEntityAnnotation()` instead.
|
||||
*/
|
||||
export const microsoftEmailSignInResolver =
|
||||
microsoft.resolvers.emailMatchingUserEntityAnnotation();
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createOauth2ProxyProvider } from './provider';
|
||||
export type { Oauth2ProxyProviderOptions, OAuth2ProxyResult } from './provider';
|
||||
export { oauth2Proxy } from './provider';
|
||||
export type { OAuth2ProxyResult } from './provider';
|
||||
|
||||
@@ -80,27 +80,6 @@ export type OAuth2ProxyResult<JWTPayload = {}> = {
|
||||
getHeader(name: string): string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type Oauth2ProxyProviderOptions<JWTPayload> = {
|
||||
/**
|
||||
* Configure an auth handler to generate a profile for the user.
|
||||
*/
|
||||
authHandler: AuthHandler<OAuth2ProxyResult<JWTPayload>>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuth2ProxyResult<JWTPayload>>;
|
||||
};
|
||||
};
|
||||
|
||||
interface Options<JWTPayload> {
|
||||
resolverContext: AuthResolverContext;
|
||||
signInResolver: SignInResolver<OAuth2ProxyResult<JWTPayload>>;
|
||||
@@ -231,9 +210,3 @@ export const oauth2Proxy = createAuthProviderIntegration({
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.oauth2Proxy.create` instead
|
||||
*/
|
||||
export const createOauth2ProxyProvider = oauth2Proxy.create;
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createOAuth2Provider } from './provider';
|
||||
export type { OAuth2ProviderOptions } from './provider';
|
||||
export { oauth2 } from './provider';
|
||||
|
||||
@@ -192,18 +192,6 @@ export class OAuth2AuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type OAuth2ProviderOptions = {
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
signIn?: {
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for generic OAuth2 auth
|
||||
*
|
||||
@@ -260,9 +248,3 @@ export const oauth2 = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.oauth2.create` instead
|
||||
*/
|
||||
export const createOAuth2Provider = oauth2.create;
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export type { OidcAuthResult, OidcProviderOptions } from './provider';
|
||||
export { createOidcProvider } from './provider';
|
||||
export { oidc } from './provider';
|
||||
export type { OidcAuthResult } from './provider';
|
||||
|
||||
@@ -23,7 +23,7 @@ import { rest } from 'msw';
|
||||
import { setupServer } from 'msw/node';
|
||||
import { ClientMetadata, IssuerMetadata } from 'openid-client';
|
||||
import { OAuthAdapter } from '../../lib/oauth';
|
||||
import { createOidcProvider, OidcAuthProvider, Options } from './provider';
|
||||
import { oidc, OidcAuthProvider, Options } from './provider';
|
||||
import { AuthResolverContext } from '../types';
|
||||
|
||||
const issuerMetadata = {
|
||||
@@ -155,7 +155,7 @@ describe('OidcAuthProvider', () => {
|
||||
expect(requestSequence).toEqual([0, 1, 2].map(i => requests[i].url));
|
||||
});
|
||||
|
||||
it('createOidcProvider', async () => {
|
||||
it('oidc.create', async () => {
|
||||
const handler = jest.fn((_req, res, ctx) => {
|
||||
return res(
|
||||
ctx.status(200),
|
||||
@@ -172,7 +172,7 @@ describe('OidcAuthProvider', () => {
|
||||
metadataUrl: 'https://oidc.test/.well-known/openid-configuration',
|
||||
},
|
||||
} as any);
|
||||
const provider = createOidcProvider()({
|
||||
const provider = oidc.create()({
|
||||
globalConfig: {
|
||||
appUrl: 'https://oidc.test',
|
||||
baseUrl: 'https://oidc.test',
|
||||
|
||||
@@ -198,18 +198,6 @@ export class OidcAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type OidcProviderOptions = {
|
||||
authHandler?: AuthHandler<OidcAuthResult>;
|
||||
|
||||
signIn?: {
|
||||
resolver: SignInResolver<OidcAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for generic OpenID Connect auth
|
||||
*
|
||||
@@ -268,9 +256,3 @@ export const oidc = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.oidc.create` instead
|
||||
*/
|
||||
export const createOidcProvider = oidc.create;
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createOktaProvider, oktaEmailSignInResolver } from './provider';
|
||||
export type { OktaProviderOptions } from './provider';
|
||||
export { okta } from './provider';
|
||||
|
||||
@@ -192,28 +192,6 @@ export class OktaAuthProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type OktaProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for Okta auth
|
||||
*
|
||||
@@ -305,16 +283,3 @@ export const okta = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.okta.create` instead
|
||||
*/
|
||||
export const createOktaProvider = okta.create;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.okta.resolvers.emailMatchingUserEntityAnnotation()` instead.
|
||||
*/
|
||||
export const oktaEmailSignInResolver =
|
||||
okta.resolvers.emailMatchingUserEntityAnnotation();
|
||||
|
||||
@@ -14,5 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { createOneLoginProvider } from './provider';
|
||||
export type { OneLoginProviderOptions } from './provider';
|
||||
export { onelogin } from './provider';
|
||||
|
||||
@@ -166,28 +166,6 @@ export class OneLoginProvider implements OAuthHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type OneLoginProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<OAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<OAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for OneLogin auth
|
||||
*
|
||||
@@ -244,9 +222,3 @@ export const onelogin = createAuthProviderIntegration({
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.onelogin.create` instead
|
||||
*/
|
||||
export const createOneLoginProvider = onelogin.create;
|
||||
|
||||
@@ -14,21 +14,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { atlassian } from './atlassian/provider';
|
||||
import { auth0 } from './auth0/provider';
|
||||
import { awsAlb } from './aws-alb/provider';
|
||||
import { bitbucket } from './bitbucket/provider';
|
||||
import { gcpIap } from './gcp-iap/provider';
|
||||
import { github } from './github/provider';
|
||||
import { gitlab } from './gitlab/provider';
|
||||
import { google } from './google/provider';
|
||||
import { microsoft } from './microsoft/provider';
|
||||
import { oauth2 } from './oauth2/provider';
|
||||
import { oauth2Proxy } from './oauth2-proxy/provider';
|
||||
import { oidc } from './oidc/provider';
|
||||
import { okta } from './okta/provider';
|
||||
import { onelogin } from './onelogin/provider';
|
||||
import { saml } from './saml/provider';
|
||||
import { atlassian } from './atlassian';
|
||||
import { auth0 } from './auth0';
|
||||
import { awsAlb } from './aws-alb';
|
||||
import { bitbucket } from './bitbucket';
|
||||
import { gcpIap } from './gcp-iap';
|
||||
import { github } from './github';
|
||||
import { gitlab } from './gitlab';
|
||||
import { google } from './google';
|
||||
import { microsoft } from './microsoft';
|
||||
import { oauth2 } from './oauth2';
|
||||
import { oauth2Proxy } from './oauth2-proxy';
|
||||
import { oidc } from './oidc';
|
||||
import { okta } from './okta';
|
||||
import { onelogin } from './onelogin';
|
||||
import { saml } from './saml';
|
||||
import { AuthProviderFactory } from './types';
|
||||
|
||||
/**
|
||||
* All built-in auth provider integrations.
|
||||
@@ -52,3 +53,26 @@ export const providers = Object.freeze({
|
||||
onelogin,
|
||||
saml,
|
||||
});
|
||||
|
||||
/**
|
||||
* All auth provider factories that are installed by default.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const defaultAuthProviderFactories: {
|
||||
[providerId: string]: AuthProviderFactory;
|
||||
} = {
|
||||
google: google.create(),
|
||||
github: github.create(),
|
||||
gitlab: gitlab.create(),
|
||||
saml: saml.create(),
|
||||
okta: okta.create(),
|
||||
auth0: auth0.create(),
|
||||
microsoft: microsoft.create(),
|
||||
oauth2: oauth2.create(),
|
||||
oidc: oidc.create(),
|
||||
onelogin: onelogin.create(),
|
||||
awsalb: awsAlb.create(),
|
||||
bitbucket: bitbucket.create(),
|
||||
atlassian: atlassian.create(),
|
||||
};
|
||||
|
||||
@@ -14,8 +14,5 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export {
|
||||
createSamlProvider,
|
||||
samlNameIdEntityNameSignInResolver,
|
||||
} from './provider';
|
||||
export type { SamlProviderOptions, SamlAuthResult } from './provider';
|
||||
export { saml } from './provider';
|
||||
export type { SamlAuthResult } from './provider';
|
||||
|
||||
@@ -132,28 +132,6 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers {
|
||||
|
||||
type SignatureAlgorithm = 'sha1' | 'sha256' | 'sha512';
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated This type has been inlined into the create method and will be removed.
|
||||
*/
|
||||
export type SamlProviderOptions = {
|
||||
/**
|
||||
* The profile transformation function used to verify and convert the auth response
|
||||
* into the profile that will be presented to the user.
|
||||
*/
|
||||
authHandler?: AuthHandler<SamlAuthResult>;
|
||||
|
||||
/**
|
||||
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
||||
*/
|
||||
signIn?: {
|
||||
/**
|
||||
* Maps an auth result to a Backstage identity for the user.
|
||||
*/
|
||||
resolver: SignInResolver<SamlAuthResult>;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Auth provider integration for SAML auth
|
||||
*
|
||||
@@ -230,16 +208,3 @@ export const saml = createAuthProviderIntegration({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.saml.create` instead
|
||||
*/
|
||||
export const createSamlProvider = saml.create;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated Use `providers.saml.resolvers.nameIdMatchingUserEntityName()` instead.
|
||||
*/
|
||||
export const samlNameIdEntityNameSignInResolver =
|
||||
saml.resolvers.nameIdMatchingUserEntityName();
|
||||
|
||||
Reference in New Issue
Block a user