@backstage/plugin-auth-backend 0.14.2-next.0 → 0.15.0-next.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/dist/index.d.ts CHANGED
@@ -1,23 +1,16 @@
1
1
  /// <reference types="node" />
2
2
  import express from 'express';
3
3
  import { Logger } from 'winston';
4
- import { TokenManager, PluginEndpointDiscovery, PluginDatabaseManager } from '@backstage/backend-common';
5
- import { CatalogApi, GetEntitiesRequest } from '@backstage/catalog-client';
4
+ import { GetEntitiesRequest, CatalogApi } from '@backstage/catalog-client';
5
+ 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 { UserEntity, Entity } from '@backstage/catalog-model';
9
+ import { PluginDatabaseManager, PluginEndpointDiscovery, TokenManager } from '@backstage/backend-common';
10
10
  import { IncomingHttpHeaders } from 'http';
11
11
  import { TokenSet, UserinfoResponse } from 'openid-client';
12
12
  import { JsonValue } from '@backstage/types';
13
13
 
14
- /** Represents any form of serializable JWK */
15
- interface AnyJWK extends Record<string, string> {
16
- use: 'sig';
17
- alg: string;
18
- kid: string;
19
- kty: string;
20
- }
21
14
  /**
22
15
  * Parameters used to issue new ID Tokens
23
16
  *
@@ -32,25 +25,6 @@ declare type TokenParams = {
32
25
  ent?: string[];
33
26
  };
34
27
  };
35
- /**
36
- * A TokenIssuer is able to issue verifiable ID Tokens on demand.
37
- *
38
- * @public
39
- * @deprecated This interface is deprecated and will be removed in a future release.
40
- */
41
- declare type TokenIssuer = {
42
- /**
43
- * Issues a new ID Token
44
- */
45
- issueToken(params: TokenParams): Promise<string>;
46
- /**
47
- * List all public keys that are currently being used to sign tokens, or have been used
48
- * in the past within the token expiration time, including a grace period.
49
- */
50
- listPublicKeys(): Promise<{
51
- keys: AnyJWK[];
52
- }>;
53
- };
54
28
 
55
29
  /**
56
30
  * Common options for passport.js-based OAuth providers
@@ -153,44 +127,6 @@ interface OAuthHandlers {
153
127
  logout?(): Promise<void>;
154
128
  }
155
129
 
156
- declare type UserQuery = {
157
- annotations: Record<string, string>;
158
- };
159
- declare type MemberClaimQuery = {
160
- entityRefs: string[];
161
- logger?: Logger;
162
- };
163
- /**
164
- * A catalog client tailored for reading out identity data from the catalog.
165
- */
166
- declare class CatalogIdentityClient {
167
- private readonly catalogApi;
168
- private readonly tokenManager;
169
- constructor(options: {
170
- catalogApi: CatalogApi;
171
- tokenManager: TokenManager;
172
- });
173
- /**
174
- * Looks up a single user using a query.
175
- *
176
- * Throws a NotFoundError or ConflictError if 0 or multiple users are found.
177
- */
178
- findUser(query: UserQuery): Promise<UserEntity>;
179
- /**
180
- * Resolve additional entity claims from the catalog, using the passed-in entity names. Designed
181
- * to be used within a `signInResolver` where additional entity claims might be provided, but
182
- * group membership and transient group membership lean on imported catalog relations.
183
- *
184
- * Returns a superset of the entity names that can be passed directly to `issueToken` as `ent`.
185
- */
186
- resolveCatalogMembership(query: MemberClaimQuery): Promise<string[]>;
187
- }
188
-
189
- /**
190
- * @deprecated use {@link getDefaultOwnershipEntityRefs} instead
191
- */
192
- declare function getEntityClaims(entity: UserEntity): TokenParams['claims'];
193
-
194
130
  /**
195
131
  * A query for a single user in the catalog.
196
132
  *
@@ -223,12 +159,6 @@ declare type AuthResolverCatalogUserQuery = {
223
159
  * @public
224
160
  */
225
161
  declare type AuthResolverContext = {
226
- /** @deprecated Will be removed from the context, access it via a closure instead if needed */
227
- logger: Logger;
228
- /** @deprecated Use the `issueToken` method instead */
229
- tokenIssuer: TokenIssuer;
230
- /** @deprecated Use the `findCatalogUser` and `signInWithCatalogUser` methods instead, and the `getDefaultOwnershipEntityRefs` helper */
231
- catalogIdentityClient: CatalogIdentityClient;
232
162
  /**
233
163
  * Issues a Backstage token using the provided parameters.
234
164
  */
@@ -348,33 +278,12 @@ interface AuthProviderRouteHandlers {
348
278
  */
349
279
  logout?(req: express.Request, res: express.Response): Promise<void>;
350
280
  }
351
- /**
352
- * @deprecated This type is deprecated and will be removed in a future release.
353
- */
354
- declare type AuthProviderFactoryOptions = {
355
- providerId: string;
356
- globalConfig: AuthProviderConfig;
357
- config: Config;
358
- logger: Logger;
359
- tokenManager: TokenManager;
360
- tokenIssuer: TokenIssuer;
361
- discovery: PluginEndpointDiscovery;
362
- catalogApi: CatalogApi;
363
- };
364
281
  declare type AuthProviderFactory = (options: {
365
282
  providerId: string;
366
283
  globalConfig: AuthProviderConfig;
367
284
  config: Config;
368
285
  logger: Logger;
369
286
  resolverContext: AuthResolverContext;
370
- /** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
371
- tokenManager: TokenManager;
372
- /** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
373
- tokenIssuer: TokenIssuer;
374
- /** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
375
- discovery: PluginEndpointDiscovery;
376
- /** @deprecated This field has been deprecated and needs to be passed directly to the auth provider instead */
377
- catalogApi: CatalogApi;
378
287
  }) => AuthProviderRouteHandlers;
379
288
  /** @public */
380
289
  declare type AuthResponse<ProviderInfo> = {
@@ -477,15 +386,13 @@ declare type Options = {
477
386
  cookieDomain: string;
478
387
  cookiePath: string;
479
388
  appOrigin: string;
480
- /** @deprecated This option is no longer needed */
481
- tokenIssuer?: TokenIssuer;
482
389
  isOriginAllowed: (origin: string) => boolean;
483
390
  callbackUrl: string;
484
391
  };
485
392
  declare class OAuthAdapter implements AuthProviderRouteHandlers {
486
393
  private readonly handlers;
487
394
  private readonly options;
488
- static fromConfig(config: AuthProviderConfig, handlers: OAuthHandlers, options: Pick<Options, 'providerId' | 'persistScopes' | 'tokenIssuer' | 'callbackUrl'>): OAuthAdapter;
395
+ static fromConfig(config: AuthProviderConfig, handlers: OAuthHandlers, options: Pick<Options, 'providerId' | 'persistScopes' | 'callbackUrl'>): OAuthAdapter;
489
396
  private readonly baseCookieOptions;
490
397
  constructor(handlers: OAuthHandlers, options: Options);
491
398
  start(req: express.Request, res: express.Response): Promise<void>;
@@ -514,6 +421,10 @@ declare type AtlassianAuthProviderOptions = OAuthProviderOptions & {
514
421
  authHandler: AuthHandler<OAuthResult>;
515
422
  resolverContext: AuthResolverContext;
516
423
  };
424
+ /**
425
+ * @public
426
+ * @deprecated This export is deprecated and will be removed in the future.
427
+ */
517
428
  declare class AtlassianAuthProvider implements OAuthHandlers {
518
429
  private readonly _strategy;
519
430
  private readonly signInResolver?;
@@ -531,81 +442,6 @@ declare class AtlassianAuthProvider implements OAuthHandlers {
531
442
  refreshToken: string | undefined;
532
443
  }>;
533
444
  }
534
- /**
535
- * @public
536
- * @deprecated This type has been inlined into the create method and will be removed.
537
- */
538
- declare type AtlassianProviderOptions = {
539
- /**
540
- * The profile transformation function used to verify and convert the auth response
541
- * into the profile that will be presented to the user.
542
- */
543
- authHandler?: AuthHandler<OAuthResult>;
544
- /**
545
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
546
- */
547
- signIn?: {
548
- resolver: SignInResolver<OAuthResult>;
549
- };
550
- };
551
- /**
552
- * @public
553
- * @deprecated Use `providers.atlassian.create` instead
554
- */
555
- declare const createAtlassianProvider: (options?: {
556
- /**
557
- * The profile transformation function used to verify and convert the auth response
558
- * into the profile that will be presented to the user.
559
- */
560
- authHandler?: AuthHandler<OAuthResult> | undefined;
561
- /**
562
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
563
- */
564
- signIn?: {
565
- resolver: SignInResolver<OAuthResult>;
566
- } | undefined;
567
- } | undefined) => AuthProviderFactory;
568
-
569
- /**
570
- * @public
571
- * @deprecated This type has been inlined into the create method and will be removed.
572
- */
573
- declare type Auth0ProviderOptions = {
574
- /**
575
- * The profile transformation function used to verify and convert the auth response
576
- * into the profile that will be presented to the user.
577
- */
578
- authHandler?: AuthHandler<OAuthResult>;
579
- /**
580
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
581
- */
582
- signIn?: {
583
- /**
584
- * Maps an auth result to a Backstage identity for the user.
585
- */
586
- resolver: SignInResolver<OAuthResult>;
587
- };
588
- };
589
- /**
590
- * @public
591
- * @deprecated Use `providers.auth0.create` instead.
592
- */
593
- declare const createAuth0Provider: (options?: {
594
- /**
595
- * The profile transformation function used to verify and convert the auth response
596
- * into the profile that will be presented to the user.
597
- */
598
- authHandler?: AuthHandler<OAuthResult> | undefined;
599
- /**
600
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
601
- */
602
- signIn?: {
603
- /**
604
- * Maps an auth result to a Backstage identity for the user.
605
- */
606
- resolver: SignInResolver<OAuthResult>;
607
- } | undefined;
608
- } | undefined) => AuthProviderFactory;
609
445
 
610
446
  /** @public */
611
447
  declare type AwsAlbResult = {
@@ -613,46 +449,6 @@ declare type AwsAlbResult = {
613
449
  expiresInSeconds?: number;
614
450
  accessToken: string;
615
451
  };
616
- /**
617
- * @public
618
- * @deprecated This type has been inlined into the create method and will be removed.
619
- */
620
- declare type AwsAlbProviderOptions = {
621
- /**
622
- * The profile transformation function used to verify and convert the auth response
623
- * into the profile that will be presented to the user.
624
- */
625
- authHandler?: AuthHandler<AwsAlbResult>;
626
- /**
627
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
628
- */
629
- signIn: {
630
- /**
631
- * Maps an auth result to a Backstage identity for the user.
632
- */
633
- resolver: SignInResolver<AwsAlbResult>;
634
- };
635
- };
636
- /**
637
- * @public
638
- * @deprecated Use `providers.awsAlb.create` instead
639
- */
640
- declare const createAwsAlbProvider: (options?: {
641
- /**
642
- * The profile transformation function used to verify and convert the auth response
643
- * into the profile that will be presented to the user.
644
- */
645
- authHandler?: AuthHandler<AwsAlbResult> | undefined;
646
- /**
647
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
648
- */
649
- signIn: {
650
- /**
651
- * Maps an auth result to a Backstage identity for the user.
652
- */
653
- resolver: SignInResolver<AwsAlbResult>;
654
- };
655
- } | undefined) => AuthProviderFactory;
656
452
 
657
453
  declare type BitbucketOAuthResult = {
658
454
  fullProfile: BitbucketPassportProfile;
@@ -677,56 +473,6 @@ declare type BitbucketPassportProfile = Profile & {
677
473
  };
678
474
  };
679
475
  };
680
- /**
681
- * @public
682
- * @deprecated This type has been inlined into the create method and will be removed.
683
- */
684
- declare type BitbucketProviderOptions = {
685
- /**
686
- * The profile transformation function used to verify and convert the auth response
687
- * into the profile that will be presented to the user.
688
- */
689
- authHandler?: AuthHandler<OAuthResult>;
690
- /**
691
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
692
- */
693
- signIn?: {
694
- /**
695
- * Maps an auth result to a Backstage identity for the user.
696
- */
697
- resolver: SignInResolver<OAuthResult>;
698
- };
699
- };
700
- /**
701
- * @public
702
- * @deprecated Use `providers.bitbucket.create` instead
703
- */
704
- declare const createBitbucketProvider: (options?: {
705
- /**
706
- * The profile transformation function used to verify and convert the auth response
707
- * into the profile that will be presented to the user.
708
- */
709
- authHandler?: AuthHandler<OAuthResult> | undefined;
710
- /**
711
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
712
- */
713
- signIn?: {
714
- /**
715
- * Maps an auth result to a Backstage identity for the user.
716
- */
717
- resolver: SignInResolver<OAuthResult>;
718
- } | undefined;
719
- } | undefined) => AuthProviderFactory;
720
- /**
721
- * @public
722
- * @deprecated Use `providers.bitbucket.resolvers.usernameMatchingUserEntityAnnotation()` instead.
723
- */
724
- declare const bitbucketUsernameSignInResolver: SignInResolver<OAuthResult>;
725
- /**
726
- * @public
727
- * @deprecated Use `providers.bitbucket.resolvers.userIdMatchingUserEntityAnnotation()` instead.
728
- */
729
- declare const bitbucketUserIdSignInResolver: SignInResolver<OAuthResult>;
730
476
 
731
477
  declare type GithubOAuthResult = {
732
478
  fullProfile: Profile;
@@ -738,234 +484,6 @@ declare type GithubOAuthResult = {
738
484
  accessToken: string;
739
485
  refreshToken?: string;
740
486
  };
741
- /**
742
- * @public
743
- * @deprecated This type has been inlined into the create method and will be removed.
744
- */
745
- declare type GithubProviderOptions = {
746
- /**
747
- * The profile transformation function used to verify and convert the auth response
748
- * into the profile that will be presented to the user.
749
- */
750
- authHandler?: AuthHandler<GithubOAuthResult>;
751
- /**
752
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
753
- */
754
- signIn?: {
755
- /**
756
- * Maps an auth result to a Backstage identity for the user.
757
- */
758
- resolver: SignInResolver<GithubOAuthResult>;
759
- };
760
- /**
761
- * The state encoder used to encode the 'state' parameter on the OAuth request.
762
- *
763
- * It should return a string that takes the state params (from the request), url encodes the params
764
- * and finally base64 encodes them.
765
- *
766
- * Providing your own stateEncoder will allow you to add addition parameters to the state field.
767
- *
768
- * It is typed as follows:
769
- * `export type StateEncoder = (input: OAuthState) => Promise<{encodedState: string}>;`
770
- *
771
- * Note: the stateEncoder must encode a 'nonce' value and an 'env' value. Without this, the OAuth flow will fail
772
- * (These two values will be set by the req.state by default)
773
- *
774
- * For more information, please see the helper module in ../../oauth/helpers #readState
775
- */
776
- stateEncoder?: StateEncoder;
777
- };
778
- /**
779
- * @public
780
- * @deprecated Use `providers.github.create` instead
781
- */
782
- declare const createGithubProvider: (options?: {
783
- /**
784
- * The profile transformation function used to verify and convert the auth response
785
- * into the profile that will be presented to the user.
786
- */
787
- authHandler?: AuthHandler<GithubOAuthResult> | undefined;
788
- /**
789
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
790
- */
791
- signIn?: {
792
- /**
793
- * Maps an auth result to a Backstage identity for the user.
794
- */
795
- resolver: SignInResolver<GithubOAuthResult>;
796
- } | undefined;
797
- /**
798
- * The state encoder used to encode the 'state' parameter on the OAuth request.
799
- *
800
- * It should return a string that takes the state params (from the request), url encodes the params
801
- * and finally base64 encodes them.
802
- *
803
- * Providing your own stateEncoder will allow you to add addition parameters to the state field.
804
- *
805
- * It is typed as follows:
806
- * `export type StateEncoder = (input: OAuthState) => Promise<{encodedState: string}>;`
807
- *
808
- * Note: the stateEncoder must encode a 'nonce' value and an 'env' value. Without this, the OAuth flow will fail
809
- * (These two values will be set by the req.state by default)
810
- *
811
- * For more information, please see the helper module in ../../oauth/helpers #readState
812
- */
813
- stateEncoder?: StateEncoder | undefined;
814
- } | undefined) => AuthProviderFactory;
815
-
816
- /**
817
- * @public
818
- * @deprecated This type has been inlined into the create method and will be removed.
819
- */
820
- declare type GitlabProviderOptions = {
821
- /**
822
- * The profile transformation function used to verify and convert the auth response
823
- * into the profile that will be presented to the user.
824
- */
825
- authHandler?: AuthHandler<OAuthResult>;
826
- /**
827
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
828
- */
829
- /**
830
- * Maps an auth result to a Backstage identity for the user.
831
- *
832
- * Set to `'email'` to use the default email-based sign in resolver, which will search
833
- * the catalog for a single user entity that has a matching `microsoft.com/email` annotation.
834
- */
835
- signIn?: {
836
- resolver: SignInResolver<OAuthResult>;
837
- };
838
- };
839
- /**
840
- * @public
841
- * @deprecated Use `providers.gitlab.create` instead
842
- */
843
- declare const createGitlabProvider: (options?: {
844
- /**
845
- * The profile transformation function used to verify and convert the auth response
846
- * into the profile that will be presented to the user.
847
- */
848
- authHandler?: AuthHandler<OAuthResult> | undefined;
849
- /**
850
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
851
- */
852
- signIn?: {
853
- resolver: SignInResolver<OAuthResult>;
854
- } | undefined;
855
- } | undefined) => AuthProviderFactory;
856
-
857
- /**
858
- * @public
859
- * @deprecated This type has been inlined into the create method and will be removed.
860
- */
861
- declare type GoogleProviderOptions = {
862
- /**
863
- * The profile transformation function used to verify and convert the auth response
864
- * into the profile that will be presented to the user.
865
- */
866
- authHandler?: AuthHandler<OAuthResult>;
867
- /**
868
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
869
- */
870
- signIn?: {
871
- /**
872
- * Maps an auth result to a Backstage identity for the user.
873
- */
874
- resolver: SignInResolver<OAuthResult>;
875
- };
876
- };
877
- /**
878
- * @public
879
- * @deprecated Use `providers.google.create` instead.
880
- */
881
- declare const createGoogleProvider: (options?: {
882
- /**
883
- * The profile transformation function used to verify and convert the auth response
884
- * into the profile that will be presented to the user.
885
- */
886
- authHandler?: AuthHandler<OAuthResult> | undefined;
887
- /**
888
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
889
- */
890
- signIn?: {
891
- /**
892
- * Maps an auth result to a Backstage identity for the user.
893
- */
894
- resolver: SignInResolver<OAuthResult>;
895
- } | undefined;
896
- } | undefined) => AuthProviderFactory;
897
- /**
898
- * @public
899
- * @deprecated Use `providers.google.resolvers.emailMatchingUserEntityAnnotation()` instead.
900
- */
901
- declare const googleEmailSignInResolver: SignInResolver<OAuthResult>;
902
-
903
- /**
904
- * @public
905
- * @deprecated This type has been inlined into the create method and will be removed.
906
- */
907
- declare type MicrosoftProviderOptions = {
908
- /**
909
- * The profile transformation function used to verify and convert the auth response
910
- * into the profile that will be presented to the user.
911
- */
912
- authHandler?: AuthHandler<OAuthResult>;
913
- /**
914
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
915
- */
916
- signIn?: {
917
- /**
918
- * Maps an auth result to a Backstage identity for the user.
919
- */
920
- resolver: SignInResolver<OAuthResult>;
921
- };
922
- };
923
- /**
924
- * @public
925
- * @deprecated Use `providers.microsoft.create` instead
926
- */
927
- declare const createMicrosoftProvider: (options?: {
928
- /**
929
- * The profile transformation function used to verify and convert the auth response
930
- * into the profile that will be presented to the user.
931
- */
932
- authHandler?: AuthHandler<OAuthResult> | undefined;
933
- /**
934
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
935
- */
936
- signIn?: {
937
- /**
938
- * Maps an auth result to a Backstage identity for the user.
939
- */
940
- resolver: SignInResolver<OAuthResult>;
941
- } | undefined;
942
- } | undefined) => AuthProviderFactory;
943
- /**
944
- * @public
945
- * @deprecated Use `providers.microsoft.resolvers.emailMatchingUserEntityAnnotation()` instead.
946
- */
947
- declare const microsoftEmailSignInResolver: SignInResolver<OAuthResult>;
948
-
949
- /**
950
- * @public
951
- * @deprecated This type has been inlined into the create method and will be removed.
952
- */
953
- declare type OAuth2ProviderOptions = {
954
- authHandler?: AuthHandler<OAuthResult>;
955
- signIn?: {
956
- resolver: SignInResolver<OAuthResult>;
957
- };
958
- };
959
- /**
960
- * @public
961
- * @deprecated Use `providers.oauth2.create` instead
962
- */
963
- declare const createOAuth2Provider: (options?: {
964
- authHandler?: AuthHandler<OAuthResult> | undefined;
965
- signIn?: {
966
- resolver: SignInResolver<OAuthResult>;
967
- } | undefined;
968
- } | undefined) => AuthProviderFactory;
969
487
 
970
488
  /**
971
489
  * JWT header extraction result, containing the raw value and the parsed JWT
@@ -1006,48 +524,6 @@ declare type OAuth2ProxyResult<JWTPayload = {}> = {
1006
524
  */
1007
525
  getHeader(name: string): string | undefined;
1008
526
  };
1009
- /**
1010
- * @public
1011
- * @deprecated This type has been inlined into the create method and will be removed.
1012
- */
1013
- declare type Oauth2ProxyProviderOptions<JWTPayload> = {
1014
- /**
1015
- * Configure an auth handler to generate a profile for the user.
1016
- */
1017
- authHandler: AuthHandler<OAuth2ProxyResult<JWTPayload>>;
1018
- /**
1019
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1020
- */
1021
- signIn: {
1022
- /**
1023
- * Maps an auth result to a Backstage identity for the user.
1024
- */
1025
- resolver: SignInResolver<OAuth2ProxyResult<JWTPayload>>;
1026
- };
1027
- };
1028
- /**
1029
- * @public
1030
- * @deprecated Use `providers.oauth2Proxy.create` instead
1031
- */
1032
- declare const createOauth2ProxyProvider: (options: {
1033
- /**
1034
- * Configure an auth handler to generate a profile for the user.
1035
- *
1036
- * The default implementation uses the value of the `X-Forwarded-Preferred-Username`
1037
- * header as the display name, falling back to `X-Forwarded-User`, and the value of
1038
- * the `X-Forwarded-Email` header as the email address.
1039
- */
1040
- authHandler?: AuthHandler<OAuth2ProxyResult<unknown>> | undefined;
1041
- /**
1042
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1043
- */
1044
- signIn: {
1045
- /**
1046
- * Maps an auth result to a Backstage identity for the user.
1047
- */
1048
- resolver: SignInResolver<OAuth2ProxyResult<unknown>>;
1049
- };
1050
- }) => AuthProviderFactory;
1051
527
 
1052
528
  /**
1053
529
  * authentication result for the OIDC which includes the token set and user information (a profile response sent by OIDC server)
@@ -1057,163 +533,11 @@ declare type OidcAuthResult = {
1057
533
  tokenset: TokenSet;
1058
534
  userinfo: UserinfoResponse;
1059
535
  };
1060
- /**
1061
- * @public
1062
- * @deprecated This type has been inlined into the create method and will be removed.
1063
- */
1064
- declare type OidcProviderOptions = {
1065
- authHandler?: AuthHandler<OidcAuthResult>;
1066
- signIn?: {
1067
- resolver: SignInResolver<OidcAuthResult>;
1068
- };
1069
- };
1070
- /**
1071
- * @public
1072
- * @deprecated Use `providers.oidc.create` instead
1073
- */
1074
- declare const createOidcProvider: (options?: {
1075
- authHandler?: AuthHandler<OidcAuthResult> | undefined;
1076
- signIn?: {
1077
- resolver: SignInResolver<OidcAuthResult>;
1078
- } | undefined;
1079
- } | undefined) => AuthProviderFactory;
1080
-
1081
- /**
1082
- * @public
1083
- * @deprecated This type has been inlined into the create method and will be removed.
1084
- */
1085
- declare type OktaProviderOptions = {
1086
- /**
1087
- * The profile transformation function used to verify and convert the auth response
1088
- * into the profile that will be presented to the user.
1089
- */
1090
- authHandler?: AuthHandler<OAuthResult>;
1091
- /**
1092
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1093
- */
1094
- signIn?: {
1095
- /**
1096
- * Maps an auth result to a Backstage identity for the user.
1097
- */
1098
- resolver: SignInResolver<OAuthResult>;
1099
- };
1100
- };
1101
- /**
1102
- * @public
1103
- * @deprecated Use `providers.okta.create` instead
1104
- */
1105
- declare const createOktaProvider: (options?: {
1106
- /**
1107
- * The profile transformation function used to verify and convert the auth response
1108
- * into the profile that will be presented to the user.
1109
- */
1110
- authHandler?: AuthHandler<OAuthResult> | undefined;
1111
- /**
1112
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1113
- */
1114
- signIn?: {
1115
- /**
1116
- * Maps an auth result to a Backstage identity for the user.
1117
- */
1118
- resolver: SignInResolver<OAuthResult>;
1119
- } | undefined;
1120
- } | undefined) => AuthProviderFactory;
1121
- /**
1122
- * @public
1123
- * @deprecated Use `providers.okta.resolvers.emailMatchingUserEntityAnnotation()` instead.
1124
- */
1125
- declare const oktaEmailSignInResolver: SignInResolver<OAuthResult>;
1126
-
1127
- /**
1128
- * @public
1129
- * @deprecated This type has been inlined into the create method and will be removed.
1130
- */
1131
- declare type OneLoginProviderOptions = {
1132
- /**
1133
- * The profile transformation function used to verify and convert the auth response
1134
- * into the profile that will be presented to the user.
1135
- */
1136
- authHandler?: AuthHandler<OAuthResult>;
1137
- /**
1138
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1139
- */
1140
- signIn?: {
1141
- /**
1142
- * Maps an auth result to a Backstage identity for the user.
1143
- */
1144
- resolver: SignInResolver<OAuthResult>;
1145
- };
1146
- };
1147
- /**
1148
- * @public
1149
- * @deprecated Use `providers.onelogin.create` instead
1150
- */
1151
- declare const createOneLoginProvider: (options?: {
1152
- /**
1153
- * The profile transformation function used to verify and convert the auth response
1154
- * into the profile that will be presented to the user.
1155
- */
1156
- authHandler?: AuthHandler<OAuthResult> | undefined;
1157
- /**
1158
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1159
- */
1160
- signIn?: {
1161
- /**
1162
- * Maps an auth result to a Backstage identity for the user.
1163
- */
1164
- resolver: SignInResolver<OAuthResult>;
1165
- } | undefined;
1166
- } | undefined) => AuthProviderFactory;
1167
536
 
1168
537
  /** @public */
1169
538
  declare type SamlAuthResult = {
1170
539
  fullProfile: any;
1171
540
  };
1172
- /**
1173
- * @public
1174
- * @deprecated This type has been inlined into the create method and will be removed.
1175
- */
1176
- declare type SamlProviderOptions = {
1177
- /**
1178
- * The profile transformation function used to verify and convert the auth response
1179
- * into the profile that will be presented to the user.
1180
- */
1181
- authHandler?: AuthHandler<SamlAuthResult>;
1182
- /**
1183
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1184
- */
1185
- signIn?: {
1186
- /**
1187
- * Maps an auth result to a Backstage identity for the user.
1188
- */
1189
- resolver: SignInResolver<SamlAuthResult>;
1190
- };
1191
- };
1192
- /**
1193
- * @public
1194
- * @deprecated Use `providers.saml.create` instead
1195
- */
1196
- declare const createSamlProvider: (options?: {
1197
- /**
1198
- * The profile transformation function used to verify and convert the auth response
1199
- * into the profile that will be presented to the user.
1200
- */
1201
- authHandler?: AuthHandler<SamlAuthResult> | undefined;
1202
- /**
1203
- * Configure sign-in for this provider, without it the provider can not be used to sign users in.
1204
- */
1205
- signIn?: {
1206
- /**
1207
- * Maps an auth result to a Backstage identity for the user.
1208
- */
1209
- resolver: SignInResolver<SamlAuthResult>;
1210
- } | undefined;
1211
- } | undefined) => AuthProviderFactory;
1212
- /**
1213
- * @public
1214
- * @deprecated Use `providers.saml.resolvers.nameIdMatchingUserEntityName()` instead.
1215
- */
1216
- declare const samlNameIdEntityNameSignInResolver: SignInResolver<SamlAuthResult>;
1217
541
 
1218
542
  /**
1219
543
  * The data extracted from an IAP token.
@@ -1246,51 +570,6 @@ declare type GcpIapResult = {
1246
570
  */
1247
571
  iapToken: GcpIapTokenInfo;
1248
572
  };
1249
- /**
1250
- * @public
1251
- * @deprecated This type has been inlined into the create method and will be removed.
1252
- */
1253
- declare type GcpIapProviderOptions = {
1254
- /**
1255
- * The profile transformation function used to verify and convert the auth
1256
- * response into the profile that will be presented to the user. The default
1257
- * implementation just provides the authenticated email that the IAP
1258
- * presented.
1259
- */
1260
- authHandler?: AuthHandler<GcpIapResult>;
1261
- /**
1262
- * Configures sign-in for this provider.
1263
- */
1264
- signIn: {
1265
- /**
1266
- * Maps an auth result to a Backstage identity for the user.
1267
- */
1268
- resolver: SignInResolver<GcpIapResult>;
1269
- };
1270
- };
1271
-
1272
- /**
1273
- * @public
1274
- * @deprecated Use `providers.gcpIap.create` instead
1275
- */
1276
- declare const createGcpIapProvider: (options: {
1277
- /**
1278
- * The profile transformation function used to verify and convert the auth
1279
- * response into the profile that will be presented to the user. The default
1280
- * implementation just provides the authenticated email that the IAP
1281
- * presented.
1282
- */
1283
- authHandler?: AuthHandler<GcpIapResult> | undefined;
1284
- /**
1285
- * Configures sign-in for this provider.
1286
- */
1287
- signIn: {
1288
- /**
1289
- * Maps an auth result to a Backstage identity for the user.
1290
- */
1291
- resolver: SignInResolver<GcpIapResult>;
1292
- };
1293
- }) => AuthProviderFactory;
1294
573
 
1295
574
  /**
1296
575
  * All built-in auth provider integrations.
@@ -1454,8 +733,12 @@ declare const providers: Readonly<{
1454
733
  }>;
1455
734
  }>;
1456
735
  }>;
1457
-
1458
- declare const factories: {
736
+ /**
737
+ * All auth provider factories that are installed by default.
738
+ *
739
+ * @public
740
+ */
741
+ declare const defaultAuthProviderFactories: {
1459
742
  [providerId: string]: AuthProviderFactory;
1460
743
  };
1461
744
 
@@ -1477,6 +760,7 @@ interface RouterOptions {
1477
760
  config: Config;
1478
761
  discovery: PluginEndpointDiscovery;
1479
762
  tokenManager: TokenManager;
763
+ tokenFactoryAlgorithm?: string;
1480
764
  providerFactories?: ProviderFactories;
1481
765
  }
1482
766
  declare function createRouter(options: RouterOptions): Promise<express.Router>;
@@ -1497,6 +781,39 @@ declare type WebMessageResponse = {
1497
781
  declare const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void;
1498
782
  declare const ensuresXRequestedWith: (req: express.Request) => boolean;
1499
783
 
784
+ declare type UserQuery = {
785
+ annotations: Record<string, string>;
786
+ };
787
+ declare type MemberClaimQuery = {
788
+ entityRefs: string[];
789
+ logger?: Logger;
790
+ };
791
+ /**
792
+ * A catalog client tailored for reading out identity data from the catalog.
793
+ */
794
+ declare class CatalogIdentityClient {
795
+ private readonly catalogApi;
796
+ private readonly tokenManager;
797
+ constructor(options: {
798
+ catalogApi: CatalogApi;
799
+ tokenManager: TokenManager;
800
+ });
801
+ /**
802
+ * Looks up a single user using a query.
803
+ *
804
+ * Throws a NotFoundError or ConflictError if 0 or multiple users are found.
805
+ */
806
+ findUser(query: UserQuery): Promise<UserEntity>;
807
+ /**
808
+ * Resolve additional entity claims from the catalog, using the passed-in entity names. Designed
809
+ * to be used within a `signInResolver` where additional entity claims might be provided, but
810
+ * group membership and transient group membership lean on imported catalog relations.
811
+ *
812
+ * Returns a superset of the entity names that can be passed directly to `issueToken` as `ent`.
813
+ */
814
+ resolveCatalogMembership(query: MemberClaimQuery): Promise<string[]>;
815
+ }
816
+
1500
817
  /**
1501
818
  * Uses the default ownership resolution logic to return an array
1502
819
  * of entity refs that the provided entity claims ownership through.
@@ -1507,4 +824,4 @@ declare const ensuresXRequestedWith: (req: express.Request) => boolean;
1507
824
  */
1508
825
  declare function getDefaultOwnershipEntityRefs(entity: Entity): string[];
1509
826
 
1510
- export { AtlassianAuthProvider, AtlassianProviderOptions, Auth0ProviderOptions, AuthHandler, AuthHandlerResult, AuthProviderConfig, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResolverCatalogUserQuery, AuthResolverContext, AuthResponse, AwsAlbProviderOptions, AwsAlbResult, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, CookieConfigurer, GcpIapProviderOptions, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, Oauth2ProxyProviderOptions, OidcAuthResult, OidcProviderOptions, OktaProviderOptions, OneLoginProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, SignInInfo, SignInResolver, StateEncoder, TokenIssuer, TokenParams, 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, getDefaultOwnershipEntityRefs, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, prepareBackstageIdentityResponse, providers, readState, samlNameIdEntityNameSignInResolver, verifyNonce };
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 };