@backstage/plugin-auth-backend 0.9.0 → 0.10.0-next.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/dist/index.d.ts CHANGED
@@ -233,6 +233,22 @@ declare type AuthResolverContext = {
233
233
  catalogIdentityClient: CatalogIdentityClient;
234
234
  logger: Logger;
235
235
  };
236
+ /**
237
+ * The callback used to resolve the cookie configuration for auth providers that use cookies.
238
+ * @public
239
+ */
240
+ declare type CookieConfigurer = (ctx: {
241
+ /** ID of the auth provider that this configuration applies to */
242
+ providerId: string;
243
+ /** The externally reachable base URL of the auth-backend plugin */
244
+ baseUrl: string;
245
+ /** The configured callback URL of the auth provider */
246
+ callbackUrl: string;
247
+ }) => {
248
+ domain: string;
249
+ path: string;
250
+ secure: boolean;
251
+ };
236
252
  declare type AuthProviderConfig = {
237
253
  /**
238
254
  * The protocol://domain[:port] where the app is hosted. This is used to construct the
@@ -247,6 +263,10 @@ declare type AuthProviderConfig = {
247
263
  * A function that is called to check whether an origin is allowed to receive the authentication result.
248
264
  */
249
265
  isOriginAllowed: (origin: string) => boolean;
266
+ /**
267
+ * The function used to resolve cookie configuration based on the auth provider options.
268
+ */
269
+ cookieConfigurer?: CookieConfigurer;
250
270
  };
251
271
  declare type RedirectInfo = {
252
272
  /**
@@ -493,7 +513,7 @@ declare type Options = {
493
513
  appOrigin: string;
494
514
  tokenIssuer: TokenIssuer;
495
515
  isOriginAllowed: (origin: string) => boolean;
496
- callbackUrl?: string;
516
+ callbackUrl: string;
497
517
  };
498
518
  declare class OAuthAdapter implements AuthProviderRouteHandlers {
499
519
  private readonly handlers;
@@ -999,4 +1019,4 @@ declare type WebMessageResponse = {
999
1019
  declare const postMessageResponse: (res: express.Response, appOrigin: string, response: WebMessageResponse) => void;
1000
1020
  declare const ensuresXRequestedWith: (req: express.Request) => boolean;
1001
1021
 
1002
- export { AtlassianAuthProvider, AtlassianProviderOptions, Auth0ProviderOptions, AuthHandler, AuthHandlerResult, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResolverContext, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BackstageIdentityResponse, BackstageSignInResult, BackstageUserIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, GcpIapProviderOptions, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, Oauth2ProxyProviderOptions, OidcAuthResult, OidcProviderOptions, OktaProviderOptions, OneLoginProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, SignInInfo, SignInResolver, TokenIssuer, 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, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, prepareBackstageIdentityResponse, readState, verifyNonce };
1022
+ export { AtlassianAuthProvider, AtlassianProviderOptions, Auth0ProviderOptions, AuthHandler, AuthHandlerResult, AuthProviderFactory, AuthProviderFactoryOptions, AuthProviderRouteHandlers, AuthResolverContext, AuthResponse, AwsAlbProviderOptions, BackstageIdentity, BackstageIdentityResponse, BackstageSignInResult, BackstageUserIdentity, BitbucketOAuthResult, BitbucketPassportProfile, BitbucketProviderOptions, CatalogIdentityClient, CookieConfigurer, GcpIapProviderOptions, GcpIapResult, GcpIapTokenInfo, GithubOAuthResult, GithubProviderOptions, GitlabProviderOptions, GoogleProviderOptions, IdentityClient, MicrosoftProviderOptions, OAuth2ProviderOptions, OAuth2ProxyResult, OAuthAdapter, OAuthEnvironmentHandler, OAuthHandlers, OAuthProviderInfo, OAuthProviderOptions, OAuthRefreshRequest, OAuthResponse, OAuthResult, OAuthStartRequest, OAuthState, Oauth2ProxyProviderOptions, OidcAuthResult, OidcProviderOptions, OktaProviderOptions, OneLoginProviderOptions, ProfileInfo, RouterOptions, SamlAuthResult, SamlProviderOptions, SignInInfo, SignInResolver, TokenIssuer, 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, getEntityClaims, googleEmailSignInResolver, microsoftEmailSignInResolver, oktaEmailSignInResolver, postMessageResponse, prepareBackstageIdentityResponse, readState, verifyNonce };
@@ -28,7 +28,7 @@ exports.up = async function up(knex) {
28
28
  .notNullable()
29
29
  .defaultTo(knex.fn.now())
30
30
  .comment('The creation time of the key')
31
- .alter();
31
+ .alter({ alterType: true });
32
32
  });
33
33
  }
34
34
  };
@@ -45,7 +45,7 @@ exports.down = async function down(knex) {
45
45
  .notNullable()
46
46
  .defaultTo(knex.fn.now())
47
47
  .comment('The creation time of the key')
48
- .alter();
48
+ .alter({ alterType: true });
49
49
  });
50
50
  }
51
51
  };
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.9.0",
4
+ "version": "0.10.0-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "clean": "backstage-cli clean"
31
31
  },
32
32
  "dependencies": {
33
- "@backstage/backend-common": "^0.10.6",
33
+ "@backstage/backend-common": "^0.10.7-next.0",
34
34
  "@backstage/catalog-client": "^0.5.5",
35
35
  "@backstage/catalog-model": "^0.9.10",
36
36
  "@backstage/config": "^0.1.13",
@@ -50,7 +50,7 @@
50
50
  "helmet": "^4.0.0",
51
51
  "jose": "^1.27.1",
52
52
  "jwt-decode": "^3.1.0",
53
- "knex": "^0.95.1",
53
+ "knex": "^1.0.2",
54
54
  "lodash": "^4.17.21",
55
55
  "luxon": "^2.0.2",
56
56
  "minimatch": "^3.0.3",
@@ -73,7 +73,7 @@
73
73
  "yn": "^4.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@backstage/cli": "^0.13.1",
76
+ "@backstage/cli": "^0.13.2-next.0",
77
77
  "@backstage/test-utils": "^0.2.4",
78
78
  "@types/body-parser": "^1.19.0",
79
79
  "@types/cookie-parser": "^1.4.2",
@@ -94,5 +94,5 @@
94
94
  "config.d.ts"
95
95
  ],
96
96
  "configSchema": "config.d.ts",
97
- "gitHead": "f944a625c4a8ec7f6a6237502691da9209ce6b14"
97
+ "gitHead": "e6f167225d843beeb974c287c3364d951b587626"
98
98
  }