@backstage/plugin-auth-backend 0.15.0-next.1 → 0.15.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 +59 -0
- package/config.d.ts +3 -0
- package/dist/index.cjs.js +147 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +119 -1
- package/package.json +13 -13
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Entity, UserEntity } from '@backstage/catalog-model';
|
|
|
6
6
|
import { Config } from '@backstage/config';
|
|
7
7
|
import { BackstageSignInResult, BackstageIdentityResponse } from '@backstage/plugin-auth-node';
|
|
8
8
|
import { Profile } from 'passport';
|
|
9
|
+
import * as _backstage_backend_common from '@backstage/backend-common';
|
|
9
10
|
import { PluginDatabaseManager, PluginEndpointDiscovery, TokenManager } from '@backstage/backend-common';
|
|
10
11
|
import { IncomingHttpHeaders } from 'http';
|
|
11
12
|
import { TokenSet, UserinfoResponse } from 'openid-client';
|
|
@@ -474,6 +475,94 @@ declare type BitbucketPassportProfile = Profile & {
|
|
|
474
475
|
};
|
|
475
476
|
};
|
|
476
477
|
|
|
478
|
+
/**
|
|
479
|
+
* CloudflareAccessClaims
|
|
480
|
+
*
|
|
481
|
+
* Can be used in externally provided auth handler or sign in resolver to
|
|
482
|
+
* enrich user profile for sign-in user entity
|
|
483
|
+
*
|
|
484
|
+
* @public
|
|
485
|
+
*/
|
|
486
|
+
declare type CloudflareAccessClaims = {
|
|
487
|
+
/**
|
|
488
|
+
* `aud` identifies the application to which the JWT is issued.
|
|
489
|
+
*/
|
|
490
|
+
aud: string[];
|
|
491
|
+
/**
|
|
492
|
+
* `email` contains the email address of the authenticated user.
|
|
493
|
+
*/
|
|
494
|
+
email: string;
|
|
495
|
+
/**
|
|
496
|
+
* iat and exp are the issuance and expiration timestamps.
|
|
497
|
+
*/
|
|
498
|
+
exp: number;
|
|
499
|
+
iat: number;
|
|
500
|
+
/**
|
|
501
|
+
* `nonce` is the session identifier.
|
|
502
|
+
*/
|
|
503
|
+
nonce: string;
|
|
504
|
+
/**
|
|
505
|
+
* `identity_nonce` is available in the Application Token and can be used to
|
|
506
|
+
* query all group membership for a given user.
|
|
507
|
+
*/
|
|
508
|
+
identity_nonce: string;
|
|
509
|
+
/**
|
|
510
|
+
* `sub` contains the identifier of the authenticated user.
|
|
511
|
+
*/
|
|
512
|
+
sub: string;
|
|
513
|
+
/**
|
|
514
|
+
* `iss` the issuer is the application’s Cloudflare Access Domain URL.
|
|
515
|
+
*/
|
|
516
|
+
iss: string;
|
|
517
|
+
/**
|
|
518
|
+
* `custom` contains SAML attributes in the Application Token specified by an
|
|
519
|
+
* administrator in the identity provider configuration.
|
|
520
|
+
*/
|
|
521
|
+
custom: string;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* CloudflareAccessGroup
|
|
525
|
+
*
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
528
|
+
declare type CloudflareAccessGroup = {
|
|
529
|
+
/**
|
|
530
|
+
* Group id
|
|
531
|
+
*/
|
|
532
|
+
id: string;
|
|
533
|
+
/**
|
|
534
|
+
* Name of group as defined in Cloudflare zero trust dashboard
|
|
535
|
+
*/
|
|
536
|
+
name: string;
|
|
537
|
+
/**
|
|
538
|
+
* Access group email address
|
|
539
|
+
*/
|
|
540
|
+
email: string;
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* CloudflareAccessIdentityProfile
|
|
544
|
+
*
|
|
545
|
+
* Can be used in externally provided auth handler or sign in resolver to
|
|
546
|
+
* enrich user profile for sign-in user entity
|
|
547
|
+
*
|
|
548
|
+
* @public
|
|
549
|
+
*/
|
|
550
|
+
declare type CloudflareAccessIdentityProfile = {
|
|
551
|
+
id: string;
|
|
552
|
+
name: string;
|
|
553
|
+
email: string;
|
|
554
|
+
groups: CloudflareAccessGroup[];
|
|
555
|
+
};
|
|
556
|
+
/**
|
|
557
|
+
*
|
|
558
|
+
* @public
|
|
559
|
+
*/
|
|
560
|
+
declare type CloudflareAccessResult = {
|
|
561
|
+
claims: CloudflareAccessClaims;
|
|
562
|
+
cfIdentity: CloudflareAccessIdentityProfile;
|
|
563
|
+
expiresInSeconds?: number;
|
|
564
|
+
};
|
|
565
|
+
|
|
477
566
|
declare type GithubOAuthResult = {
|
|
478
567
|
fullProfile: Profile;
|
|
479
568
|
params: {
|
|
@@ -616,6 +705,18 @@ declare const providers: Readonly<{
|
|
|
616
705
|
userIdMatchingUserEntityAnnotation(): SignInResolver<OAuthResult>;
|
|
617
706
|
}>;
|
|
618
707
|
}>;
|
|
708
|
+
cfAccess: Readonly<{
|
|
709
|
+
create: (options: {
|
|
710
|
+
authHandler?: AuthHandler<CloudflareAccessResult> | undefined;
|
|
711
|
+
signIn: {
|
|
712
|
+
resolver: SignInResolver<CloudflareAccessResult>;
|
|
713
|
+
};
|
|
714
|
+
cache?: _backstage_backend_common.CacheClient | undefined;
|
|
715
|
+
}) => AuthProviderFactory;
|
|
716
|
+
resolvers: Readonly<{
|
|
717
|
+
emailMatchingUserEntityProfileEmail: () => SignInResolver<unknown>;
|
|
718
|
+
}>;
|
|
719
|
+
}>;
|
|
619
720
|
gcpIap: Readonly<{
|
|
620
721
|
create: (options: {
|
|
621
722
|
authHandler?: AuthHandler<GcpIapResult> | undefined;
|
|
@@ -742,6 +843,23 @@ declare const defaultAuthProviderFactories: {
|
|
|
742
843
|
[providerId: string]: AuthProviderFactory;
|
|
743
844
|
};
|
|
744
845
|
|
|
846
|
+
/**
|
|
847
|
+
* Creates a standardized representation of an integration with a third-party
|
|
848
|
+
* auth provider.
|
|
849
|
+
*
|
|
850
|
+
* The returned object facilitates the creation of provider instances, and
|
|
851
|
+
* supplies built-in sign-in resolvers for the specific provider.
|
|
852
|
+
*/
|
|
853
|
+
declare function createAuthProviderIntegration<TCreateOptions extends unknown[], TResolvers extends {
|
|
854
|
+
[name in string]: (...args: any[]) => SignInResolver<any>;
|
|
855
|
+
}>(config: {
|
|
856
|
+
create: (...args: TCreateOptions) => AuthProviderFactory;
|
|
857
|
+
resolvers?: TResolvers;
|
|
858
|
+
}): Readonly<{
|
|
859
|
+
create: (...args: TCreateOptions) => AuthProviderFactory;
|
|
860
|
+
resolvers: Readonly<string extends keyof TResolvers ? never : TResolvers>;
|
|
861
|
+
}>;
|
|
862
|
+
|
|
745
863
|
/**
|
|
746
864
|
* Parses a Backstage-issued token and decorates the
|
|
747
865
|
* {@link @backstage/plugin-auth-node#BackstageIdentityResponse} with identity information sourced from the
|
|
@@ -824,4 +942,4 @@ declare class CatalogIdentityClient {
|
|
|
824
942
|
*/
|
|
825
943
|
declare function getDefaultOwnershipEntityRefs(entity: Entity): string[];
|
|
826
944
|
|
|
827
|
-
export { AtlassianAuthProvider, AuthHandler, AuthHandlerResult, AuthProviderConfig, AuthProviderFactory, AuthProviderRouteHandlers, AuthResolverCatalogUserQuery, AuthResolverContext, AuthResponse, AwsAlbResult, BitbucketOAuthResult, BitbucketPassportProfile, CatalogIdentityClient, CookieConfigurer, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, OidcAuthResult, ProfileInfo, RouterOptions, SamlAuthResult, SignInInfo, SignInResolver, StateEncoder, TokenParams, WebMessageResponse, createOriginFilter, createRouter, defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, getDefaultOwnershipEntityRefs, postMessageResponse, prepareBackstageIdentityResponse, providers, readState, verifyNonce };
|
|
945
|
+
export { AtlassianAuthProvider, AuthHandler, AuthHandlerResult, AuthProviderConfig, AuthProviderFactory, AuthProviderRouteHandlers, AuthResolverCatalogUserQuery, AuthResolverContext, AuthResponse, AwsAlbResult, BitbucketOAuthResult, BitbucketPassportProfile, CatalogIdentityClient, CloudflareAccessClaims, CloudflareAccessGroup, CloudflareAccessIdentityProfile, CloudflareAccessResult, CookieConfigurer, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, OidcAuthResult, ProfileInfo, RouterOptions, SamlAuthResult, SignInInfo, SignInResolver, StateEncoder, TokenParams, WebMessageResponse, createAuthProviderIntegration, createOriginFilter, createRouter, defaultAuthProviderFactories, encodeState, ensuresXRequestedWith, getDefaultOwnershipEntityRefs, postMessageResponse, prepareBackstageIdentityResponse, providers, 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.15.0
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -33,13 +33,14 @@
|
|
|
33
33
|
"clean": "backstage-cli package clean"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@backstage/backend-common": "^0.14.1
|
|
37
|
-
"@backstage/catalog-client": "^1.0.4
|
|
38
|
-
"@backstage/catalog-model": "^1.1.0
|
|
36
|
+
"@backstage/backend-common": "^0.14.1",
|
|
37
|
+
"@backstage/catalog-client": "^1.0.4",
|
|
38
|
+
"@backstage/catalog-model": "^1.1.0",
|
|
39
39
|
"@backstage/config": "^1.0.1",
|
|
40
|
-
"@backstage/errors": "^1.1.0
|
|
41
|
-
"@backstage/plugin-auth-node": "^0.2.3
|
|
40
|
+
"@backstage/errors": "^1.1.0",
|
|
41
|
+
"@backstage/plugin-auth-node": "^0.2.3",
|
|
42
42
|
"@backstage/types": "^1.0.0",
|
|
43
|
+
"@davidzemon/passport-okta-oauth": "^0.0.5",
|
|
43
44
|
"@google-cloud/firestore": "^5.0.2",
|
|
44
45
|
"@types/express": "^4.17.6",
|
|
45
46
|
"@types/passport": "^1.0.3",
|
|
@@ -53,9 +54,9 @@
|
|
|
53
54
|
"google-auth-library": "^8.0.0",
|
|
54
55
|
"jose": "^4.6.0",
|
|
55
56
|
"jwt-decode": "^3.1.0",
|
|
56
|
-
"knex": "^
|
|
57
|
+
"knex": "^2.0.0",
|
|
57
58
|
"lodash": "^4.17.21",
|
|
58
|
-
"luxon": "^
|
|
59
|
+
"luxon": "^3.0.0",
|
|
59
60
|
"minimatch": "^5.0.0",
|
|
60
61
|
"morgan": "^1.10.0",
|
|
61
62
|
"node-cache": "^5.1.2",
|
|
@@ -68,7 +69,6 @@
|
|
|
68
69
|
"passport-google-oauth20": "^2.0.0",
|
|
69
70
|
"passport-microsoft": "^1.0.0",
|
|
70
71
|
"passport-oauth2": "^1.6.1",
|
|
71
|
-
"passport-okta-oauth": "^0.0.1",
|
|
72
72
|
"passport-onelogin-oauth": "^0.0.1",
|
|
73
73
|
"passport-saml": "^3.1.2",
|
|
74
74
|
"uuid": "^8.0.0",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"yn": "^4.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@backstage/backend-test-utils": "^0.1.26
|
|
80
|
-
"@backstage/cli": "^0.18.0
|
|
79
|
+
"@backstage/backend-test-utils": "^0.1.26",
|
|
80
|
+
"@backstage/cli": "^0.18.0",
|
|
81
81
|
"@types/body-parser": "^1.19.0",
|
|
82
82
|
"@types/cookie-parser": "^1.4.2",
|
|
83
83
|
"@types/express-session": "^1.17.2",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@types/passport-saml": "^1.1.3",
|
|
89
89
|
"@types/passport-strategy": "^0.2.35",
|
|
90
90
|
"@types/xml2js": "^0.4.7",
|
|
91
|
-
"msw": "^0.
|
|
91
|
+
"msw": "^0.44.0",
|
|
92
92
|
"supertest": "^6.1.3"
|
|
93
93
|
},
|
|
94
94
|
"files": [
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"config.d.ts"
|
|
98
98
|
],
|
|
99
99
|
"configSchema": "config.d.ts",
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "999878d8f1ae30f6a15925816af2016cb9d717a1"
|
|
101
101
|
}
|