@backstage/plugin-auth-backend 0.6.2 → 0.7.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs.js +930 -841
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +56 -7
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -222,6 +222,16 @@ declare class CatalogIdentityClient {
|
|
|
222
222
|
|
|
223
223
|
declare function getEntityClaims(entity: UserEntity): TokenParams['claims'];
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* The context that is used for auth processing.
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
declare type AuthResolverContext = {
|
|
231
|
+
tokenIssuer: TokenIssuer;
|
|
232
|
+
catalogIdentityClient: CatalogIdentityClient;
|
|
233
|
+
logger: Logger;
|
|
234
|
+
};
|
|
225
235
|
declare type AuthProviderConfig = {
|
|
226
236
|
/**
|
|
227
237
|
* The protocol://domain[:port] where the app is hosted. This is used to construct the
|
|
@@ -431,11 +441,7 @@ declare type SignInInfo<TAuthResult> = {
|
|
|
431
441
|
*
|
|
432
442
|
* @public
|
|
433
443
|
*/
|
|
434
|
-
declare type SignInResolver<TAuthResult> = (info: SignInInfo<TAuthResult>, context:
|
|
435
|
-
tokenIssuer: TokenIssuer;
|
|
436
|
-
catalogIdentityClient: CatalogIdentityClient;
|
|
437
|
-
logger: Logger;
|
|
438
|
-
}) => Promise<BackstageSignInResult>;
|
|
444
|
+
declare type SignInResolver<TAuthResult> = (info: SignInInfo<TAuthResult>, context: AuthResolverContext) => Promise<BackstageSignInResult>;
|
|
439
445
|
/**
|
|
440
446
|
* The return type of an authentication handler. Must contain valid profile
|
|
441
447
|
* information.
|
|
@@ -458,7 +464,7 @@ declare type AuthHandlerResult = {
|
|
|
458
464
|
*
|
|
459
465
|
* @public
|
|
460
466
|
*/
|
|
461
|
-
declare type AuthHandler<TAuthResult> = (input: TAuthResult) => Promise<AuthHandlerResult>;
|
|
467
|
+
declare type AuthHandler<TAuthResult> = (input: TAuthResult, context: AuthResolverContext) => Promise<AuthHandlerResult>;
|
|
462
468
|
declare type StateEncoder = (req: OAuthStartRequest) => Promise<{
|
|
463
469
|
encodedState: string;
|
|
464
470
|
}>;
|
|
@@ -751,6 +757,49 @@ declare type OAuth2ProviderOptions = {
|
|
|
751
757
|
};
|
|
752
758
|
declare const createOAuth2Provider: (options?: OAuth2ProviderOptions | undefined) => AuthProviderFactory;
|
|
753
759
|
|
|
760
|
+
/**
|
|
761
|
+
* JWT header extraction result, containing the raw value and the parsed JWT
|
|
762
|
+
* payload.
|
|
763
|
+
*
|
|
764
|
+
* @public
|
|
765
|
+
*/
|
|
766
|
+
declare type OAuth2ProxyResult<JWTPayload> = {
|
|
767
|
+
/**
|
|
768
|
+
* Parsed and decoded JWT payload.
|
|
769
|
+
*/
|
|
770
|
+
fullProfile: JWTPayload;
|
|
771
|
+
/**
|
|
772
|
+
* Raw JWT token
|
|
773
|
+
*/
|
|
774
|
+
accessToken: string;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* Options for the oauth2-proxy provider factory
|
|
778
|
+
*
|
|
779
|
+
* @public
|
|
780
|
+
*/
|
|
781
|
+
declare type Oauth2ProxyProviderOptions<JWTPayload> = {
|
|
782
|
+
/**
|
|
783
|
+
* Configure an auth handler to generate a profile for the user.
|
|
784
|
+
*/
|
|
785
|
+
authHandler: AuthHandler<OAuth2ProxyResult<JWTPayload>>;
|
|
786
|
+
/**
|
|
787
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
788
|
+
*/
|
|
789
|
+
signIn: {
|
|
790
|
+
/**
|
|
791
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
792
|
+
*/
|
|
793
|
+
resolver: SignInResolver<OAuth2ProxyResult<JWTPayload>>;
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
/**
|
|
797
|
+
* Factory function for oauth2-proxy auth provider
|
|
798
|
+
*
|
|
799
|
+
* @public
|
|
800
|
+
*/
|
|
801
|
+
declare const createOauth2ProxyProvider: <JWTPayload>(options: Oauth2ProxyProviderOptions<JWTPayload>) => AuthProviderFactory;
|
|
802
|
+
|
|
754
803
|
/**
|
|
755
804
|
* authentication result for the OIDC which includes the token set and user information (a profile response sent by OIDC server)
|
|
756
805
|
* @public
|
|
@@ -945,4 +994,4 @@ declare type WebMessageResponse = {
|
|
|
945
994
|
declare const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void;
|
|
946
995
|
declare const ensuresXRequestedWith: (req: express.Request) => boolean;
|
|
947
996
|
|
|
948
|
-
export { AtlassianAuthProvider, AtlassianProviderOptions, Auth0ProviderOptions, AuthHandler, AuthHandlerResult, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BackstageIdentityResponse, BackstageSignInResult, BackstageUserIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, GcpIapProviderOptions, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, OidcAuthResult, OidcProviderOptions, OktaProviderOptions, OneLoginProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, SignInInfo, SignInResolver, TokenIssuer, WebMessageResponse, bitbucketUserIdSignInResolver, bitbucketUsernameSignInResolver, createAtlassianProvider, createAuth0Provider, createAwsAlbProvider, createBitbucketProvider, createGcpIapProvider, createGithubProvider, createGitlabProvider, createGoogleProvider, createMicrosoftProvider, createOAuth2Provider, createOidcProvider, createOktaProvider, createOneLoginProvider, createOriginFilter, createRouter, createSamlProvider, factories as defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, prepareBackstageIdentityResponse, readState, verifyNonce };
|
|
997
|
+
export { AtlassianAuthProvider, AtlassianProviderOptions, Auth0ProviderOptions, AuthHandler, AuthHandlerResult, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResolverContext, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BackstageIdentityResponse, BackstageSignInResult, BackstageUserIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, GcpIapProviderOptions, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, Oauth2ProxyProviderOptions, OidcAuthResult, OidcProviderOptions, OktaProviderOptions, OneLoginProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, SignInInfo, SignInResolver, TokenIssuer, WebMessageResponse, bitbucketUserIdSignInResolver, bitbucketUsernameSignInResolver, createAtlassianProvider, createAuth0Provider, createAwsAlbProvider, createBitbucketProvider, createGcpIapProvider, createGithubProvider, createGitlabProvider, createGoogleProvider, createMicrosoftProvider, createOAuth2Provider, createOauth2ProxyProvider, createOidcProvider, createOktaProvider, createOneLoginProvider, createOriginFilter, createRouter, createSamlProvider, factories as defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, prepareBackstageIdentityResponse, readState, verifyNonce };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-backend",
|
|
3
3
|
"description": "A Backstage backend plugin that handles authentication",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0-next.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"clean": "backstage-cli clean"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@backstage/backend-common": "^0.10.
|
|
34
|
-
"@backstage/catalog-client": "^0.5.
|
|
35
|
-
"@backstage/catalog-model": "^0.9.
|
|
36
|
-
"@backstage/config": "^0.1.
|
|
33
|
+
"@backstage/backend-common": "^0.10.4-next.0",
|
|
34
|
+
"@backstage/catalog-client": "^0.5.5-next.0",
|
|
35
|
+
"@backstage/catalog-model": "^0.9.10-next.0",
|
|
36
|
+
"@backstage/config": "^0.1.13-next.0",
|
|
37
37
|
"@backstage/errors": "^0.2.0",
|
|
38
38
|
"@backstage/types": "^0.1.1",
|
|
39
39
|
"@google-cloud/firestore": "^4.15.1",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"yn": "^4.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
77
|
-
"@backstage/test-utils": "^0.2.
|
|
76
|
+
"@backstage/cli": "^0.12.0-next.0",
|
|
77
|
+
"@backstage/test-utils": "^0.2.3-next.0",
|
|
78
78
|
"@types/body-parser": "^1.19.0",
|
|
79
79
|
"@types/cookie-parser": "^1.4.2",
|
|
80
80
|
"@types/express-session": "^1.17.2",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"config.d.ts"
|
|
95
95
|
],
|
|
96
96
|
"configSchema": "config.d.ts",
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "31184691d5a38cb78b091c8f7ad6db80604519a6"
|
|
98
98
|
}
|