@backstage/plugin-auth-backend 0.5.0 → 0.6.1
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 +67 -0
- package/dist/index.cjs.js +1218 -1050
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +259 -108
- package/package.json +11 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import { Logger } from 'winston';
|
|
4
|
+
import { Config } from '@backstage/config';
|
|
4
5
|
import { PluginEndpointDiscovery, PluginDatabaseManager } from '@backstage/backend-common';
|
|
5
6
|
import { CatalogApi } from '@backstage/catalog-client';
|
|
6
7
|
import { UserEntity, Entity } from '@backstage/catalog-model';
|
|
7
|
-
import { Config } from '@backstage/config';
|
|
8
8
|
import { Profile } from 'passport';
|
|
9
9
|
import { JSONWebKey } from 'jose';
|
|
10
10
|
import { TokenSet, UserinfoResponse } from 'openid-client';
|
|
11
|
+
import { JsonValue } from '@backstage/types';
|
|
11
12
|
|
|
12
13
|
/** Represents any form of serializable JWK */
|
|
13
14
|
interface AnyJWK extends Record<string, string> {
|
|
@@ -97,10 +98,6 @@ declare type OAuthProviderInfo = {
|
|
|
97
98
|
* Scopes granted for the access token.
|
|
98
99
|
*/
|
|
99
100
|
scope: string;
|
|
100
|
-
/**
|
|
101
|
-
* A refresh token issued for the signed in user
|
|
102
|
-
*/
|
|
103
|
-
refreshToken?: string;
|
|
104
101
|
};
|
|
105
102
|
declare type OAuthState = {
|
|
106
103
|
nonce: string;
|
|
@@ -140,7 +137,10 @@ interface OAuthHandlers {
|
|
|
140
137
|
* @param {string} refreshToken
|
|
141
138
|
* @param {string} scope
|
|
142
139
|
*/
|
|
143
|
-
refresh?(req: OAuthRefreshRequest): Promise<
|
|
140
|
+
refresh?(req: OAuthRefreshRequest): Promise<{
|
|
141
|
+
response: OAuthResponse;
|
|
142
|
+
refreshToken?: string;
|
|
143
|
+
}>;
|
|
144
144
|
/**
|
|
145
145
|
* (Optional) Sign out of the auth provider.
|
|
146
146
|
*/
|
|
@@ -382,12 +382,15 @@ interface BackstageSignInResult {
|
|
|
382
382
|
}
|
|
383
383
|
/**
|
|
384
384
|
* The old exported symbol for {@link BackstageSignInResult}.
|
|
385
|
+
*
|
|
385
386
|
* @public
|
|
386
|
-
* @deprecated Use the
|
|
387
|
+
* @deprecated Use the {@link BackstageSignInResult} instead.
|
|
387
388
|
*/
|
|
388
389
|
declare type BackstageIdentity = BackstageSignInResult;
|
|
389
390
|
/**
|
|
390
|
-
* Response object containing the {@link BackstageUserIdentity} and the token
|
|
391
|
+
* Response object containing the {@link BackstageUserIdentity} and the token
|
|
392
|
+
* from the authentication provider.
|
|
393
|
+
*
|
|
391
394
|
* @public
|
|
392
395
|
*/
|
|
393
396
|
interface BackstageIdentityResponse extends BackstageSignInResult {
|
|
@@ -400,7 +403,8 @@ interface BackstageIdentityResponse extends BackstageSignInResult {
|
|
|
400
403
|
* Used to display login information to user, i.e. sidebar popup.
|
|
401
404
|
*
|
|
402
405
|
* It is also temporarily used as the profile of the signed-in user's Backstage
|
|
403
|
-
* identity, but we want to replace that with data from identity and/org catalog
|
|
406
|
+
* identity, but we want to replace that with data from identity and/org catalog
|
|
407
|
+
* service
|
|
404
408
|
*
|
|
405
409
|
* @public
|
|
406
410
|
*/
|
|
@@ -419,33 +423,57 @@ declare type ProfileInfo = {
|
|
|
419
423
|
*/
|
|
420
424
|
picture?: string;
|
|
421
425
|
};
|
|
422
|
-
|
|
426
|
+
/**
|
|
427
|
+
* Type of sign in information context. Includes the profile information and
|
|
428
|
+
* authentication result which contains auth related information.
|
|
429
|
+
*
|
|
430
|
+
* @public
|
|
431
|
+
*/
|
|
432
|
+
declare type SignInInfo<TAuthResult> = {
|
|
423
433
|
/**
|
|
424
434
|
* The simple profile passed down for use in the frontend.
|
|
425
435
|
*/
|
|
426
436
|
profile: ProfileInfo;
|
|
427
437
|
/**
|
|
428
|
-
* The authentication result that was received from the authentication
|
|
438
|
+
* The authentication result that was received from the authentication
|
|
439
|
+
* provider.
|
|
429
440
|
*/
|
|
430
|
-
result:
|
|
441
|
+
result: TAuthResult;
|
|
431
442
|
};
|
|
432
|
-
|
|
443
|
+
/**
|
|
444
|
+
* Describes the function which handles the result of a successful
|
|
445
|
+
* authentication. Must return a valid {@link BackstageSignInResult}.
|
|
446
|
+
*
|
|
447
|
+
* @public
|
|
448
|
+
*/
|
|
449
|
+
declare type SignInResolver<TAuthResult> = (info: SignInInfo<TAuthResult>, context: {
|
|
433
450
|
tokenIssuer: TokenIssuer;
|
|
434
451
|
catalogIdentityClient: CatalogIdentityClient;
|
|
435
452
|
logger: Logger;
|
|
436
453
|
}) => Promise<BackstageSignInResult>;
|
|
454
|
+
/**
|
|
455
|
+
* The return type of an authentication handler. Must contain valid profile
|
|
456
|
+
* information.
|
|
457
|
+
*
|
|
458
|
+
* @public
|
|
459
|
+
*/
|
|
437
460
|
declare type AuthHandlerResult = {
|
|
438
461
|
profile: ProfileInfo;
|
|
439
462
|
};
|
|
440
463
|
/**
|
|
441
|
-
* The AuthHandler function is called every time the user authenticates using
|
|
464
|
+
* The AuthHandler function is called every time the user authenticates using
|
|
465
|
+
* the provider.
|
|
466
|
+
*
|
|
467
|
+
* The handler should return a profile that represents the session for the user
|
|
468
|
+
* in the frontend.
|
|
442
469
|
*
|
|
443
|
-
*
|
|
470
|
+
* Throwing an error in the function will cause the authentication to fail,
|
|
471
|
+
* making it possible to use this function as a way to limit access to a certain
|
|
472
|
+
* group of users.
|
|
444
473
|
*
|
|
445
|
-
*
|
|
446
|
-
* possible to use this function as a way to limit access to a certain group of users.
|
|
474
|
+
* @public
|
|
447
475
|
*/
|
|
448
|
-
declare type AuthHandler<
|
|
476
|
+
declare type AuthHandler<TAuthResult> = (input: TAuthResult) => Promise<AuthHandlerResult>;
|
|
449
477
|
declare type StateEncoder = (req: OAuthStartRequest) => Promise<{
|
|
450
478
|
encodedState: string;
|
|
451
479
|
}>;
|
|
@@ -498,6 +526,134 @@ declare const readState: (stateString: string) => OAuthState;
|
|
|
498
526
|
declare const encodeState: (state: OAuthState) => string;
|
|
499
527
|
declare const verifyNonce: (req: express.Request, providerId: string) => void;
|
|
500
528
|
|
|
529
|
+
declare type AtlassianAuthProviderOptions = OAuthProviderOptions & {
|
|
530
|
+
scopes: string;
|
|
531
|
+
signInResolver?: SignInResolver<OAuthResult>;
|
|
532
|
+
authHandler: AuthHandler<OAuthResult>;
|
|
533
|
+
tokenIssuer: TokenIssuer;
|
|
534
|
+
catalogIdentityClient: CatalogIdentityClient;
|
|
535
|
+
logger: Logger;
|
|
536
|
+
};
|
|
537
|
+
declare class AtlassianAuthProvider implements OAuthHandlers {
|
|
538
|
+
private readonly _strategy;
|
|
539
|
+
private readonly signInResolver?;
|
|
540
|
+
private readonly authHandler;
|
|
541
|
+
private readonly tokenIssuer;
|
|
542
|
+
private readonly catalogIdentityClient;
|
|
543
|
+
private readonly logger;
|
|
544
|
+
constructor(options: AtlassianAuthProviderOptions);
|
|
545
|
+
start(req: OAuthStartRequest): Promise<RedirectInfo>;
|
|
546
|
+
handler(req: express.Request): Promise<{
|
|
547
|
+
response: OAuthResponse;
|
|
548
|
+
refreshToken: string | undefined;
|
|
549
|
+
}>;
|
|
550
|
+
private handleResult;
|
|
551
|
+
refresh(req: OAuthRefreshRequest): Promise<{
|
|
552
|
+
response: OAuthResponse;
|
|
553
|
+
refreshToken: string | undefined;
|
|
554
|
+
}>;
|
|
555
|
+
}
|
|
556
|
+
declare type AtlassianProviderOptions = {
|
|
557
|
+
/**
|
|
558
|
+
* The profile transformation function used to verify and convert the auth response
|
|
559
|
+
* into the profile that will be presented to the user.
|
|
560
|
+
*/
|
|
561
|
+
authHandler?: AuthHandler<OAuthResult>;
|
|
562
|
+
/**
|
|
563
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
564
|
+
*/
|
|
565
|
+
signIn?: {
|
|
566
|
+
resolver: SignInResolver<OAuthResult>;
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
declare const createAtlassianProvider: (options?: AtlassianProviderOptions | undefined) => AuthProviderFactory;
|
|
570
|
+
|
|
571
|
+
/** @public */
|
|
572
|
+
declare type Auth0ProviderOptions = {
|
|
573
|
+
/**
|
|
574
|
+
* The profile transformation function used to verify and convert the auth response
|
|
575
|
+
* into the profile that will be presented to the user.
|
|
576
|
+
*/
|
|
577
|
+
authHandler?: AuthHandler<OAuthResult>;
|
|
578
|
+
/**
|
|
579
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
580
|
+
*/
|
|
581
|
+
signIn?: {
|
|
582
|
+
/**
|
|
583
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
584
|
+
*/
|
|
585
|
+
resolver: SignInResolver<OAuthResult>;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
/** @public */
|
|
589
|
+
declare const createAuth0Provider: (options?: Auth0ProviderOptions | undefined) => AuthProviderFactory;
|
|
590
|
+
|
|
591
|
+
declare type AwsAlbResult = {
|
|
592
|
+
fullProfile: Profile;
|
|
593
|
+
expiresInSeconds?: number;
|
|
594
|
+
accessToken: string;
|
|
595
|
+
};
|
|
596
|
+
declare type AwsAlbProviderOptions = {
|
|
597
|
+
/**
|
|
598
|
+
* The profile transformation function used to verify and convert the auth response
|
|
599
|
+
* into the profile that will be presented to the user.
|
|
600
|
+
*/
|
|
601
|
+
authHandler?: AuthHandler<AwsAlbResult>;
|
|
602
|
+
/**
|
|
603
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
604
|
+
*/
|
|
605
|
+
signIn: {
|
|
606
|
+
/**
|
|
607
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
608
|
+
*/
|
|
609
|
+
resolver: SignInResolver<AwsAlbResult>;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
declare const createAwsAlbProvider: (options?: AwsAlbProviderOptions | undefined) => AuthProviderFactory;
|
|
613
|
+
|
|
614
|
+
declare type BitbucketOAuthResult = {
|
|
615
|
+
fullProfile: BitbucketPassportProfile;
|
|
616
|
+
params: {
|
|
617
|
+
id_token?: string;
|
|
618
|
+
scope: string;
|
|
619
|
+
expires_in: number;
|
|
620
|
+
};
|
|
621
|
+
accessToken: string;
|
|
622
|
+
refreshToken?: string;
|
|
623
|
+
};
|
|
624
|
+
declare type BitbucketPassportProfile = Profile & {
|
|
625
|
+
id?: string;
|
|
626
|
+
displayName?: string;
|
|
627
|
+
username?: string;
|
|
628
|
+
avatarUrl?: string;
|
|
629
|
+
_json?: {
|
|
630
|
+
links?: {
|
|
631
|
+
avatar?: {
|
|
632
|
+
href?: string;
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
declare const bitbucketUsernameSignInResolver: SignInResolver<BitbucketOAuthResult>;
|
|
638
|
+
declare const bitbucketUserIdSignInResolver: SignInResolver<BitbucketOAuthResult>;
|
|
639
|
+
declare type BitbucketProviderOptions = {
|
|
640
|
+
/**
|
|
641
|
+
* The profile transformation function used to verify and convert the auth response
|
|
642
|
+
* into the profile that will be presented to the user.
|
|
643
|
+
*/
|
|
644
|
+
authHandler?: AuthHandler<OAuthResult>;
|
|
645
|
+
/**
|
|
646
|
+
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
647
|
+
*/
|
|
648
|
+
signIn?: {
|
|
649
|
+
/**
|
|
650
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
651
|
+
*/
|
|
652
|
+
resolver: SignInResolver<OAuthResult>;
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
declare const createBitbucketProvider: (options?: BitbucketProviderOptions | undefined) => AuthProviderFactory;
|
|
656
|
+
|
|
501
657
|
declare type GithubOAuthResult = {
|
|
502
658
|
fullProfile: Profile;
|
|
503
659
|
params: {
|
|
@@ -610,14 +766,30 @@ declare type OAuth2ProviderOptions = {
|
|
|
610
766
|
};
|
|
611
767
|
declare const createOAuth2Provider: (options?: OAuth2ProviderOptions | undefined) => AuthProviderFactory;
|
|
612
768
|
|
|
613
|
-
|
|
769
|
+
/**
|
|
770
|
+
* authentication result for the OIDC which includes the token set and user information (a profile response sent by OIDC server)
|
|
771
|
+
* @public
|
|
772
|
+
*/
|
|
773
|
+
declare type OidcAuthResult = {
|
|
614
774
|
tokenset: TokenSet;
|
|
615
775
|
userinfo: UserinfoResponse;
|
|
616
776
|
};
|
|
777
|
+
/**
|
|
778
|
+
* OIDC provider callback options. An auth handler and a sign in resolver
|
|
779
|
+
* can be passed while creating a OIDC provider.
|
|
780
|
+
*
|
|
781
|
+
* authHandler : called after sign in was successful, a new object must be returned which includes a profile
|
|
782
|
+
* signInResolver: called after sign in was successful, expects to return a new {@link BackstageSignInResult}
|
|
783
|
+
*
|
|
784
|
+
* Both options are optional. There is fallback for authHandler where the default handler expect an e-mail explicitly
|
|
785
|
+
* otherwise it throws an error
|
|
786
|
+
*
|
|
787
|
+
* @public
|
|
788
|
+
*/
|
|
617
789
|
declare type OidcProviderOptions = {
|
|
618
|
-
authHandler?: AuthHandler<
|
|
790
|
+
authHandler?: AuthHandler<OidcAuthResult>;
|
|
619
791
|
signIn?: {
|
|
620
|
-
resolver?: SignInResolver<
|
|
792
|
+
resolver?: SignInResolver<OidcAuthResult>;
|
|
621
793
|
};
|
|
622
794
|
};
|
|
623
795
|
declare const createOidcProvider: (options?: OidcProviderOptions | undefined) => AuthProviderFactory;
|
|
@@ -641,32 +813,8 @@ declare type OktaProviderOptions = {
|
|
|
641
813
|
};
|
|
642
814
|
declare const createOktaProvider: (_options?: OktaProviderOptions | undefined) => AuthProviderFactory;
|
|
643
815
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
params: {
|
|
647
|
-
id_token?: string;
|
|
648
|
-
scope: string;
|
|
649
|
-
expires_in: number;
|
|
650
|
-
};
|
|
651
|
-
accessToken: string;
|
|
652
|
-
refreshToken?: string;
|
|
653
|
-
};
|
|
654
|
-
declare type BitbucketPassportProfile = Profile & {
|
|
655
|
-
id?: string;
|
|
656
|
-
displayName?: string;
|
|
657
|
-
username?: string;
|
|
658
|
-
avatarUrl?: string;
|
|
659
|
-
_json?: {
|
|
660
|
-
links?: {
|
|
661
|
-
avatar?: {
|
|
662
|
-
href?: string;
|
|
663
|
-
};
|
|
664
|
-
};
|
|
665
|
-
};
|
|
666
|
-
};
|
|
667
|
-
declare const bitbucketUsernameSignInResolver: SignInResolver<BitbucketOAuthResult>;
|
|
668
|
-
declare const bitbucketUserIdSignInResolver: SignInResolver<BitbucketOAuthResult>;
|
|
669
|
-
declare type BitbucketProviderOptions = {
|
|
816
|
+
/** @public */
|
|
817
|
+
declare type OneLoginProviderOptions = {
|
|
670
818
|
/**
|
|
671
819
|
* The profile transformation function used to verify and convert the auth response
|
|
672
820
|
* into the profile that will be presented to the user.
|
|
@@ -682,100 +830,103 @@ declare type BitbucketProviderOptions = {
|
|
|
682
830
|
resolver: SignInResolver<OAuthResult>;
|
|
683
831
|
};
|
|
684
832
|
};
|
|
685
|
-
|
|
833
|
+
/** @public */
|
|
834
|
+
declare const createOneLoginProvider: (options?: OneLoginProviderOptions | undefined) => AuthProviderFactory;
|
|
686
835
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
authHandler: AuthHandler<OAuthResult>;
|
|
691
|
-
tokenIssuer: TokenIssuer;
|
|
692
|
-
catalogIdentityClient: CatalogIdentityClient;
|
|
693
|
-
logger: Logger;
|
|
836
|
+
/** @public */
|
|
837
|
+
declare type SamlAuthResult = {
|
|
838
|
+
fullProfile: any;
|
|
694
839
|
};
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
private readonly signInResolver?;
|
|
698
|
-
private readonly authHandler;
|
|
699
|
-
private readonly tokenIssuer;
|
|
700
|
-
private readonly catalogIdentityClient;
|
|
701
|
-
private readonly logger;
|
|
702
|
-
constructor(options: AtlassianAuthProviderOptions);
|
|
703
|
-
start(req: OAuthStartRequest): Promise<RedirectInfo>;
|
|
704
|
-
handler(req: express.Request): Promise<{
|
|
705
|
-
response: OAuthResponse;
|
|
706
|
-
refreshToken: string;
|
|
707
|
-
}>;
|
|
708
|
-
private handleResult;
|
|
709
|
-
refresh(req: OAuthRefreshRequest): Promise<OAuthResponse>;
|
|
710
|
-
}
|
|
711
|
-
declare type AtlassianProviderOptions = {
|
|
840
|
+
/** @public */
|
|
841
|
+
declare type SamlProviderOptions = {
|
|
712
842
|
/**
|
|
713
843
|
* The profile transformation function used to verify and convert the auth response
|
|
714
844
|
* into the profile that will be presented to the user.
|
|
715
845
|
*/
|
|
716
|
-
authHandler?: AuthHandler<
|
|
846
|
+
authHandler?: AuthHandler<SamlAuthResult>;
|
|
717
847
|
/**
|
|
718
848
|
* Configure sign-in for this provider, without it the provider can not be used to sign users in.
|
|
719
849
|
*/
|
|
720
850
|
signIn?: {
|
|
721
|
-
|
|
851
|
+
/**
|
|
852
|
+
* Maps an auth result to a Backstage identity for the user.
|
|
853
|
+
*/
|
|
854
|
+
resolver?: SignInResolver<SamlAuthResult>;
|
|
722
855
|
};
|
|
723
856
|
};
|
|
724
|
-
|
|
857
|
+
/** @public */
|
|
858
|
+
declare const createSamlProvider: (options?: SamlProviderOptions | undefined) => AuthProviderFactory;
|
|
725
859
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
declare type
|
|
860
|
+
/**
|
|
861
|
+
* The data extracted from an IAP token.
|
|
862
|
+
*
|
|
863
|
+
* @public
|
|
864
|
+
*/
|
|
865
|
+
declare type GcpIapTokenInfo = {
|
|
732
866
|
/**
|
|
733
|
-
* The
|
|
734
|
-
* into the profile that will be presented to the user.
|
|
867
|
+
* The unique, stable identifier for the user.
|
|
735
868
|
*/
|
|
736
|
-
|
|
869
|
+
sub: string;
|
|
737
870
|
/**
|
|
738
|
-
*
|
|
871
|
+
* User email address.
|
|
739
872
|
*/
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
};
|
|
873
|
+
email: string;
|
|
874
|
+
/**
|
|
875
|
+
* Other fields.
|
|
876
|
+
*/
|
|
877
|
+
[key: string]: JsonValue;
|
|
746
878
|
};
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
879
|
+
/**
|
|
880
|
+
* The result of the initial auth challenge. This is the input to the auth
|
|
881
|
+
* callbacks.
|
|
882
|
+
*
|
|
883
|
+
* @public
|
|
884
|
+
*/
|
|
885
|
+
declare type GcpIapResult = {
|
|
886
|
+
/**
|
|
887
|
+
* The data extracted from the IAP token header.
|
|
888
|
+
*/
|
|
889
|
+
iapToken: GcpIapTokenInfo;
|
|
752
890
|
};
|
|
753
|
-
/**
|
|
754
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Options for {@link createGcpIapProvider}.
|
|
893
|
+
*
|
|
894
|
+
* @public
|
|
895
|
+
*/
|
|
896
|
+
declare type GcpIapProviderOptions = {
|
|
755
897
|
/**
|
|
756
|
-
* The profile transformation function used to verify and convert the auth
|
|
757
|
-
* into the profile that will be presented to the user.
|
|
898
|
+
* The profile transformation function used to verify and convert the auth
|
|
899
|
+
* response into the profile that will be presented to the user. The default
|
|
900
|
+
* implementation just provides the authenticated email that the IAP
|
|
901
|
+
* presented.
|
|
758
902
|
*/
|
|
759
|
-
authHandler?: AuthHandler<
|
|
903
|
+
authHandler?: AuthHandler<GcpIapResult>;
|
|
760
904
|
/**
|
|
761
|
-
*
|
|
905
|
+
* Configures sign-in for this provider.
|
|
762
906
|
*/
|
|
763
|
-
signIn
|
|
907
|
+
signIn: {
|
|
764
908
|
/**
|
|
765
909
|
* Maps an auth result to a Backstage identity for the user.
|
|
766
910
|
*/
|
|
767
|
-
resolver
|
|
911
|
+
resolver: SignInResolver<GcpIapResult>;
|
|
768
912
|
};
|
|
769
913
|
};
|
|
770
|
-
|
|
771
|
-
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* Creates an auth provider for Google Identity-Aware Proxy.
|
|
917
|
+
*
|
|
918
|
+
* @public
|
|
919
|
+
*/
|
|
920
|
+
declare function createGcpIapProvider(options: GcpIapProviderOptions): AuthProviderFactory;
|
|
772
921
|
|
|
773
922
|
declare const factories: {
|
|
774
923
|
[providerId: string]: AuthProviderFactory;
|
|
775
924
|
};
|
|
776
925
|
|
|
777
926
|
/**
|
|
778
|
-
* Parses token and decorates the
|
|
927
|
+
* Parses a Backstage-issued token and decorates the
|
|
928
|
+
* {@link BackstageIdentityResponse} with identity information sourced from the
|
|
929
|
+
* token.
|
|
779
930
|
*
|
|
780
931
|
* @public
|
|
781
932
|
*/
|
|
@@ -809,4 +960,4 @@ declare type WebMessageResponse = {
|
|
|
809
960
|
declare const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void;
|
|
810
961
|
declare const ensuresXRequestedWith: (req: express.Request) => boolean;
|
|
811
962
|
|
|
812
|
-
export { AtlassianAuthProvider, AtlassianProviderOptions, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BackstageIdentityResponse, BackstageSignInResult, BackstageUserIdentity, 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, prepareBackstageIdentityResponse, readState, verifyNonce };
|
|
963
|
+
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 };
|
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.6.1",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -30,12 +30,13 @@
|
|
|
30
30
|
"clean": "backstage-cli clean"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@backstage/backend-common": "^0.
|
|
34
|
-
"@backstage/catalog-client": "^0.5.
|
|
35
|
-
"@backstage/catalog-model": "^0.9.
|
|
33
|
+
"@backstage/backend-common": "^0.10.2",
|
|
34
|
+
"@backstage/catalog-client": "^0.5.3",
|
|
35
|
+
"@backstage/catalog-model": "^0.9.8",
|
|
36
36
|
"@backstage/config": "^0.1.11",
|
|
37
37
|
"@backstage/errors": "^0.1.5",
|
|
38
|
-
"@backstage/test-utils": "^0.1
|
|
38
|
+
"@backstage/test-utils": "^0.2.1",
|
|
39
|
+
"@backstage/types": "^0.1.1",
|
|
39
40
|
"@google-cloud/firestore": "^4.15.1",
|
|
40
41
|
"@types/express": "^4.17.6",
|
|
41
42
|
"@types/passport": "^1.0.3",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"express-promise-router": "^4.1.0",
|
|
47
48
|
"express-session": "^1.17.1",
|
|
48
49
|
"fs-extra": "9.1.0",
|
|
49
|
-
"
|
|
50
|
+
"google-auth-library": "^7.6.1",
|
|
50
51
|
"helmet": "^4.0.0",
|
|
51
52
|
"jose": "^1.27.1",
|
|
52
53
|
"jwt-decode": "^3.1.0",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"yn": "^4.0.0"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
|
-
"@backstage/cli": "^0.10.
|
|
77
|
+
"@backstage/cli": "^0.10.5",
|
|
77
78
|
"@types/body-parser": "^1.19.0",
|
|
78
79
|
"@types/cookie-parser": "^1.4.2",
|
|
79
80
|
"@types/express-session": "^1.17.2",
|
|
@@ -84,7 +85,8 @@
|
|
|
84
85
|
"@types/passport-saml": "^1.1.3",
|
|
85
86
|
"@types/passport-strategy": "^0.2.35",
|
|
86
87
|
"@types/xml2js": "^0.4.7",
|
|
87
|
-
"msw": "^0.35.0"
|
|
88
|
+
"msw": "^0.35.0",
|
|
89
|
+
"supertest": "^6.1.3"
|
|
88
90
|
},
|
|
89
91
|
"files": [
|
|
90
92
|
"dist",
|
|
@@ -92,5 +94,5 @@
|
|
|
92
94
|
"config.d.ts"
|
|
93
95
|
],
|
|
94
96
|
"configSchema": "config.d.ts",
|
|
95
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "ffdb98aa2973366d48ff1774a7f892bc0c926e7e"
|
|
96
98
|
}
|