@canton-network/core-wallet-auth 0.7.0 → 0.9.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/README.md CHANGED
@@ -38,7 +38,7 @@ The `verifyToken` method takes an access token and returns an `AuthContext` if t
38
38
 
39
39
  ## JWT Implementation
40
40
 
41
- For JWT-based authentication, see the [`JwtAuthService`](../clients/remote/src/auth/JwtAuthService.ts) implementation.
41
+ For JWT-based authentication, see the [`JwtAuthService`](../wallet-gateway/remote/src/auth/JwtAuthService.ts) implementation.
42
42
  This service verifies JWT tokens using remote JWK sets and integrates with the Wallet Gateway's network configuration to dynamically resolve the appropriate identity provider for each request.
43
43
 
44
44
  It is important to note that, since the Wallet Gateway supports multiple identity providers (IDPs), the token issuer (iss) is used as the unique identifier for each IDP.
@@ -0,0 +1,3 @@
1
+ import { AuthContext } from './auth-service';
2
+ export declare function assertConnected(authContext: AuthContext | undefined): AuthContext;
3
+ //# sourceMappingURL=auth-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../src/auth-utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAG5C,wBAAgB,eAAe,CAC3B,WAAW,EAAE,WAAW,GAAG,SAAS,GACrC,WAAW,CAOb"}
@@ -0,0 +1,11 @@
1
+ // Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { providerErrors } from '@canton-network/core-rpc-errors';
4
+ export function assertConnected(authContext) {
5
+ if (!authContext) {
6
+ throw providerErrors.unauthorized({
7
+ message: 'User is not connected',
8
+ });
9
+ }
10
+ return authContext;
11
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './auth-service.js';
2
2
  export * from './client-credentials-service.js';
3
+ export * from './auth-utils.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -2,3 +2,4 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export * from './auth-service.js';
4
4
  export * from './client-credentials-service.js';
5
+ export * from './auth-utils.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/core-wallet-auth",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Provides authentication middleware and user management for the Wallet Gateway",
6
6
  "repository": "github:hyperledger-labs/splice-wallet-kernel",
@@ -12,6 +12,7 @@
12
12
  "scripts": {
13
13
  "build": "tsc -b",
14
14
  "dev": "tsc -b --watch",
15
+ "flatpack": "yarn pack --out \"$FLATPACK_OUTDIR\"",
15
16
  "clean": "tsc -b --clean; rm -rf dist",
16
17
  "test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
17
18
  },
@@ -26,7 +27,8 @@
26
27
  "typescript": "^5.8.3"
27
28
  },
28
29
  "dependencies": {
29
- "@canton-network/core-types": "^0.7.0"
30
+ "@canton-network/core-rpc-errors": "",
31
+ "@canton-network/core-types": ""
30
32
  },
31
33
  "files": [
32
34
  "dist/**"