@originator-profile/opvc 0.6.1 → 0.7.0-beta.1
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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# opvc - Originator Profile Verifiable Credential command line tool
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@originator-profile/opvc) [](https://www.jsdocs.io/package/@originator-profile/opvc)
|
|
4
|
+
|
|
3
5
|
Originator Profile (OP) 仕様に準拠した Verifiable Credential (VC) を作成・管理するためのツールです。
|
|
4
6
|
|
|
5
7
|
<!-- prettier-ignore-start -->
|
|
@@ -135,7 +137,7 @@ FLAG DESCRIPTIONS
|
|
|
135
137
|
}
|
|
136
138
|
```
|
|
137
139
|
|
|
138
|
-
_See code: [src/commands/ca/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
140
|
+
_See code: [src/commands/ca/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/ca/sign.ts)_
|
|
139
141
|
|
|
140
142
|
## `opvc ca:unsigned`
|
|
141
143
|
|
|
@@ -220,7 +222,7 @@ FLAG DESCRIPTIONS
|
|
|
220
222
|
}
|
|
221
223
|
```
|
|
222
224
|
|
|
223
|
-
_See code: [src/commands/ca/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
225
|
+
_See code: [src/commands/ca/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/ca/unsigned.ts)_
|
|
224
226
|
|
|
225
227
|
## `opvc help [COMMAND]`
|
|
226
228
|
|
|
@@ -258,7 +260,7 @@ DESCRIPTION
|
|
|
258
260
|
鍵ペアの生成
|
|
259
261
|
```
|
|
260
262
|
|
|
261
|
-
_See code: [src/commands/key-gen/index.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
263
|
+
_See code: [src/commands/key-gen/index.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/key-gen/index.ts)_
|
|
262
264
|
|
|
263
265
|
## `opvc sign`
|
|
264
266
|
|
|
@@ -425,7 +427,7 @@ FLAG DESCRIPTIONS
|
|
|
425
427
|
}
|
|
426
428
|
```
|
|
427
429
|
|
|
428
|
-
_See code: [src/commands/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
430
|
+
_See code: [src/commands/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/sign.ts)_
|
|
429
431
|
|
|
430
432
|
## `opvc wsp:sign`
|
|
431
433
|
|
|
@@ -563,7 +565,7 @@ FLAG DESCRIPTIONS
|
|
|
563
565
|
]
|
|
564
566
|
```
|
|
565
567
|
|
|
566
|
-
_See code: [src/commands/wsp/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
568
|
+
_See code: [src/commands/wsp/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/wsp/sign.ts)_
|
|
567
569
|
|
|
568
570
|
## `opvc wsp:unsigned`
|
|
569
571
|
|
|
@@ -693,7 +695,7 @@ FLAG DESCRIPTIONS
|
|
|
693
695
|
]
|
|
694
696
|
```
|
|
695
697
|
|
|
696
|
-
_See code: [src/commands/wsp/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.
|
|
698
|
+
_See code: [src/commands/wsp/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.1/packages/opvc/src/commands/wsp/unsigned.ts)_
|
|
697
699
|
<!-- commandsstop -->
|
|
698
700
|
<!-- prettier-ignore-end -->
|
|
699
701
|
|
package/dist/commands/ca/sign.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as sign } from "../../content-attestation-
|
|
1
|
+
import { n as sign } from "../../content-attestation-DbHCVSbI.js";
|
|
2
2
|
import { r as privateKey, t as expirationDate } from "../../flags-BSM3ANoc.js";
|
|
3
3
|
import { Command, Flags } from "@oclif/core";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as unsignedCa } from "../../content-attestation-
|
|
1
|
+
import { r as unsignedCa } from "../../content-attestation-DbHCVSbI.js";
|
|
2
2
|
import { t as expirationDate } from "../../flags-BSM3ANoc.js";
|
|
3
3
|
import { Command, Flags } from "@oclif/core";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
@@ -34,9 +34,9 @@ var content_attestation_exports = /* @__PURE__ */ __exportAll({
|
|
|
34
34
|
* @throws {BadRequestError} 入力が UnsignedContentAttestation スキーマに適合しない場合/検証対象のコンテンツが存在しない/コンテンツにアクセスできない/Integrityの計算に失敗
|
|
35
35
|
* @return 未署名 Content Attestation オブジェクト
|
|
36
36
|
*/
|
|
37
|
-
async function unsignedCa(uca, { integrityAlg = "sha256", documentProvider: documentProvider$1 = documentProvider, ...timingOptions }) {
|
|
37
|
+
async function unsignedCa(uca, { integrityAlg = "sha256", documentProvider: documentProvider$1 = documentProvider, assignId = true, ...timingOptions }) {
|
|
38
38
|
const { issuedAt, expiredAt } = parseDates(timingOptions);
|
|
39
|
-
uca.credentialSubject.id ??= `urn:uuid:${crypto.randomUUID()}`;
|
|
39
|
+
if (assignId) uca.credentialSubject.id ??= `urn:uuid:${crypto.randomUUID()}`;
|
|
40
40
|
try {
|
|
41
41
|
UnsignedContentAttestation.parse(uca);
|
|
42
42
|
await Promise.all([fetchAndSetDigestSri(integrityAlg, uca.credentialSubject.image), fetchAndSetTargetIntegrity(integrityAlg, uca, documentProvider$1)]);
|
|
@@ -82,7 +82,8 @@ async function signByServer(uca, { endpoint, accessToken, ...options }) {
|
|
|
82
82
|
const payload = await unsignedCa(uca, {
|
|
83
83
|
...options,
|
|
84
84
|
issuedAt,
|
|
85
|
-
expiredAt
|
|
85
|
+
expiredAt,
|
|
86
|
+
assignId: false
|
|
86
87
|
});
|
|
87
88
|
const response = await fetch(endpoint, {
|
|
88
89
|
method: "POST",
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ declare namespace content_attestation_d_exports {
|
|
|
30
30
|
type UnsignedCaOptions = TimingOptions & {
|
|
31
31
|
integrityAlg?: HashAlgorithm;
|
|
32
32
|
documentProvider?: DocumentProvider;
|
|
33
|
+
/**
|
|
34
|
+
* 入力に credentialSubject.id が無い場合に urn:uuid を採番するか。
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
assignId?: boolean;
|
|
33
38
|
};
|
|
34
39
|
/**
|
|
35
40
|
* 未署名 Content Attestation の取得
|
|
@@ -40,6 +45,7 @@ type UnsignedCaOptions = TimingOptions & {
|
|
|
40
45
|
declare function unsignedCa(uca: UnsignedContentAttestation, {
|
|
41
46
|
integrityAlg,
|
|
42
47
|
documentProvider,
|
|
48
|
+
assignId,
|
|
43
49
|
...timingOptions
|
|
44
50
|
}: UnsignedCaOptions): Promise<UnsignedContentAttestation>;
|
|
45
51
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as documentProvider, t as content_attestation_exports } from "./content-attestation-
|
|
1
|
+
import { i as documentProvider, t as content_attestation_exports } from "./content-attestation-DbHCVSbI.js";
|
|
2
2
|
import { r as website_profile_exports } from "./website-profile-Brt0iuRN.js";
|
|
3
3
|
export { content_attestation_exports as ContentAttestation, website_profile_exports as WebsiteProfile, documentProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@originator-profile/opvc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-beta.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://docs.originator-profile.org",
|
|
6
6
|
"repository": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"jose": "^6.2.2",
|
|
41
41
|
"jsdom": "^29.0.1",
|
|
42
42
|
"wrap-ansi": "^9.0.2",
|
|
43
|
-
"@originator-profile/core": "0.
|
|
44
|
-
"@originator-profile/
|
|
45
|
-
"@originator-profile/
|
|
46
|
-
"@originator-profile/
|
|
47
|
-
"@originator-profile/
|
|
43
|
+
"@originator-profile/core": "0.7.0-beta.1",
|
|
44
|
+
"@originator-profile/cryptography": "0.7.0-beta.1",
|
|
45
|
+
"@originator-profile/model": "0.7.0-beta.1",
|
|
46
|
+
"@originator-profile/sign": "0.7.0-beta.1",
|
|
47
|
+
"@originator-profile/securing-mechanism": "0.7.0-beta.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "25.6.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"tsdown": "0.21.7",
|
|
54
54
|
"typescript": "6.0.2",
|
|
55
55
|
"websri": "1.0.1",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
56
|
+
"eslint-config-originator-profile": "0.7.0-beta.1",
|
|
57
|
+
"@originator-profile/tsconfig": "0.7.0-beta.1"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsdown && oclif manifest && oclif readme",
|