@undefineds.co/xpod 0.4.34 → 0.4.36

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.
@@ -64,6 +64,7 @@ export declare class ValidatingIdentityProviderHttpHandler extends OperationHttp
64
64
  private readonly hostClientIds;
65
65
  constructor(args: ValidatingIdentityProviderHttpHandlerArgs);
66
66
  handle({ operation, request, response }: OperationHttpHandlerInput): Promise<ResponseDescription>;
67
+ private rejectInvalidInteraction;
67
68
  private findAccountCookies;
68
69
  private findAuthorizationAccountCookie;
69
70
  private findBrowserAccountCookie;
@@ -34,20 +34,22 @@ class ValidatingIdentityProviderHttpHandler extends community_server_1.Operation
34
34
  throw new community_server_1.BadRequestHttpError('Invalid OIDC interaction');
35
35
  }
36
36
  let oidcInteraction;
37
+ let issuer;
37
38
  try {
38
39
  const provider = await this.providerFactory.getProvider();
40
+ issuer = provider.issuer;
39
41
  oidcInteraction = await provider.interactionDetails(request, response);
40
42
  this.logger.debug('Found an active OIDC interaction.');
41
43
  }
42
44
  catch (error) {
43
45
  if (scoped) {
44
- throw new community_server_1.BadRequestHttpError('Invalid OIDC interaction');
46
+ this.rejectInvalidInteraction(operation, issuer);
45
47
  }
46
48
  this.logger.debug(`No active OIDC interaction found: ${(0, community_server_1.createErrorMessage)(error)}`);
47
49
  }
48
50
  if (scoped) {
49
51
  if (oidcInteraction?.uid !== scoped[2]) {
50
- throw new community_server_1.BadRequestHttpError('Invalid OIDC interaction');
52
+ this.rejectInvalidInteraction(operation, issuer);
51
53
  }
52
54
  // Reuse CSS Account routing after the provider has checked the cookie,
53
55
  // interaction lifetime and session principal. Keep the raw request URL.
@@ -74,6 +76,24 @@ class ValidatingIdentityProviderHttpHandler extends community_server_1.Operation
74
76
  }
75
77
  return new community_server_1.OkResponseDescription(representation.metadata, representation.data);
76
78
  }
79
+ rejectInvalidInteraction(operation, issuer) {
80
+ // Match CSS HTML views: a fetch with no Accept header, a wildcard, or a
81
+ // JSON/HTML tie remains an API request and must still fail closed.
82
+ const preferences = (0, community_server_1.cleanPreferences)(operation.preferences.type);
83
+ if (issuer && operation.method === 'GET'
84
+ && (0, community_server_1.getTypeWeight)(community_server_1.TEXT_HTML, preferences) > (0, community_server_1.getTypeWeight)(community_server_1.APPLICATION_JSON, preferences)) {
85
+ // The provider's configured issuer is authoritative. Neither the expired
86
+ // UID, request Host, returnTo nor a callback query determines this exit.
87
+ const accountIndex = new URL(issuer);
88
+ if (['http:', 'https:'].includes(accountIndex.protocol) && !accountIndex.username && !accountIndex.password) {
89
+ accountIndex.pathname = `${accountIndex.pathname.replace(/\/?$/u, '/')}.account/`;
90
+ accountIndex.search = '';
91
+ accountIndex.hash = '';
92
+ throw new community_server_1.RedirectHttpError(303, 'SeeOtherHttpError', accountIndex.href, 'The authorization request has expired. Return to your application to start a new login.');
93
+ }
94
+ }
95
+ throw new community_server_1.BadRequestHttpError('Invalid OIDC interaction');
96
+ }
77
97
  findAccountCookies(operation, authorizationCookie, browserCookie) {
78
98
  const metadataCookies = operation.body.metadata
79
99
  .getAll(community_server_1.SOLID_HTTP.terms.accountCookie)
@@ -121,6 +121,10 @@
121
121
  "@id": "undefineds:dist/identity/ValidatingIdentityProviderHttpHandler.jsonld#ValidatingIdentityProviderHttpHandler__member_handle",
122
122
  "memberFieldName": "handle"
123
123
  },
124
+ {
125
+ "@id": "undefineds:dist/identity/ValidatingIdentityProviderHttpHandler.jsonld#ValidatingIdentityProviderHttpHandler__member_rejectInvalidInteraction",
126
+ "memberFieldName": "rejectInvalidInteraction"
127
+ },
124
128
  {
125
129
  "@id": "undefineds:dist/identity/ValidatingIdentityProviderHttpHandler.jsonld#ValidatingIdentityProviderHttpHandler__member_findAccountCookies",
126
130
  "memberFieldName": "findAccountCookies"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "build-provenance.json",
14
14
  "bytes": 1727,
15
- "sha256": "c5dc8b39510cdb7532e69049384414679783ec075525227383a39b199ae76652"
15
+ "sha256": "89d96ef7314908e82b19a24de47585d6093835c5d97c311debcff48b9776b70f"
16
16
  },
17
17
  {
18
18
  "path": "generated/provider-catalog/index.json",
@@ -322,7 +322,7 @@
322
322
  {
323
323
  "path": "source-inventory.json",
324
324
  "bytes": 4713,
325
- "sha256": "cd34d7ed0c52ec52de04129be5e390eada5cb5bf3bacba78e804b96c3eb1e06a"
325
+ "sha256": "f5f52dce0f3e1658d18f7a569b909f08dc11a550ccbb91a80ad76d4f46ec1616"
326
326
  }
327
327
  ]
328
328
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "ae0a4e3f57abd69441e473bce58221eba61e0c1cdab02a1352cd8651687ef6d7",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "path": "build-provenance.json",
14
14
  "bytes": 398,
15
- "sha256": "975c0ea75bac328e15e68de1d0d23bb84e839d7b4e52e159adf18220a261b74f"
15
+ "sha256": "4d19eb336f5f1dae98ced175cdae5a5c351f0c9a67a346e58285cede222432af"
16
16
  },
17
17
  {
18
18
  "path": "source/LICENSE",
@@ -52,7 +52,7 @@
52
52
  {
53
53
  "path": "source-inventory.json",
54
54
  "bytes": 1585,
55
- "sha256": "f0874dc2094e5e9dabbff84e43f5d360ad8f80d2e4175daed3e452778d9a0138"
55
+ "sha256": "a5e85f1f7a0ef235b020bb31f7b662e893dc0179324f2f9b2a1fc8c5743555d9"
56
56
  }
57
57
  ]
58
58
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "sourceAuthority": {
4
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
4
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
5
5
  "tracked": true,
6
6
  "dirty": false,
7
7
  "snapshotSHA256": "c3b65827fdfc0e13c743cd5129b9db7626ec2419e12b06d8478d97fc859e851a",
@@ -5,7 +5,7 @@
5
5
  "version": "0.1.0-preview.2",
6
6
  "bunVersion": "1.4.2"
7
7
  },
8
- "indexSHA256": "413035e811b257cb82a0f86d46c50320010f00f114ebed7c611ea6909640ef07",
8
+ "indexSHA256": "7b983a2f641c4d0c0f4b2e3d8f12cfb53a2487a9d2e176eab142d240ca961a24",
9
9
  "outputPayloads": {
10
10
  "esmSHA256": "7f610395a47a79acd1bb2181a71a16e887272fa4e5522fa095db78625f3c8eb0"
11
11
  }
@@ -159,7 +159,7 @@
159
159
  }
160
160
  ],
161
161
  "sourceAuthority": {
162
- "sourceCommit": "1147fecfec4aea4b75cacbe779713f09e92dafac",
162
+ "sourceCommit": "4f076bfb4a34791e624b7a2f45a1738ae2e82ca0",
163
163
  "dirty": false,
164
164
  "snapshotSHA256": "a198c5f28999d0c763c3bb5d166823a5a5eb0eff8e7e4557b7b8d299200198a9",
165
165
  "scope": "CLI source plus explicitly mapped canonical host and runtime-client source; no claim of release acceptance or external dependency closure."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/xpod",
3
- "version": "0.4.34",
3
+ "version": "0.4.36",
4
4
  "description": "Xpod is an extended Community Solid Server, offering rich-feature, production-level Solid Pod and identity management.",
5
5
  "repository": "https://github.com/undefinedsco/xpod",
6
6
  "author": "developer@undefineds.co",
@@ -388,7 +388,7 @@
388
388
  }
389
389
  },
390
390
  "optionalDependencies": {
391
- "@undefineds.co/xpod-darwin-arm64": "0.4.34",
391
+ "@undefineds.co/xpod-darwin-arm64": "0.4.36",
392
392
  "@undefineds.co/drizzle-solid": "0.3.26",
393
393
  "@undefineds.co/extensions": "0.1.0",
394
394
  "@undefineds.co/ai-connections": "0.1.7",