@backstage/plugin-auth-backend 0.18.2-next.0 → 0.18.2-next.2
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 +27 -0
- package/dist/index.d.ts +39 -39
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @backstage/plugin-auth-backend
|
|
2
2
|
|
|
3
|
+
## 0.18.2-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-common@0.18.4-next.2
|
|
9
|
+
- @backstage/catalog-client@1.4.1-next.0
|
|
10
|
+
- @backstage/catalog-model@1.2.1
|
|
11
|
+
- @backstage/config@1.0.7
|
|
12
|
+
- @backstage/errors@1.1.5
|
|
13
|
+
- @backstage/types@1.0.2
|
|
14
|
+
- @backstage/plugin-auth-node@0.2.13-next.2
|
|
15
|
+
|
|
16
|
+
## 0.18.2-next.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- e0c6e8b9c3c: Update peer dependencies
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/backend-common@0.18.4-next.1
|
|
23
|
+
- @backstage/catalog-client@1.4.0
|
|
24
|
+
- @backstage/catalog-model@1.2.1
|
|
25
|
+
- @backstage/config@1.0.7
|
|
26
|
+
- @backstage/errors@1.1.5
|
|
27
|
+
- @backstage/types@1.0.2
|
|
28
|
+
- @backstage/plugin-auth-node@0.2.13-next.1
|
|
29
|
+
|
|
3
30
|
## 0.18.2-next.0
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
|
17
17
|
*
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
type TokenParams = {
|
|
21
21
|
/**
|
|
22
22
|
* The claims that will be embedded within the token. At a minimum, this should include
|
|
23
23
|
* the subject claim, `sub`. It is common to also list entity ownership relations in the
|
|
@@ -39,7 +39,7 @@ declare type TokenParams = {
|
|
|
39
39
|
*
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
type OAuthProviderOptions = {
|
|
43
43
|
/**
|
|
44
44
|
* Client ID of the auth provider.
|
|
45
45
|
*/
|
|
@@ -54,7 +54,7 @@ declare type OAuthProviderOptions = {
|
|
|
54
54
|
callbackUrl: string;
|
|
55
55
|
};
|
|
56
56
|
/** @public */
|
|
57
|
-
|
|
57
|
+
type OAuthResult = {
|
|
58
58
|
fullProfile: Profile;
|
|
59
59
|
params: {
|
|
60
60
|
id_token?: string;
|
|
@@ -69,13 +69,13 @@ declare type OAuthResult = {
|
|
|
69
69
|
*
|
|
70
70
|
* @public
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
type OAuthResponse = {
|
|
73
73
|
profile: ProfileInfo;
|
|
74
74
|
providerInfo: OAuthProviderInfo;
|
|
75
75
|
backstageIdentity?: BackstageSignInResult;
|
|
76
76
|
};
|
|
77
77
|
/** @public */
|
|
78
|
-
|
|
78
|
+
type OAuthProviderInfo = {
|
|
79
79
|
/**
|
|
80
80
|
* An access token issued for the signed in user.
|
|
81
81
|
*/
|
|
@@ -94,7 +94,7 @@ declare type OAuthProviderInfo = {
|
|
|
94
94
|
scope: string;
|
|
95
95
|
};
|
|
96
96
|
/** @public */
|
|
97
|
-
|
|
97
|
+
type OAuthState = {
|
|
98
98
|
nonce: string;
|
|
99
99
|
env: string;
|
|
100
100
|
origin?: string;
|
|
@@ -103,17 +103,17 @@ declare type OAuthState = {
|
|
|
103
103
|
flow?: string;
|
|
104
104
|
};
|
|
105
105
|
/** @public */
|
|
106
|
-
|
|
106
|
+
type OAuthStartRequest = express.Request<{}> & {
|
|
107
107
|
scope: string;
|
|
108
108
|
state: OAuthState;
|
|
109
109
|
};
|
|
110
110
|
/** @public */
|
|
111
|
-
|
|
111
|
+
type OAuthRefreshRequest = express.Request<{}> & {
|
|
112
112
|
scope: string;
|
|
113
113
|
refreshToken: string;
|
|
114
114
|
};
|
|
115
115
|
/** @public */
|
|
116
|
-
|
|
116
|
+
type OAuthLogoutRequest = express.Request<{}> & {
|
|
117
117
|
refreshToken: string;
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
@@ -163,7 +163,7 @@ interface OAuthHandlers {
|
|
|
163
163
|
*
|
|
164
164
|
* @public
|
|
165
165
|
*/
|
|
166
|
-
|
|
166
|
+
type AuthResolverCatalogUserQuery = {
|
|
167
167
|
entityRef: string | {
|
|
168
168
|
kind?: string;
|
|
169
169
|
namespace?: string;
|
|
@@ -179,7 +179,7 @@ declare type AuthResolverCatalogUserQuery = {
|
|
|
179
179
|
*
|
|
180
180
|
* @public
|
|
181
181
|
*/
|
|
182
|
-
|
|
182
|
+
type AuthResolverContext = {
|
|
183
183
|
/**
|
|
184
184
|
* Issues a Backstage token using the provided parameters.
|
|
185
185
|
*/
|
|
@@ -206,7 +206,7 @@ declare type AuthResolverContext = {
|
|
|
206
206
|
* The callback used to resolve the cookie configuration for auth providers that use cookies.
|
|
207
207
|
* @public
|
|
208
208
|
*/
|
|
209
|
-
|
|
209
|
+
type CookieConfigurer = (ctx: {
|
|
210
210
|
/** ID of the auth provider that this configuration applies to */
|
|
211
211
|
providerId: string;
|
|
212
212
|
/** The externally reachable base URL of the auth-backend plugin */
|
|
@@ -222,7 +222,7 @@ declare type CookieConfigurer = (ctx: {
|
|
|
222
222
|
sameSite?: 'none' | 'lax' | 'strict';
|
|
223
223
|
};
|
|
224
224
|
/** @public */
|
|
225
|
-
|
|
225
|
+
type AuthProviderConfig = {
|
|
226
226
|
/**
|
|
227
227
|
* The protocol://domain[:port] where the app is hosted. This is used to construct the
|
|
228
228
|
* callbackURL to redirect to once the user signs in to the auth provider.
|
|
@@ -242,7 +242,7 @@ declare type AuthProviderConfig = {
|
|
|
242
242
|
cookieConfigurer?: CookieConfigurer;
|
|
243
243
|
};
|
|
244
244
|
/** @public */
|
|
245
|
-
|
|
245
|
+
type OAuthStartResponse = {
|
|
246
246
|
/**
|
|
247
247
|
* URL to redirect to
|
|
248
248
|
*/
|
|
@@ -306,7 +306,7 @@ interface AuthProviderRouteHandlers {
|
|
|
306
306
|
logout?(req: express.Request, res: express.Response): Promise<void>;
|
|
307
307
|
}
|
|
308
308
|
/** @public */
|
|
309
|
-
|
|
309
|
+
type AuthProviderFactory = (options: {
|
|
310
310
|
providerId: string;
|
|
311
311
|
globalConfig: AuthProviderConfig;
|
|
312
312
|
config: Config;
|
|
@@ -314,7 +314,7 @@ declare type AuthProviderFactory = (options: {
|
|
|
314
314
|
resolverContext: AuthResolverContext;
|
|
315
315
|
}) => AuthProviderRouteHandlers;
|
|
316
316
|
/** @public */
|
|
317
|
-
|
|
317
|
+
type AuthResponse<ProviderInfo> = {
|
|
318
318
|
providerInfo: ProviderInfo;
|
|
319
319
|
profile: ProfileInfo;
|
|
320
320
|
backstageIdentity?: BackstageIdentityResponse;
|
|
@@ -328,7 +328,7 @@ declare type AuthResponse<ProviderInfo> = {
|
|
|
328
328
|
*
|
|
329
329
|
* @public
|
|
330
330
|
*/
|
|
331
|
-
|
|
331
|
+
type ProfileInfo = {
|
|
332
332
|
/**
|
|
333
333
|
* Email ID of the signed in user.
|
|
334
334
|
*/
|
|
@@ -349,7 +349,7 @@ declare type ProfileInfo = {
|
|
|
349
349
|
*
|
|
350
350
|
* @public
|
|
351
351
|
*/
|
|
352
|
-
|
|
352
|
+
type SignInInfo<TAuthResult> = {
|
|
353
353
|
/**
|
|
354
354
|
* The simple profile passed down for use in the frontend.
|
|
355
355
|
*/
|
|
@@ -366,14 +366,14 @@ declare type SignInInfo<TAuthResult> = {
|
|
|
366
366
|
*
|
|
367
367
|
* @public
|
|
368
368
|
*/
|
|
369
|
-
|
|
369
|
+
type SignInResolver<TAuthResult> = (info: SignInInfo<TAuthResult>, context: AuthResolverContext) => Promise<BackstageSignInResult>;
|
|
370
370
|
/**
|
|
371
371
|
* The return type of an authentication handler. Must contain valid profile
|
|
372
372
|
* information.
|
|
373
373
|
*
|
|
374
374
|
* @public
|
|
375
375
|
*/
|
|
376
|
-
|
|
376
|
+
type AuthHandlerResult = {
|
|
377
377
|
profile: ProfileInfo;
|
|
378
378
|
};
|
|
379
379
|
/**
|
|
@@ -389,14 +389,14 @@ declare type AuthHandlerResult = {
|
|
|
389
389
|
*
|
|
390
390
|
* @public
|
|
391
391
|
*/
|
|
392
|
-
|
|
392
|
+
type AuthHandler<TAuthResult> = (input: TAuthResult, context: AuthResolverContext) => Promise<AuthHandlerResult>;
|
|
393
393
|
/** @public */
|
|
394
|
-
|
|
394
|
+
type StateEncoder = (req: OAuthStartRequest) => Promise<{
|
|
395
395
|
encodedState: string;
|
|
396
396
|
}>;
|
|
397
397
|
|
|
398
398
|
/** @public */
|
|
399
|
-
|
|
399
|
+
type AwsAlbResult = {
|
|
400
400
|
fullProfile: Profile;
|
|
401
401
|
expiresInSeconds?: number;
|
|
402
402
|
accessToken: string;
|
|
@@ -416,7 +416,7 @@ declare class OAuthEnvironmentHandler implements AuthProviderRouteHandlers {
|
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
/** @public */
|
|
419
|
-
|
|
419
|
+
type OAuthAdapterOptions = {
|
|
420
420
|
providerId: string;
|
|
421
421
|
persistScopes?: boolean;
|
|
422
422
|
appOrigin: string;
|
|
@@ -458,7 +458,7 @@ declare const encodeState: (state: OAuthState) => string;
|
|
|
458
458
|
declare const verifyNonce: (req: express.Request, providerId: string) => void;
|
|
459
459
|
|
|
460
460
|
/** @public */
|
|
461
|
-
|
|
461
|
+
type BitbucketOAuthResult = {
|
|
462
462
|
fullProfile: BitbucketPassportProfile;
|
|
463
463
|
params: {
|
|
464
464
|
id_token?: string;
|
|
@@ -469,7 +469,7 @@ declare type BitbucketOAuthResult = {
|
|
|
469
469
|
refreshToken?: string;
|
|
470
470
|
};
|
|
471
471
|
/** @public */
|
|
472
|
-
|
|
472
|
+
type BitbucketPassportProfile = Profile & {
|
|
473
473
|
id?: string;
|
|
474
474
|
displayName?: string;
|
|
475
475
|
username?: string;
|
|
@@ -484,7 +484,7 @@ declare type BitbucketPassportProfile = Profile & {
|
|
|
484
484
|
};
|
|
485
485
|
|
|
486
486
|
/** @public */
|
|
487
|
-
|
|
487
|
+
type BitbucketServerOAuthResult = {
|
|
488
488
|
fullProfile: Profile;
|
|
489
489
|
params: {
|
|
490
490
|
scope: string;
|
|
@@ -504,7 +504,7 @@ declare type BitbucketServerOAuthResult = {
|
|
|
504
504
|
*
|
|
505
505
|
* @public
|
|
506
506
|
*/
|
|
507
|
-
|
|
507
|
+
type CloudflareAccessClaims = {
|
|
508
508
|
/**
|
|
509
509
|
* `aud` identifies the application to which the JWT is issued.
|
|
510
510
|
*/
|
|
@@ -546,7 +546,7 @@ declare type CloudflareAccessClaims = {
|
|
|
546
546
|
*
|
|
547
547
|
* @public
|
|
548
548
|
*/
|
|
549
|
-
|
|
549
|
+
type CloudflareAccessGroup = {
|
|
550
550
|
/**
|
|
551
551
|
* Group id
|
|
552
552
|
*/
|
|
@@ -568,7 +568,7 @@ declare type CloudflareAccessGroup = {
|
|
|
568
568
|
*
|
|
569
569
|
* @public
|
|
570
570
|
*/
|
|
571
|
-
|
|
571
|
+
type CloudflareAccessIdentityProfile = {
|
|
572
572
|
id: string;
|
|
573
573
|
name: string;
|
|
574
574
|
email: string;
|
|
@@ -577,7 +577,7 @@ declare type CloudflareAccessIdentityProfile = {
|
|
|
577
577
|
/**
|
|
578
578
|
* @public
|
|
579
579
|
*/
|
|
580
|
-
|
|
580
|
+
type CloudflareAccessResult = {
|
|
581
581
|
claims: CloudflareAccessClaims;
|
|
582
582
|
cfIdentity: CloudflareAccessIdentityProfile;
|
|
583
583
|
expiresInSeconds?: number;
|
|
@@ -585,7 +585,7 @@ declare type CloudflareAccessResult = {
|
|
|
585
585
|
};
|
|
586
586
|
|
|
587
587
|
/** @public */
|
|
588
|
-
|
|
588
|
+
type GithubOAuthResult = {
|
|
589
589
|
fullProfile: Profile;
|
|
590
590
|
params: {
|
|
591
591
|
scope: string;
|
|
@@ -602,7 +602,7 @@ declare type GithubOAuthResult = {
|
|
|
602
602
|
*
|
|
603
603
|
* @public
|
|
604
604
|
*/
|
|
605
|
-
|
|
605
|
+
type OAuth2ProxyResult<JWTPayload = {}> = {
|
|
606
606
|
/**
|
|
607
607
|
* The parsed payload of the `accessToken`. The token is only parsed, not verified.
|
|
608
608
|
*
|
|
@@ -640,13 +640,13 @@ declare type OAuth2ProxyResult<JWTPayload = {}> = {
|
|
|
640
640
|
* authentication result for the OIDC which includes the token set and user information (a profile response sent by OIDC server)
|
|
641
641
|
* @public
|
|
642
642
|
*/
|
|
643
|
-
|
|
643
|
+
type OidcAuthResult = {
|
|
644
644
|
tokenset: TokenSet;
|
|
645
645
|
userinfo: UserinfoResponse;
|
|
646
646
|
};
|
|
647
647
|
|
|
648
648
|
/** @public */
|
|
649
|
-
|
|
649
|
+
type SamlAuthResult = {
|
|
650
650
|
fullProfile: any;
|
|
651
651
|
};
|
|
652
652
|
|
|
@@ -655,7 +655,7 @@ declare type SamlAuthResult = {
|
|
|
655
655
|
*
|
|
656
656
|
* @public
|
|
657
657
|
*/
|
|
658
|
-
|
|
658
|
+
type GcpIapTokenInfo = {
|
|
659
659
|
/**
|
|
660
660
|
* The unique, stable identifier for the user.
|
|
661
661
|
*/
|
|
@@ -675,7 +675,7 @@ declare type GcpIapTokenInfo = {
|
|
|
675
675
|
*
|
|
676
676
|
* @public
|
|
677
677
|
*/
|
|
678
|
-
|
|
678
|
+
type GcpIapResult = {
|
|
679
679
|
/**
|
|
680
680
|
* The data extracted from the IAP token header.
|
|
681
681
|
*/
|
|
@@ -905,7 +905,7 @@ declare function createAuthProviderIntegration<TCreateOptions extends unknown[],
|
|
|
905
905
|
declare function prepareBackstageIdentityResponse(result: BackstageSignInResult): BackstageIdentityResponse;
|
|
906
906
|
|
|
907
907
|
/** @public */
|
|
908
|
-
|
|
908
|
+
type ProviderFactories = {
|
|
909
909
|
[s: string]: AuthProviderFactory;
|
|
910
910
|
};
|
|
911
911
|
/** @public */
|
|
@@ -930,7 +930,7 @@ declare function createOriginFilter(config: Config): (origin: string) => boolean
|
|
|
930
930
|
*
|
|
931
931
|
* @public
|
|
932
932
|
*/
|
|
933
|
-
|
|
933
|
+
type WebMessageResponse = {
|
|
934
934
|
type: 'authorization_response';
|
|
935
935
|
response: AuthResponse<unknown>;
|
|
936
936
|
} | {
|
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.18.2-next.
|
|
4
|
+
"version": "0.18.2-next.2",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"clean": "backstage-cli package clean"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@backstage/backend-common": "^0.18.4-next.
|
|
36
|
-
"@backstage/catalog-client": "^1.4.0",
|
|
35
|
+
"@backstage/backend-common": "^0.18.4-next.2",
|
|
36
|
+
"@backstage/catalog-client": "^1.4.1-next.0",
|
|
37
37
|
"@backstage/catalog-model": "^1.2.1",
|
|
38
38
|
"@backstage/config": "^1.0.7",
|
|
39
39
|
"@backstage/errors": "^1.1.5",
|
|
40
|
-
"@backstage/plugin-auth-node": "^0.2.13-next.
|
|
40
|
+
"@backstage/plugin-auth-node": "^0.2.13-next.2",
|
|
41
41
|
"@backstage/types": "^1.0.2",
|
|
42
42
|
"@davidzemon/passport-okta-oauth": "^0.0.5",
|
|
43
43
|
"@google-cloud/firestore": "^6.0.0",
|
|
@@ -76,9 +76,8 @@
|
|
|
76
76
|
"yn": "^4.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@backstage/backend-test-utils": "^0.1.36-next.
|
|
80
|
-
"@backstage/cli": "^0.22.6-next.
|
|
81
|
-
"@backstage/test-utils": "^1.3.0-next.0",
|
|
79
|
+
"@backstage/backend-test-utils": "^0.1.36-next.2",
|
|
80
|
+
"@backstage/cli": "^0.22.6-next.2",
|
|
82
81
|
"@types/body-parser": "^1.19.0",
|
|
83
82
|
"@types/cookie-parser": "^1.4.2",
|
|
84
83
|
"@types/express-session": "^1.17.2",
|