@backstage/plugin-auth-backend 0.12.1 → 0.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @backstage/plugin-auth-backend
2
2
 
3
+ ## 0.13.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 15d3a3c39a: **BREAKING**: All sign-in resolvers must now return a `token` in their sign-in result. Returning an `id` is no longer supported.
8
+
9
+ ### Patch Changes
10
+
11
+ - 2cc1d1b235: Applied the fix from version 0.12.3 of this package, which is part of the v1.0.1 release of Backstage.
12
+ - 6ee04078e1: **DEPRECATION**: The `tokenIssuer` option for `OAuthAdapter` is no longer needed and has been deprecated.
13
+ - Updated dependencies
14
+ - @backstage/catalog-model@1.0.1-next.0
15
+ - @backstage/plugin-auth-node@0.2.0-next.0
16
+ - @backstage/backend-common@0.13.2-next.0
17
+ - @backstage/catalog-client@1.0.1-next.0
18
+
19
+ ## 0.12.3
20
+
21
+ ### Patch Changes
22
+
23
+ - Fix migrations to do the right thing on sqlite databases, and reapply the column type fix for those who are _not_ on sqlite databases.
24
+
25
+ Reconstruction of #10317 in the form of a patch release instead.
26
+
27
+ ## 0.12.2
28
+
29
+ ### Patch Changes
30
+
31
+ - efc73db10c: Use `better-sqlite3` instead of `@vscode/sqlite3`
32
+ - Updated dependencies
33
+ - @backstage/backend-common@0.13.1
34
+ - @backstage/catalog-model@1.0.0
35
+ - @backstage/catalog-client@1.0.0
36
+ - @backstage/config@1.0.0
37
+ - @backstage/errors@1.0.0
38
+ - @backstage/types@1.0.0
39
+ - @backstage/plugin-auth-node@0.1.6
40
+
3
41
  ## 0.12.1
4
42
 
5
43
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -10,8 +10,8 @@ var errors = require('@backstage/errors');
10
10
  var pickBy = require('lodash/pickBy');
11
11
  var crypto = require('crypto');
12
12
  var url = require('url');
13
- var catalogModel = require('@backstage/catalog-model');
14
13
  var jwtDecoder = require('jwt-decode');
14
+ var catalogModel = require('@backstage/catalog-model');
15
15
  var fetch = require('node-fetch');
16
16
  var NodeCache = require('node-cache');
17
17
  var jose = require('jose');
@@ -255,18 +255,11 @@ function parseJwtPayload(token) {
255
255
  }
256
256
  function prepareBackstageIdentityResponse(result) {
257
257
  const { sub, ent } = parseJwtPayload(result.token);
258
- const userEntityRef = catalogModel.stringifyEntityRef(catalogModel.parseEntityRef(sub, {
259
- defaultKind: "user",
260
- defaultNamespace: catalogModel.DEFAULT_NAMESPACE
261
- }));
262
258
  return {
263
- ...{
264
- idToken: result.token,
265
- ...result
266
- },
259
+ ...result,
267
260
  identity: {
268
261
  type: "user",
269
- userEntityRef,
262
+ userEntityRef: sub,
270
263
  ownershipEntityRefs: ent != null ? ent : []
271
264
  }
272
265
  };
@@ -429,17 +422,10 @@ class OAuthAdapter {
429
422
  if (!identity) {
430
423
  return void 0;
431
424
  }
432
- if (identity.token) {
433
- return prepareBackstageIdentityResponse(identity);
425
+ if (!identity.token) {
426
+ throw new errors.InputError(`Identity response must return a token`);
434
427
  }
435
- const userEntityRef = catalogModel.stringifyEntityRef(catalogModel.parseEntityRef(identity.id, {
436
- defaultKind: "user",
437
- defaultNamespace: catalogModel.DEFAULT_NAMESPACE
438
- }));
439
- const token = await this.options.tokenIssuer.issueToken({
440
- claims: { sub: userEntityRef }
441
- });
442
- return prepareBackstageIdentityResponse({ ...identity, token });
428
+ return prepareBackstageIdentityResponse(identity);
443
429
  }
444
430
  }
445
431