gdc-sdk-node-ts 2.7.5 → 2.7.7
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.
|
@@ -20,6 +20,8 @@ export type NodeProfessionalIdentityVpInput = Readonly<{
|
|
|
20
20
|
sameAs?: string | readonly string[];
|
|
21
21
|
telephone?: string;
|
|
22
22
|
credentialMaterial?: string;
|
|
23
|
+
/** Server-authorized credentials appended after the professional identity VC. */
|
|
24
|
+
additionalCredentials?: ReadonlyArray<object>;
|
|
23
25
|
}>;
|
|
24
26
|
export type NodeCommunicationWalletInitialization = {
|
|
25
27
|
/**
|
|
@@ -4,7 +4,7 @@ import { CryptographyService } from 'gdc-common-utils-ts/CryptographyService';
|
|
|
4
4
|
import { Content } from 'gdc-common-utils-ts/utils/content';
|
|
5
5
|
import { createJwtSigner } from 'gdc-common-utils-ts/utils/jwt-signer';
|
|
6
6
|
import { buildJwtCompact, prepareJwtForSignature } from 'gdc-common-utils-ts/utils/jwt';
|
|
7
|
-
import { buildProfessionalIdentityVpPayload } from 'gdc-common-utils-ts/utils/professional-smart';
|
|
7
|
+
import { buildProfessionalIdentityVpPayload, getProfessionalIdentityVC, } from 'gdc-common-utils-ts/utils/professional-smart';
|
|
8
8
|
import { NodeCryptoHelper } from './node-crypto-helper.js';
|
|
9
9
|
const DEFAULT_POLICY = {
|
|
10
10
|
defaults: {
|
|
@@ -359,6 +359,19 @@ export class NodeManagedWallet {
|
|
|
359
359
|
...(input.sameAs ? { sameAs: input.sameAs } : {}),
|
|
360
360
|
...(input.telephone ? { telephone: input.telephone } : {}),
|
|
361
361
|
...(input.credentialMaterial ? { credentialMaterial: input.credentialMaterial } : {}),
|
|
362
|
+
...(input.additionalCredentials?.length ? {
|
|
363
|
+
verifiableCredential: [
|
|
364
|
+
getProfessionalIdentityVC({
|
|
365
|
+
actorDid: input.actorDid,
|
|
366
|
+
role: input.role,
|
|
367
|
+
...(input.email ? { email: input.email } : {}),
|
|
368
|
+
...(input.sameAs ? { sameAs: input.sameAs } : {}),
|
|
369
|
+
...(input.telephone ? { telephone: input.telephone } : {}),
|
|
370
|
+
...(input.credentialMaterial ? { credentialMaterial: input.credentialMaterial } : {}),
|
|
371
|
+
}),
|
|
372
|
+
...input.additionalCredentials.map(credential => credential),
|
|
373
|
+
],
|
|
374
|
+
} : {}),
|
|
362
375
|
});
|
|
363
376
|
return this.signCompactJws(context, {
|
|
364
377
|
header: { typ: 'JWT', jwk: vpSigningKey.publicJwk },
|
|
@@ -281,6 +281,13 @@ export type ServerProfessionalOpenInput = Readonly<{
|
|
|
281
281
|
pin?: string;
|
|
282
282
|
/** Server-only seed already authorized by a product passkey/session policy. */
|
|
283
283
|
authorizedWalletSeed?: string;
|
|
284
|
+
/** Provider tenant selected by a server-authorized inter-tenant workflow. */
|
|
285
|
+
target?: Readonly<{
|
|
286
|
+
providerDid: string;
|
|
287
|
+
routeContext: RouteContext;
|
|
288
|
+
}>;
|
|
289
|
+
/** Verified access credentials appended to the managed professional VP. */
|
|
290
|
+
accessCredentials?: ReadonlyArray<object>;
|
|
284
291
|
}>;
|
|
285
292
|
/** Business authorization requested from SMART; OpenID/JWT fields stay SDK-owned. */
|
|
286
293
|
export type ServerProfessionalSmartTokenInput = Readonly<{
|
|
@@ -329,6 +336,14 @@ export type ServerProfileSessionManagerOptions = Readonly<{
|
|
|
329
336
|
export declare class ServerProfileSessionManager {
|
|
330
337
|
private readonly options;
|
|
331
338
|
constructor(options: ServerProfileSessionManagerOptions);
|
|
339
|
+
/**
|
|
340
|
+
* Resolves the canonical IPS author/attester projection from one owned
|
|
341
|
+
* profile without exposing its protected wallet material to the portal.
|
|
342
|
+
*/
|
|
343
|
+
exportClinicalCreatorIps(input: Readonly<{
|
|
344
|
+
ownerId: string;
|
|
345
|
+
profileId: string;
|
|
346
|
+
}>): Promise<ClinicalCreatorIpsExport>;
|
|
332
347
|
enroll(input: ServerProfileEnrollmentInput): Promise<ServerProfileRecord>;
|
|
333
348
|
/**
|
|
334
349
|
* Rotates an employee wallet after a fresh OTP-authenticated GW recovery.
|
|
@@ -25,6 +25,13 @@ export class ServerProfileSessionManager {
|
|
|
25
25
|
constructor(options) {
|
|
26
26
|
this.options = options;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolves the canonical IPS author/attester projection from one owned
|
|
30
|
+
* profile without exposing its protected wallet material to the portal.
|
|
31
|
+
*/
|
|
32
|
+
async exportClinicalCreatorIps(input) {
|
|
33
|
+
return exportServerProfileClinicalCreatorIps(await this.requireOwnedProfile(input.ownerId, input.profileId));
|
|
34
|
+
}
|
|
28
35
|
async enroll(input) {
|
|
29
36
|
requireEnrollment(input);
|
|
30
37
|
const seed = input.walletSeed || randomBytes(32).toString('base64url');
|
|
@@ -582,13 +589,17 @@ export class ServerProfileSessionManager {
|
|
|
582
589
|
const wallet = await this.createWallet(walletKeyDerivationId, seed);
|
|
583
590
|
const context = walletContext(walletKeyDerivationId);
|
|
584
591
|
await requireRegisteredProfileKeys(wallet, context, profile);
|
|
592
|
+
const targetProviderDid = String(input.target?.providerDid || profile.providerDid).trim();
|
|
593
|
+
const targetRouteContext = input.target?.routeContext || profile.routeContext;
|
|
594
|
+
if (!targetProviderDid)
|
|
595
|
+
throw new Error('Opening a professional requires a target provider DID.');
|
|
585
596
|
const secureTransportAdapter = {
|
|
586
|
-
pack: (message) => wallet.packForRecipientWithContext(bindOrganizationControllerTransport(message, profile
|
|
597
|
+
pack: (message) => wallet.packForRecipientWithContext(bindOrganizationControllerTransport(message, { ...profile, providerDid: targetProviderDid }), targetProviderDid, { context }),
|
|
587
598
|
unpack: async (jwe) => (await wallet.unpackWithContext(jwe, { context })).content,
|
|
588
599
|
};
|
|
589
600
|
const operationalClient = new NodeHttpClient({
|
|
590
601
|
baseUrl: this.options.gatewayBaseUrl,
|
|
591
|
-
ctx:
|
|
602
|
+
ctx: targetRouteContext,
|
|
592
603
|
bearerToken: idToken,
|
|
593
604
|
fetchImpl: this.options.fetchImpl,
|
|
594
605
|
appInfo: this.options.appInfo,
|
|
@@ -608,7 +619,7 @@ export class ServerProfileSessionManager {
|
|
|
608
619
|
const now = this.now();
|
|
609
620
|
const audience = [
|
|
610
621
|
this.options.gatewayBaseUrl.replace(/\/+$/, ''),
|
|
611
|
-
buildIdentityOpenIdSmartTokenPath(
|
|
622
|
+
buildIdentityOpenIdSmartTokenPath(targetRouteContext),
|
|
612
623
|
].join('');
|
|
613
624
|
const clientAssertion = await buildWalletClientAssertion(wallet, profile, audience, now);
|
|
614
625
|
const vpToken = await buildManagedProfessionalVp(wallet, context, {
|
|
@@ -617,9 +628,10 @@ export class ServerProfileSessionManager {
|
|
|
617
628
|
profileDid: profile.profileDid,
|
|
618
629
|
...input.professionalProof,
|
|
619
630
|
role,
|
|
631
|
+
additionalCredentials: input.accessCredentials,
|
|
620
632
|
});
|
|
621
633
|
return smartSdk.requestSmartToken({
|
|
622
|
-
...
|
|
634
|
+
...targetRouteContext,
|
|
623
635
|
actorDid: profile.actorDid,
|
|
624
636
|
subjectDid: String(smart.subjectDid || '').trim() || undefined,
|
|
625
637
|
clientId: profile.clientId,
|
|
@@ -654,7 +666,7 @@ export class ServerProfileSessionManager {
|
|
|
654
666
|
searchDigitalTwins: (search) => {
|
|
655
667
|
if (!digitalTwinAccessToken)
|
|
656
668
|
throw new Error('Digital twin SMART token has not been granted.');
|
|
657
|
-
return digitalTwin.search(
|
|
669
|
+
return digitalTwin.search(targetRouteContext, { ...search, accessToken: digitalTwinAccessToken });
|
|
658
670
|
},
|
|
659
671
|
};
|
|
660
672
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdc-sdk-node-ts",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.7",
|
|
4
4
|
"description": "Next-generation Node runtime package for the GDC SDK family",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Antifraud Services Inc.",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"test:e2e:live-gw:clean": "bash ./scripts/run-live-gw-clean.sh"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"gdc-common-utils-ts": "2.8.
|
|
42
|
-
"gdc-sdk-core-ts": "2.5.
|
|
41
|
+
"gdc-common-utils-ts": "2.8.6",
|
|
42
|
+
"gdc-sdk-core-ts": "2.5.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^20.14.10",
|