@backstage/plugin-auth-backend 0.4.6 → 0.4.10
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 +58 -0
- package/README.md +6 -6
- package/config.d.ts +1 -0
- package/dist/index.cjs.js +266 -178
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +40 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { UserEntity, Entity } from '@backstage/catalog-model';
|
|
|
7
7
|
import { Config } from '@backstage/config';
|
|
8
8
|
import { Profile } from 'passport';
|
|
9
9
|
import { JSONWebKey } from 'jose';
|
|
10
|
+
import { TokenSet, UserinfoResponse } from 'openid-client';
|
|
10
11
|
|
|
11
12
|
/** Represents any form of serializable JWK */
|
|
12
13
|
interface AnyJWK extends Record<string, string> {
|
|
@@ -213,6 +214,8 @@ declare class CatalogIdentityClient {
|
|
|
213
214
|
resolveCatalogMembership({ entityRefs, logger, }: MemberClaimQuery): Promise<string[]>;
|
|
214
215
|
}
|
|
215
216
|
|
|
217
|
+
declare function getEntityClaims(entity: UserEntity): TokenParams['claims'];
|
|
218
|
+
|
|
216
219
|
declare type AuthProviderConfig = {
|
|
217
220
|
/**
|
|
218
221
|
* The protocol://domain[:port] where the app is hosted. This is used to construct the
|
|
@@ -552,6 +555,18 @@ declare type OAuth2ProviderOptions = {
|
|
|
552
555
|
};
|
|
553
556
|
declare const createOAuth2Provider: (options?: OAuth2ProviderOptions | undefined) => AuthProviderFactory;
|
|
554
557
|
|
|
558
|
+
declare type AuthResult = {
|
|
559
|
+
tokenset: TokenSet;
|
|
560
|
+
userinfo: UserinfoResponse;
|
|
561
|
+
};
|
|
562
|
+
declare type OidcProviderOptions = {
|
|
563
|
+
authHandler?: AuthHandler<AuthResult>;
|
|
564
|
+
signIn?: {
|
|
565
|
+
resolver?: SignInResolver<AuthResult>;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
declare const createOidcProvider: (options?: OidcProviderOptions | undefined) => AuthProviderFactory;
|
|
569
|
+
|
|
555
570
|
declare const oktaEmailSignInResolver: SignInResolver<OAuthResult>;
|
|
556
571
|
declare type OktaProviderOptions = {
|
|
557
572
|
/**
|
|
@@ -676,6 +691,30 @@ declare type AwsAlbProviderOptions = {
|
|
|
676
691
|
};
|
|
677
692
|
declare const createAwsAlbProvider: (options?: AwsAlbProviderOptions | undefined) => AuthProviderFactory;
|
|
678
693
|
|
|
694
|
+
/** @public */
|
|
695
|
+
declare type SamlAuthResult = {
|
|
696
|
+
fullProfile: any;
|
|
697
|
+
};
|
|
698
|
+
/** @public */
|
|
699
|
+
declare type SamlProviderOptions = {
|
|
700
|
+
/**
|
|
701
|
+
* The profile transformation function used to verify and convert the auth response
|
|
702
|
+
* into the profile that will be presented to the user.
|
|
703
|
+
*/
|
|
704
|
+
authHandler?: AuthHandler<SamlAuthResult>;
|
|
705
|
+
/**
|
|
706
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
707
|
+
*/
|
|
708
|
+
signIn?: {
|
|
709
|
+
/**
|
|
710
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
711
|
+
*/
|
|
712
|
+
resolver?: SignInResolver<SamlAuthResult>;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
/** @public */
|
|
716
|
+
declare const createSamlProvider: (options?: SamlProviderOptions | undefined) => AuthProviderFactory;
|
|
717
|
+
|
|
679
718
|
declare const factories: {
|
|
680
719
|
[providerId: string]: AuthProviderFactory;
|
|
681
720
|
};
|
|
@@ -708,4 +747,4 @@ declare type WebMessageResponse = {
|
|
|
708
747
|
declare const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void;
|
|
709
748
|
declare const ensuresXRequestedWith: (req: express.Request) => boolean;
|
|
710
749
|
|
|
711
|
-
export { AtlassianAuthProvider, AtlassianProviderOptions, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, OktaProviderOptions, ProfileInfo, RouterOptions, TokenIssuer, WebMessageResponse, bitbucketUserIdSignInResolver, bitbucketUsernameSignInResolver, createAtlassianProvider, createAwsAlbProvider, createBitbucketProvider, createGithubProvider, createGitlabProvider, createGoogleProvider, createMicrosoftProvider, createOAuth2Provider, createOktaProvider, createOriginFilter, createRouter, factories as defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, readState, verifyNonce };
|
|
750
|
+
export { AtlassianAuthProvider, AtlassianProviderOptions, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, OktaProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, TokenIssuer, WebMessageResponse, bitbucketUserIdSignInResolver, bitbucketUsernameSignInResolver, createAtlassianProvider, createAwsAlbProvider, createBitbucketProvider, createGithubProvider, createGitlabProvider, createGoogleProvider, createMicrosoftProvider, createOAuth2Provider, createOidcProvider, createOktaProvider, createOriginFilter, createRouter, createSamlProvider, factories as defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, 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.
|
|
4
|
+
"version": "0.4.10",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -30,19 +30,18 @@
|
|
|
30
30
|
"clean": "backstage-cli clean"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@backstage/backend-common": "^0.9.
|
|
34
|
-
"@backstage/catalog-client": "^0.5.
|
|
35
|
-
"@backstage/catalog-model": "^0.9.
|
|
33
|
+
"@backstage/backend-common": "^0.9.12",
|
|
34
|
+
"@backstage/catalog-client": "^0.5.2",
|
|
35
|
+
"@backstage/catalog-model": "^0.9.7",
|
|
36
36
|
"@backstage/config": "^0.1.11",
|
|
37
|
-
"@backstage/errors": "^0.1.
|
|
38
|
-
"@backstage/test-utils": "^0.1.
|
|
37
|
+
"@backstage/errors": "^0.1.5",
|
|
38
|
+
"@backstage/test-utils": "^0.1.23",
|
|
39
39
|
"@google-cloud/firestore": "^4.15.1",
|
|
40
40
|
"@types/express": "^4.17.6",
|
|
41
41
|
"@types/passport": "^1.0.3",
|
|
42
42
|
"compression": "^1.7.4",
|
|
43
43
|
"cookie-parser": "^1.4.5",
|
|
44
44
|
"cors": "^2.8.5",
|
|
45
|
-
"cross-fetch": "^3.0.6",
|
|
46
45
|
"express": "^4.17.1",
|
|
47
46
|
"express-promise-router": "^4.1.0",
|
|
48
47
|
"express-session": "^1.17.1",
|
|
@@ -57,6 +56,7 @@
|
|
|
57
56
|
"minimatch": "^3.0.3",
|
|
58
57
|
"morgan": "^1.10.0",
|
|
59
58
|
"node-cache": "^5.1.2",
|
|
59
|
+
"node-fetch": "^2.6.1",
|
|
60
60
|
"openid-client": "^4.2.1",
|
|
61
61
|
"passport": "^0.4.1",
|
|
62
62
|
"passport-bitbucket-oauth2": "^0.1.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"yn": "^4.0.0"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.
|
|
76
|
+
"@backstage/cli": "^0.10.0",
|
|
77
77
|
"@types/body-parser": "^1.19.0",
|
|
78
78
|
"@types/cookie-parser": "^1.4.2",
|
|
79
79
|
"@types/express-session": "^1.17.2",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"config.d.ts"
|
|
93
93
|
],
|
|
94
94
|
"configSchema": "config.d.ts",
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "a05e7081b805006e3f0b2960a08a7753357f532f"
|
|
96
96
|
}
|