@vess-id/ai-identity 0.0.0-dev-20260902121045
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 +265 -0
- package/dist/agent/agent-did-manager.d.ts +97 -0
- package/dist/agent/agent-did-manager.d.ts.map +1 -0
- package/dist/auth/auth-provider.d.ts +51 -0
- package/dist/auth/auth-provider.d.ts.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/client.d.ts +63 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/config/index.d.ts +84 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/constraint/constraint-evaluator.d.ts +103 -0
- package/dist/constraint/constraint-evaluator.d.ts.map +1 -0
- package/dist/constraint/index.d.ts +5 -0
- package/dist/constraint/index.d.ts.map +1 -0
- package/dist/did/agent.d.ts +58 -0
- package/dist/did/agent.d.ts.map +1 -0
- package/dist/did/did-utils.d.ts +82 -0
- package/dist/did/did-utils.d.ts.map +1 -0
- package/dist/did/key-manager.d.ts +19 -0
- package/dist/did/key-manager.d.ts.map +1 -0
- package/dist/gateway/gateway-client.d.ts +103 -0
- package/dist/gateway/gateway-client.d.ts.map +1 -0
- package/dist/gateway/index.d.ts +2 -0
- package/dist/gateway/index.d.ts.map +1 -0
- package/dist/grant/grant-manager.d.ts +140 -0
- package/dist/grant/grant-manager.d.ts.map +1 -0
- package/dist/grant/index.d.ts +2 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/identity/device-enroll-manager.d.ts +117 -0
- package/dist/identity/device-enroll-manager.d.ts.map +1 -0
- package/dist/identity/user-identity-manager.d.ts +123 -0
- package/dist/identity/user-identity-manager.d.ts.map +1 -0
- package/dist/identity/user-key-pair-manager.d.ts +22 -0
- package/dist/identity/user-key-pair-manager.d.ts.map +1 -0
- package/dist/index.d.mts +42685 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19534 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +19347 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internal-signature/canonical.d.ts +80 -0
- package/dist/internal-signature/canonical.d.ts.map +1 -0
- package/dist/internal-signature/index.d.ts +17 -0
- package/dist/internal-signature/index.d.ts.map +1 -0
- package/dist/internal-signature/signer.d.ts +76 -0
- package/dist/internal-signature/signer.d.ts.map +1 -0
- package/dist/policy/cedar-engine.d.ts +334 -0
- package/dist/policy/cedar-engine.d.ts.map +1 -0
- package/dist/policy/cedar-entities.d.ts +59 -0
- package/dist/policy/cedar-entities.d.ts.map +1 -0
- package/dist/policy/decision.d.ts +46 -0
- package/dist/policy/decision.d.ts.map +1 -0
- package/dist/policy/index.d.ts +15 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/registry/access-orchestrator.d.ts +184 -0
- package/dist/registry/access-orchestrator.d.ts.map +1 -0
- package/dist/registry/action-aliases.d.ts +37 -0
- package/dist/registry/action-aliases.d.ts.map +1 -0
- package/dist/registry/action-input-validator.d.ts +19 -0
- package/dist/registry/action-input-validator.d.ts.map +1 -0
- package/dist/registry/action-normalizer.d.ts +47 -0
- package/dist/registry/action-normalizer.d.ts.map +1 -0
- package/dist/registry/action-registry-json.d.ts +35897 -0
- package/dist/registry/action-registry-json.d.ts.map +1 -0
- package/dist/registry/action-registry.d.ts +101 -0
- package/dist/registry/action-registry.d.ts.map +1 -0
- package/dist/registry/action-risk.d.ts +109 -0
- package/dist/registry/action-risk.d.ts.map +1 -0
- package/dist/registry/action-summary.d.ts +16 -0
- package/dist/registry/action-summary.d.ts.map +1 -0
- package/dist/registry/index.d.ts +14 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/providers.d.ts +32 -0
- package/dist/registry/providers.d.ts.map +1 -0
- package/dist/registry/reauth-constants.d.ts +56 -0
- package/dist/registry/reauth-constants.d.ts.map +1 -0
- package/dist/registry/resource-type-labels.d.ts +15 -0
- package/dist/registry/resource-type-labels.d.ts.map +1 -0
- package/dist/registry/resource-types.d.ts +47 -0
- package/dist/registry/resource-types.d.ts.map +1 -0
- package/dist/resolver/approval-time-resolution.d.ts +72 -0
- package/dist/resolver/approval-time-resolution.d.ts.map +1 -0
- package/dist/resolver/canonical-resource-id.d.ts +37 -0
- package/dist/resolver/canonical-resource-id.d.ts.map +1 -0
- package/dist/resolver/compare-resource-id.d.ts +37 -0
- package/dist/resolver/compare-resource-id.d.ts.map +1 -0
- package/dist/resolver/salient-digest.d.ts +48 -0
- package/dist/resolver/salient-digest.d.ts.map +1 -0
- package/dist/resolver/target-resolver.d.ts +28 -0
- package/dist/resolver/target-resolver.d.ts.map +1 -0
- package/dist/state/index.d.ts +3 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/json-state-store.d.ts +24 -0
- package/dist/state/json-state-store.d.ts.map +1 -0
- package/dist/state/state-store.interface.d.ts +37 -0
- package/dist/state/state-store.interface.d.ts.map +1 -0
- package/dist/storage/filesystem-key-storage.d.ts +16 -0
- package/dist/storage/filesystem-key-storage.d.ts.map +1 -0
- package/dist/storage/index.d.ts +4 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/key-storage.interface.d.ts +42 -0
- package/dist/storage/key-storage.interface.d.ts.map +1 -0
- package/dist/storage/memory-key-storage.d.ts +17 -0
- package/dist/storage/memory-key-storage.d.ts.map +1 -0
- package/dist/tool/tool-manager.d.ts +44 -0
- package/dist/tool/tool-manager.d.ts.map +1 -0
- package/dist/types/agent.d.ts +139 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/audit.d.ts +23 -0
- package/dist/types/audit.d.ts.map +1 -0
- package/dist/types/cedar-policy.d.ts +60 -0
- package/dist/types/cedar-policy.d.ts.map +1 -0
- package/dist/types/connector-plugin.d.ts +252 -0
- package/dist/types/connector-plugin.d.ts.map +1 -0
- package/dist/types/connectors.d.ts +39 -0
- package/dist/types/connectors.d.ts.map +1 -0
- package/dist/types/context.d.ts +152 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/did.d.ts +18 -0
- package/dist/types/did.d.ts.map +1 -0
- package/dist/types/errors.d.ts +24 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/grant.d.ts +522 -0
- package/dist/types/grant.d.ts.map +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/intent.d.ts +133 -0
- package/dist/types/intent.d.ts.map +1 -0
- package/dist/types/invitation.d.ts +97 -0
- package/dist/types/invitation.d.ts.map +1 -0
- package/dist/types/jira.d.ts +348 -0
- package/dist/types/jira.d.ts.map +1 -0
- package/dist/types/oauth.d.ts +72 -0
- package/dist/types/oauth.d.ts.map +1 -0
- package/dist/types/organization.d.ts +77 -0
- package/dist/types/organization.d.ts.map +1 -0
- package/dist/types/permission-mode.d.ts +138 -0
- package/dist/types/permission-mode.d.ts.map +1 -0
- package/dist/types/permission-vc.d.ts +800 -0
- package/dist/types/permission-vc.d.ts.map +1 -0
- package/dist/types/receipt.d.ts +133 -0
- package/dist/types/receipt.d.ts.map +1 -0
- package/dist/types/target-binding.d.ts +163 -0
- package/dist/types/target-binding.d.ts.map +1 -0
- package/dist/types/tier.d.ts +13 -0
- package/dist/types/tier.d.ts.map +1 -0
- package/dist/types/vc.d.ts +213 -0
- package/dist/types/vc.d.ts.map +1 -0
- package/dist/types/vp.d.ts +25 -0
- package/dist/types/vp.d.ts.map +1 -0
- package/dist/utils/action-classifier.d.ts +13 -0
- package/dist/utils/action-classifier.d.ts.map +1 -0
- package/dist/utils/crypto.d.ts +22 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/freemail-domains.d.ts +13 -0
- package/dist/utils/freemail-domains.d.ts.map +1 -0
- package/dist/utils/sdjwt-client.d.ts +415 -0
- package/dist/utils/sdjwt-client.d.ts.map +1 -0
- package/dist/utils/sdjwt-disclosure.d.ts +13 -0
- package/dist/utils/sdjwt-disclosure.d.ts.map +1 -0
- package/dist/utils/tier-utils.d.ts +15 -0
- package/dist/utils/tier-utils.d.ts.map +1 -0
- package/dist/vc/api-vc-manager.d.ts +43 -0
- package/dist/vc/api-vc-manager.d.ts.map +1 -0
- package/dist/vc/vc-manager.d.ts +55 -0
- package/dist/vc/vc-manager.d.ts.map +1 -0
- package/dist/vp/kb-jwt-builder.d.ts +89 -0
- package/dist/vp/kb-jwt-builder.d.ts.map +1 -0
- package/dist/vp/vp-manager.d.ts +75 -0
- package/dist/vp/vp-manager.d.ts.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConstraintEvaluator
|
|
3
|
+
* Grant制約の評価ロジック
|
|
4
|
+
*/
|
|
5
|
+
import { GrantConstraints, TimeWindowConstraint, EvaluationContext, ConstraintEvaluationResult, ConstraintViolation, ConstraintWarning, PermissionConstraints, PermissionTimeConstraint } from '../types';
|
|
6
|
+
export interface ConstraintEvaluatorOptions {
|
|
7
|
+
/** 警告を発する残り実行回数の閾値 */
|
|
8
|
+
invocationWarningThreshold?: number;
|
|
9
|
+
/** 警告を発するリスクスコアの閾値(riskThresholdに対する割合) */
|
|
10
|
+
riskWarningRatio?: number;
|
|
11
|
+
/** デフォルトタイムゾーン */
|
|
12
|
+
defaultTimezone?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 制約評価クラス
|
|
16
|
+
*/
|
|
17
|
+
export declare class ConstraintEvaluator {
|
|
18
|
+
private options;
|
|
19
|
+
constructor(options?: Partial<ConstraintEvaluatorOptions>);
|
|
20
|
+
/**
|
|
21
|
+
* 制約を総合評価
|
|
22
|
+
*/
|
|
23
|
+
evaluate(constraints: GrantConstraints, context: EvaluationContext, currentInvocations: number, expiresAt?: Date): ConstraintEvaluationResult;
|
|
24
|
+
/**
|
|
25
|
+
* 期限チェック
|
|
26
|
+
*/
|
|
27
|
+
checkExpiration(grantExpiresAt?: Date, constraintExpiresAt?: string): {
|
|
28
|
+
violation?: ConstraintViolation;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 実行回数チェック
|
|
32
|
+
*/
|
|
33
|
+
checkInvocationLimit(maxInvocations?: number, currentInvocations?: number): {
|
|
34
|
+
violation?: ConstraintViolation;
|
|
35
|
+
warning?: ConstraintWarning;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 時間帯チェック
|
|
39
|
+
*/
|
|
40
|
+
checkTimeWindow(timeWindow: TimeWindowConstraint, currentTime: Date): {
|
|
41
|
+
violation?: ConstraintViolation;
|
|
42
|
+
warning?: ConstraintWarning;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* IPアドレスチェック
|
|
46
|
+
*/
|
|
47
|
+
checkIpAllowlist(allowlist: string[], ipAddress: string): {
|
|
48
|
+
violation?: ConstraintViolation;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* リスクスコアチェック
|
|
52
|
+
*/
|
|
53
|
+
checkRiskThreshold(threshold: number, currentScore: number): {
|
|
54
|
+
violation?: ConstraintViolation;
|
|
55
|
+
warning?: ConstraintWarning;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Evaluate PermissionConstraints from a PermissionRule.
|
|
59
|
+
*
|
|
60
|
+
* This is the VC-level constraint evaluator that works with the
|
|
61
|
+
* normalized PermissionConstraints format (as opposed to GrantConstraints).
|
|
62
|
+
*
|
|
63
|
+
* Used by the PolicyEvaluator after rule matching to verify
|
|
64
|
+
* rule-level constraints are satisfied.
|
|
65
|
+
*/
|
|
66
|
+
evaluatePermissionConstraints(constraints: PermissionConstraints, context: {
|
|
67
|
+
now: number;
|
|
68
|
+
ipAddress?: string;
|
|
69
|
+
riskScore?: number;
|
|
70
|
+
invocationCount?: number;
|
|
71
|
+
}): {
|
|
72
|
+
allowed: boolean;
|
|
73
|
+
violations: ConstraintViolation[];
|
|
74
|
+
warnings: ConstraintWarning[];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Check PermissionTimeConstraint (supports both absolute and recurring)
|
|
78
|
+
*/
|
|
79
|
+
checkPermissionTimeConstraint(time: PermissionTimeConstraint, currentTime: Date): {
|
|
80
|
+
violation?: ConstraintViolation;
|
|
81
|
+
warning?: ConstraintWarning;
|
|
82
|
+
};
|
|
83
|
+
private getDayOfWeekInTimezone;
|
|
84
|
+
private getTimeInTimezone;
|
|
85
|
+
private getDayName;
|
|
86
|
+
private timeToMinutes;
|
|
87
|
+
/**
|
|
88
|
+
* Check if an IP address is within a CIDR range or matches exactly.
|
|
89
|
+
* Uses unsigned 32-bit arithmetic to avoid sign-bit issues.
|
|
90
|
+
* Public for reuse by other services (e.g., LocalPolicyEvaluatorService).
|
|
91
|
+
*/
|
|
92
|
+
isIpInCidr(ip: string, cidr: string): boolean;
|
|
93
|
+
private ipToNumber;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* デフォルトのConstraintEvaluatorインスタンス
|
|
97
|
+
*/
|
|
98
|
+
export declare const defaultConstraintEvaluator: ConstraintEvaluator;
|
|
99
|
+
/**
|
|
100
|
+
* 簡易評価関数
|
|
101
|
+
*/
|
|
102
|
+
export declare function evaluateConstraints(constraints: GrantConstraints, context: EvaluationContext, currentInvocations: number, expiresAt?: Date): ConstraintEvaluationResult;
|
|
103
|
+
//# sourceMappingURL=constraint-evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constraint-evaluator.d.ts","sourceRoot":"","sources":["../../src/constraint/constraint-evaluator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,0BAA0B;IACzC,sBAAsB;IACtB,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,2CAA2C;IAC3C,gBAAgB,CAAC,EA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CAAA;QACX,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,GACA;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,mBAAmB,EAAE,CAAC;QAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAA;KAAE;IA4CzF;;OAEG;IACH,6BAA6B,CAC3B,IAAI,EAAE,wBAAwB,EAC9B,WAAW,EAAE,IAAI,GAChB;QAAE,SAAS,CAAC,EAAE,mBAAmB,CAAC;QAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;KAAE;IAsDnE,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,aAAa;IAKrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO;IAoB7C,OAAO,CAAC,UAAU;CAWnB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,qBAA4B,CAAA;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,gBAAgB,EAC7B,OAAO,EAAE,iBAAiB,EAC1B,kBAAkB,EAAE,MAAM,EAC1B,SAAS,CAAC,EAAE,IAAI,GACf,0BAA0B,CAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constraint/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Agent, DIDDocument } from '../types';
|
|
2
|
+
import { KeyManager } from './key-manager';
|
|
3
|
+
import { AgentDIDManagerOptions } from '../agent/agent-did-manager';
|
|
4
|
+
export declare class AgentManager {
|
|
5
|
+
private keyManager;
|
|
6
|
+
private agentDIDManager;
|
|
7
|
+
/**
|
|
8
|
+
* 🔴 `options` is what makes `config.agentMappingDir` mean anything: without
|
|
9
|
+
* forwarding it, a caller's directory is accepted by the config and then
|
|
10
|
+
* ignored, and every tenant lands back in the shared `~/.vess-aidentity`.
|
|
11
|
+
*/
|
|
12
|
+
constructor(keyManager?: KeyManager, options?: AgentDIDManagerOptions);
|
|
13
|
+
/**
|
|
14
|
+
* Create a new AI agent with unique ID and DID
|
|
15
|
+
*/
|
|
16
|
+
create(metadata?: Record<string, any>): Promise<Agent & {
|
|
17
|
+
id: string;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Get agent DID by agent ID
|
|
21
|
+
*/
|
|
22
|
+
getAgentDID(agentId: string): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Get agent by ID
|
|
25
|
+
*/
|
|
26
|
+
getAgent(agentId: string): Promise<Agent & {
|
|
27
|
+
id: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete an agent and its DID
|
|
31
|
+
*/
|
|
32
|
+
deleteAgent(agentId: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a DID to get DID Document
|
|
35
|
+
*/
|
|
36
|
+
resolve(did: string): Promise<DIDDocument>;
|
|
37
|
+
/**
|
|
38
|
+
* Export agent with private key (for backup)
|
|
39
|
+
*/
|
|
40
|
+
export(did: string): Promise<{
|
|
41
|
+
agent: Agent;
|
|
42
|
+
privateKey: any;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Import agent from backup
|
|
46
|
+
*/
|
|
47
|
+
import(agent: Agent, privateKey: any): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* List all locally stored agents
|
|
50
|
+
*/
|
|
51
|
+
list(): Promise<Array<Agent & {
|
|
52
|
+
id: string;
|
|
53
|
+
}>>;
|
|
54
|
+
private createDidDocument;
|
|
55
|
+
private resolveDidJwkLocally;
|
|
56
|
+
private registerDid;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/did/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAmB,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAGpF,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,eAAe,CAAiB;IAExC;;;;OAIG;gBACS,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAKrE;;OAEG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IA8B7E;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAInD;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAYhE;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD;;OAEG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAuBhD;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,GAAG,CAAA;KAAE,CAAC;IAiBrE;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1D;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAqBpD,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,oBAAoB;YAQd,WAAW;CAK1B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DID Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common utility functions for DID operations.
|
|
5
|
+
* These functions are shared across AgentDIDManager, EphemeralDIDManager,
|
|
6
|
+
* UserIdentityManager, and UserRootDIDManager.
|
|
7
|
+
*/
|
|
8
|
+
import type { JWK } from 'jose';
|
|
9
|
+
/**
|
|
10
|
+
* Public key JWK properties for did:jwk creation
|
|
11
|
+
*/
|
|
12
|
+
export interface PublicKeyJWK {
|
|
13
|
+
kty: string;
|
|
14
|
+
crv?: string;
|
|
15
|
+
x?: string;
|
|
16
|
+
y?: string;
|
|
17
|
+
use?: string;
|
|
18
|
+
alg?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create did:jwk from a public key JWK
|
|
22
|
+
*
|
|
23
|
+
* @param publicKey - The public key JWK (can include private key fields, they will be filtered)
|
|
24
|
+
* @returns The did:jwk string
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const keyPair = await SDJwtClient.generateKeyPair()
|
|
29
|
+
* const did = createDidJwk(keyPair.publicKey)
|
|
30
|
+
* // => did:jwk:eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6Ii4uLiIsInkiOiIuLi4ifQ
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDidJwk(publicKey: JWK | PublicKeyJWK): string;
|
|
34
|
+
/**
|
|
35
|
+
* Extract public key JWK from a private key JWK
|
|
36
|
+
*
|
|
37
|
+
* @param privateKey - The private key JWK containing the 'd' parameter
|
|
38
|
+
* @returns The public key JWK (without private key material)
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const keyPair = await SDJwtClient.generateKeyPair()
|
|
43
|
+
* const publicKey = extractPublicKey(keyPair.privateKey)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractPublicKey(privateKey: JWK): JWK;
|
|
47
|
+
/**
|
|
48
|
+
* Extract public key JWK from a did:jwk string
|
|
49
|
+
*
|
|
50
|
+
* @param did - The did:jwk string
|
|
51
|
+
* @returns The public key JWK decoded from the DID
|
|
52
|
+
* @throws Error if the DID is not in did:jwk format
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const publicKey = extractPublicKeyFromDid('did:jwk:eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6Ii4uLiIsInkiOiIuLi4ifQ')
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function extractPublicKeyFromDid(did: string): JWK;
|
|
60
|
+
/**
|
|
61
|
+
* Validate that a string is a valid did:jwk
|
|
62
|
+
*
|
|
63
|
+
* @param did - The string to validate
|
|
64
|
+
* @returns true if valid did:jwk, false otherwise
|
|
65
|
+
*/
|
|
66
|
+
export declare function isValidDidJwk(did: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Get the key ID (kid) from a did:jwk
|
|
69
|
+
* Following the did:jwk specification, the key ID is the DID with #0 appended
|
|
70
|
+
*
|
|
71
|
+
* @param did - The did:jwk string
|
|
72
|
+
* @returns The key ID
|
|
73
|
+
*/
|
|
74
|
+
export declare function getKeyIdFromDid(did: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Compare two EC public key JWKs for equality.
|
|
77
|
+
* Only compares canonical fields (kty, crv, x, y) to avoid
|
|
78
|
+
* mismatches from optional fields like alg, use, kid, key_ops.
|
|
79
|
+
* Returns false if any canonical field is missing or undefined.
|
|
80
|
+
*/
|
|
81
|
+
export declare function publicKeysMatch(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
|
|
82
|
+
//# sourceMappingURL=did-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-utils.d.ts","sourceRoot":"","sources":["../../src/did/did-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE/B;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,GAAG,GAAG,YAAY,GAAG,MAAM,CAiBlE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,GAAG,GAAG,GAAG,CAIrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAOxD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAYlD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzB,OAAO,CAIT"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { KeyStorageProvider } from '../storage';
|
|
2
|
+
export declare class KeyManager {
|
|
3
|
+
private encryptionKey?;
|
|
4
|
+
private storageProvider;
|
|
5
|
+
constructor(password?: string, storageProvider?: KeyStorageProvider);
|
|
6
|
+
private createDefaultStorageProvider;
|
|
7
|
+
storeKey(did: string, privateKey: any): Promise<void>;
|
|
8
|
+
getKey(did: string): Promise<any | null>;
|
|
9
|
+
deleteKey(did: string): Promise<void>;
|
|
10
|
+
listDids(): Promise<string[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Check if storage is available
|
|
13
|
+
*/
|
|
14
|
+
isAvailable(): Promise<boolean>;
|
|
15
|
+
private didFromKeyId;
|
|
16
|
+
private encrypt;
|
|
17
|
+
private decrypt;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=key-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-manager.d.ts","sourceRoot":"","sources":["../../src/did/key-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAwB,MAAM,YAAY,CAAA;AAGrE,qBAAa,UAAU;IACrB,OAAO,CAAC,aAAa,CAAC,CAAQ;IAC9B,OAAO,CAAC,eAAe,CAAoB;gBAE/B,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,kBAAkB;IAUnE,OAAO,CAAC,4BAA4B;IAU9B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC;IAYxC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKnC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IASrC,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,OAAO;IAoBf,OAAO,CAAC,OAAO;CAqBhB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { IStateStore } from '../state/state-store.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Event returned from the Gateway /events endpoint
|
|
4
|
+
*/
|
|
5
|
+
export interface GatewayEvent {
|
|
6
|
+
id: string;
|
|
7
|
+
type: string;
|
|
8
|
+
source: string;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
data: Record<string, unknown>;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Response from getEvents
|
|
15
|
+
*/
|
|
16
|
+
export interface GetEventsResponse {
|
|
17
|
+
events: GatewayEvent[];
|
|
18
|
+
cursor?: string;
|
|
19
|
+
hasMore: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Response from ackEvent
|
|
23
|
+
*/
|
|
24
|
+
export interface AckEventResponse {
|
|
25
|
+
success: boolean;
|
|
26
|
+
eventId: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options for getEvents
|
|
30
|
+
*/
|
|
31
|
+
export interface GetEventsOptions {
|
|
32
|
+
cursor?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
/** Long-poll wait time in seconds (0 = no wait) */
|
|
35
|
+
waitSeconds?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gateway API client for event-based communication.
|
|
39
|
+
* Used by CLI (runner/daemon) and any other consumer that needs
|
|
40
|
+
* to long-poll for events and acknowledge them.
|
|
41
|
+
*
|
|
42
|
+
* baseUrl should be the API root without trailing path segments
|
|
43
|
+
* (e.g. "https://api.aidentity.io" or "http://localhost:3000").
|
|
44
|
+
*/
|
|
45
|
+
export declare class GatewayClient {
|
|
46
|
+
private baseUrl;
|
|
47
|
+
private stateStore?;
|
|
48
|
+
private apiKey?;
|
|
49
|
+
private sessionToken?;
|
|
50
|
+
constructor(options: {
|
|
51
|
+
baseUrl: string;
|
|
52
|
+
stateStore?: IStateStore;
|
|
53
|
+
apiKey?: string;
|
|
54
|
+
sessionToken?: string;
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Set session token for authenticated requests
|
|
58
|
+
*/
|
|
59
|
+
setSessionToken(token: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Fetch events from the Gateway.
|
|
62
|
+
* If cursor is not provided, attempts to load it from StateStore.
|
|
63
|
+
*
|
|
64
|
+
* NOTE: The /events long-poll endpoint may not be implemented on the API server yet.
|
|
65
|
+
* This client is designed to work once the endpoint is available.
|
|
66
|
+
*/
|
|
67
|
+
getEvents(options?: GetEventsOptions): Promise<GetEventsResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Acknowledge an event (mark as processed).
|
|
70
|
+
*
|
|
71
|
+
* NOTE: The /events/:id/ack endpoint may not be implemented on the API server yet.
|
|
72
|
+
*/
|
|
73
|
+
ackEvent(eventId: string): Promise<AckEventResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* Validate an API key against the Gateway.
|
|
76
|
+
*
|
|
77
|
+
* @param apiKey API key to validate
|
|
78
|
+
* @param projectId Optional project scope
|
|
79
|
+
* @param requiredScopes Scopes the caller needs — callers should pass the
|
|
80
|
+
* scopes relevant to their context (e.g. MCP passes
|
|
81
|
+
* ['mcp:tools:*', 'mcp:memory:*']).
|
|
82
|
+
*/
|
|
83
|
+
validateApiKey(apiKey: string, projectId?: string, requiredScopes?: string[]): Promise<ApiKeyValidationResult>;
|
|
84
|
+
private buildHeaders;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Result of API key validation
|
|
88
|
+
*/
|
|
89
|
+
export interface ApiKeyValidationResult {
|
|
90
|
+
valid: boolean;
|
|
91
|
+
userId?: string;
|
|
92
|
+
projectId?: string;
|
|
93
|
+
scopes?: string[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Error class for Gateway API errors
|
|
97
|
+
*/
|
|
98
|
+
export declare class GatewayError extends Error {
|
|
99
|
+
readonly statusCode: number;
|
|
100
|
+
readonly responseBody: string;
|
|
101
|
+
constructor(message: string, statusCode: number, responseBody: string);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=gateway-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-client.d.ts","sourceRoot":"","sources":["../../src/gateway/gateway-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAE5D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,YAAY,CAAC,CAAQ;gBAEjB,OAAO,EAAE;QACnB,OAAO,EAAE,MAAM,CAAA;QACf,UAAU,CAAC,EAAE,WAAW,CAAA;QACxB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB;IASD;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIpC;;;;;;OAMG;IACG,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAsC3E;;;;OAIG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAoB1D;;;;;;;;OAQG;IACG,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,sBAAsB,CAAC;IAwBlC,OAAO,CAAC,YAAY;CAYrB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;aAGnB,UAAU,EAAE,MAAM;aAClB,YAAY,EAAE,MAAM;gBAFpC,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM;CAKvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gateway/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { VPManager } from '../vp/vp-manager';
|
|
2
|
+
import { Grant, GrantStatus, CreateGrantRequest, UpdateGrantRequest, CheckGrantPermissionRequest, CheckGrantPermissionResult } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Grant提案レスポンス
|
|
5
|
+
*/
|
|
6
|
+
export interface GrantSuggestion {
|
|
7
|
+
id: string;
|
|
8
|
+
oauthTokenId: string;
|
|
9
|
+
userId?: string;
|
|
10
|
+
projectId: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
suggestedActions: string[];
|
|
13
|
+
suggestedResources: Array<{
|
|
14
|
+
type: string;
|
|
15
|
+
id?: string;
|
|
16
|
+
pattern?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
}>;
|
|
19
|
+
metadata: {
|
|
20
|
+
providerInfo: any;
|
|
21
|
+
scopes: string[];
|
|
22
|
+
};
|
|
23
|
+
createdAt: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Grant提案確認リクエスト
|
|
27
|
+
*/
|
|
28
|
+
export interface ConfirmGrantRequest {
|
|
29
|
+
suggestionId: string;
|
|
30
|
+
selectedActions: string[];
|
|
31
|
+
selectedResources: Array<{
|
|
32
|
+
type: string;
|
|
33
|
+
id?: string;
|
|
34
|
+
pattern?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
selected: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
constraints: {
|
|
39
|
+
maxInvocations?: number;
|
|
40
|
+
expiresAt?: string;
|
|
41
|
+
timeWindow?: {
|
|
42
|
+
start: string;
|
|
43
|
+
end: string;
|
|
44
|
+
timezone: string;
|
|
45
|
+
daysOfWeek: number[];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
name?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* GrantManager
|
|
53
|
+
* Grants APIを操作するSDKクライアント
|
|
54
|
+
*/
|
|
55
|
+
export declare class GrantManager {
|
|
56
|
+
constructor(_vpManager: VPManager);
|
|
57
|
+
/**
|
|
58
|
+
* Grant提案を取得
|
|
59
|
+
* @param options - 提案オプション
|
|
60
|
+
* @param options.oauthTokenId - OAuthトークンID
|
|
61
|
+
* @param options.userId - 対象ユーザーID
|
|
62
|
+
* @param options.projectId - プロジェクトID
|
|
63
|
+
* @param authOptions - 認証オプション(VP or issuerDid)
|
|
64
|
+
*/
|
|
65
|
+
suggest(options: {
|
|
66
|
+
oauthTokenId: string;
|
|
67
|
+
userId: string;
|
|
68
|
+
projectId: string;
|
|
69
|
+
}, authOptions: {
|
|
70
|
+
vpJwt?: string;
|
|
71
|
+
issuerDid?: string;
|
|
72
|
+
}): Promise<GrantSuggestion>;
|
|
73
|
+
/**
|
|
74
|
+
* Grant提案を確認して作成
|
|
75
|
+
* @param request - 確認リクエスト
|
|
76
|
+
* @param authOptions - 認証オプション
|
|
77
|
+
*/
|
|
78
|
+
confirm(request: ConfirmGrantRequest, authOptions: {
|
|
79
|
+
vpJwt?: string;
|
|
80
|
+
issuerDid?: string;
|
|
81
|
+
}): Promise<Grant>;
|
|
82
|
+
/**
|
|
83
|
+
* Grantを直接作成
|
|
84
|
+
* @param request - Grant作成リクエスト
|
|
85
|
+
* @param authOptions - 認証オプション
|
|
86
|
+
*/
|
|
87
|
+
create(request: CreateGrantRequest, authOptions: {
|
|
88
|
+
vpJwt?: string;
|
|
89
|
+
issuerDid?: string;
|
|
90
|
+
}): Promise<Grant>;
|
|
91
|
+
/**
|
|
92
|
+
* ユーザー用のGrant一覧を取得
|
|
93
|
+
* @param userId - ユーザーID
|
|
94
|
+
* @param status - フィルタするステータス(オプション)
|
|
95
|
+
*/
|
|
96
|
+
listForUser(userId: string, status?: GrantStatus): Promise<{
|
|
97
|
+
grants: Grant[];
|
|
98
|
+
total: number;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Issuer用のGrant一覧を取得
|
|
102
|
+
* @param issuerDid - IssuerのDID
|
|
103
|
+
* @param status - フィルタするステータス(オプション)
|
|
104
|
+
*/
|
|
105
|
+
listForIssuer(issuerDid: string, status?: GrantStatus): Promise<{
|
|
106
|
+
grants: Grant[];
|
|
107
|
+
total: number;
|
|
108
|
+
}>;
|
|
109
|
+
/**
|
|
110
|
+
* Grantを取得
|
|
111
|
+
* @param grantId - GrantのID
|
|
112
|
+
*/
|
|
113
|
+
get(grantId: string): Promise<Grant>;
|
|
114
|
+
/**
|
|
115
|
+
* Grantを取り消し
|
|
116
|
+
* @param grantId - GrantのID
|
|
117
|
+
* @param reason - 取り消し理由
|
|
118
|
+
* @param authOptions - 認証オプション
|
|
119
|
+
*/
|
|
120
|
+
revoke(grantId: string, reason: string, authOptions: {
|
|
121
|
+
vpJwt?: string;
|
|
122
|
+
issuerDid?: string;
|
|
123
|
+
}): Promise<Grant>;
|
|
124
|
+
/**
|
|
125
|
+
* Grant権限をチェック
|
|
126
|
+
* @param request - 権限チェックリクエスト
|
|
127
|
+
*/
|
|
128
|
+
checkPermission(request: CheckGrantPermissionRequest): Promise<CheckGrantPermissionResult>;
|
|
129
|
+
/**
|
|
130
|
+
* Grant更新
|
|
131
|
+
* @param grantId - GrantのID
|
|
132
|
+
* @param request - 更新リクエスト
|
|
133
|
+
* @param authOptions - 認証オプション
|
|
134
|
+
*/
|
|
135
|
+
update(grantId: string, request: UpdateGrantRequest, authOptions: {
|
|
136
|
+
vpJwt?: string;
|
|
137
|
+
issuerDid?: string;
|
|
138
|
+
}): Promise<Grant>;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=grant-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-manager.d.ts","sourceRoot":"","sources":["../../src/grant/grant-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,EACL,KAAK,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AAEjB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9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