@backstage/plugin-auth-backend 0.8.0 → 0.9.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
@@ -2,7 +2,7 @@
2
2
  import express from 'express';
3
3
  import { Logger } from 'winston';
4
4
  import { Config } from '@backstage/config';
5
- import { PluginEndpointDiscovery, PluginDatabaseManager } from '@backstage/backend-common';
5
+ import { TokenManager, PluginEndpointDiscovery, PluginDatabaseManager } from '@backstage/backend-common';
6
6
  import { CatalogApi } from '@backstage/catalog-client';
7
7
  import { UserEntity, Entity } from '@backstage/catalog-model';
8
8
  import { Profile } from 'passport';
@@ -144,6 +144,39 @@ interface OAuthHandlers {
144
144
  logout?(): Promise<void>;
145
145
  }
146
146
 
147
+ declare type UserQuery = {
148
+ annotations: Record<string, string>;
149
+ };
150
+ declare type MemberClaimQuery = {
151
+ entityRefs: string[];
152
+ logger?: Logger;
153
+ };
154
+ /**
155
+ * A catalog client tailored for reading out identity data from the catalog.
156
+ */
157
+ declare class CatalogIdentityClient {
158
+ private readonly catalogApi;
159
+ private readonly tokenManager;
160
+ constructor(options: {
161
+ catalogApi: CatalogApi;
162
+ tokenManager: TokenManager;
163
+ });
164
+ /**
165
+ * Looks up a single user using a query.
166
+ *
167
+ * Throws a NotFoundError or ConflictError if 0 or multiple users are found.
168
+ */
169
+ findUser(query: UserQuery): Promise<UserEntity>;
170
+ /**
171
+ * Resolve additional entity claims from the catalog, using the passed-in entity names. Designed
172
+ * to be used within a `signInResolver` where additional entity claims might be provided, but
173
+ * group membership and transient group membership lean on imported catalog relations.
174
+ *
175
+ * Returns a superset of the entity names that can be passed directly to `issueToken` as `ent`.
176
+ */
177
+ resolveCatalogMembership(query: MemberClaimQuery): Promise<string[]>;
178
+ }
179
+
147
180
  /**
148
181
  * A identity client to interact with auth-backend
149
182
  * and authenticate backstage identity tokens
@@ -187,39 +220,6 @@ declare class IdentityClient {
187
220
  private refreshKeyStore;
188
221
  }
189
222
 
190
- declare type UserQuery = {
191
- annotations: Record<string, string>;
192
- };
193
- declare type MemberClaimQuery = {
194
- entityRefs: string[];
195
- logger?: Logger;
196
- };
197
- /**
198
- * A catalog client tailored for reading out identity data from the catalog.
199
- */
200
- declare class CatalogIdentityClient {
201
- private readonly catalogApi;
202
- private readonly tokenIssuer;
203
- constructor(options: {
204
- catalogApi: CatalogApi;
205
- tokenIssuer: TokenIssuer;
206
- });
207
- /**
208
- * Looks up a single user using a query.
209
- *
210
- * Throws a NotFoundError or ConflictError if 0 or multiple users are found.
211
- */
212
- findUser(query: UserQuery): Promise<UserEntity>;
213
- /**
214
- * Resolve additional entity claims from the catalog, using the passed-in entity names. Designed
215
- * to be used within a `signInResolver` where additional entity claims might be provided, but
216
- * group membership and transient group membership lean on imported catalog relations.
217
- *
218
- * Returns a superset of the entity names that can be passed directly to `issueToken` as `ent`.
219
- */
220
- resolveCatalogMembership(query: MemberClaimQuery): Promise<string[]>;
221
- }
222
-
223
223
  declare function getEntityClaims(entity: UserEntity): TokenParams['claims'];
224
224
 
225
225
  /**
@@ -313,6 +313,7 @@ declare type AuthProviderFactoryOptions = {
313
313
  globalConfig: AuthProviderConfig;
314
314
  config: Config;
315
315
  logger: Logger;
316
+ tokenManager: TokenManager;
316
317
  tokenIssuer: TokenIssuer;
317
318
  discovery: PluginEndpointDiscovery;
318
319
  catalogApi: CatalogApi;
@@ -975,6 +976,7 @@ interface RouterOptions {
975
976
  database: PluginDatabaseManager;
976
977
  config: Config;
977
978
  discovery: PluginEndpointDiscovery;
979
+ tokenManager: TokenManager;
978
980
  providerFactories?: ProviderFactories;
979
981
  }
980
982
  declare function createRouter(options: RouterOptions): Promise<express.Router>;
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.8.0",
4
+ "version": "0.9.0-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -58,7 +58,7 @@
58
58
  "node-cache": "^5.1.2",
59
59
  "node-fetch": "^2.6.1",
60
60
  "openid-client": "^4.2.1",
61
- "passport": "^0.4.1",
61
+ "passport": "^0.5.2",
62
62
  "passport-bitbucket-oauth2": "^0.1.2",
63
63
  "passport-github2": "^0.1.12",
64
64
  "passport-gitlab2": "^5.0.0",
@@ -73,7 +73,7 @@
73
73
  "yn": "^4.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@backstage/cli": "^0.13.0",
76
+ "@backstage/cli": "^0.13.1-next.0",
77
77
  "@backstage/test-utils": "^0.2.3",
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": "493394603a2c47ea1d141159af9bc7bb84fac9e5"
97
+ "gitHead": "a28838ac5c80c7332caa6ca0569d2ec85151784f"
98
98
  }