@originator-profile/opvc 0.7.0-beta.4 → 0.7.0-beta.5

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
@@ -137,7 +137,7 @@ FLAG DESCRIPTIONS
137
137
  }
138
138
  ```
139
139
 
140
- _See code: [src/commands/ca/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/ca/sign.ts)_
140
+ _See code: [src/commands/ca/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/ca/sign.ts)_
141
141
 
142
142
  ## `opvc ca:unsigned`
143
143
 
@@ -222,7 +222,7 @@ FLAG DESCRIPTIONS
222
222
  }
223
223
  ```
224
224
 
225
- _See code: [src/commands/ca/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/ca/unsigned.ts)_
225
+ _See code: [src/commands/ca/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/ca/unsigned.ts)_
226
226
 
227
227
  ## `opvc help [COMMAND]`
228
228
 
@@ -260,7 +260,7 @@ DESCRIPTION
260
260
  鍵ペアの生成
261
261
  ```
262
262
 
263
- _See code: [src/commands/key-gen/index.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/key-gen/index.ts)_
263
+ _See code: [src/commands/key-gen/index.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/key-gen/index.ts)_
264
264
 
265
265
  ## `opvc sign`
266
266
 
@@ -427,7 +427,7 @@ FLAG DESCRIPTIONS
427
427
  }
428
428
  ```
429
429
 
430
- _See code: [src/commands/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/sign.ts)_
430
+ _See code: [src/commands/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/sign.ts)_
431
431
 
432
432
  ## `opvc wsp:sign`
433
433
 
@@ -565,7 +565,7 @@ FLAG DESCRIPTIONS
565
565
  ]
566
566
  ```
567
567
 
568
- _See code: [src/commands/wsp/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/wsp/sign.ts)_
568
+ _See code: [src/commands/wsp/sign.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/wsp/sign.ts)_
569
569
 
570
570
  ## `opvc wsp:unsigned`
571
571
 
@@ -695,7 +695,7 @@ FLAG DESCRIPTIONS
695
695
  ]
696
696
  ```
697
697
 
698
- _See code: [src/commands/wsp/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.4/packages/opvc/src/commands/wsp/unsigned.ts)_
698
+ _See code: [src/commands/wsp/unsigned.ts](https://github.com/originator-profile/originator-profile/blob/v0.7.0-beta.5/packages/opvc/src/commands/wsp/unsigned.ts)_
699
699
  <!-- commandsstop -->
700
700
  <!-- prettier-ignore-end -->
701
701
 
@@ -742,21 +742,7 @@ const uca = await ContentAttestation.unsignedCa(input, {
742
742
  });
743
743
  ```
744
744
 
745
- ### CA Server経由での署名
746
-
747
- CA Server で署名する場合は `ContentAttestation.signByServer()` を使います。
748
- 内部では未署名 Content Attestation を組み立てて CA server に送信し、返却された JWT を受け取ります。
749
-
750
- ```ts
751
- import { ContentAttestation } from "@originator-profile/opvc";
752
-
753
- const jwt = await ContentAttestation.signByServer(input, {
754
- endpoint: "https://example.com/ca",
755
- accessToken: process.env.CA_SERVER_ACCESS_TOKEN!,
756
- issuedAt: new Date(),
757
- expiredAt: "2027-03-31",
758
- });
759
- ```
745
+ CA サーバー経由の署名は [`@originator-profile/ca-client`](https://www.npmjs.com/package/@originator-profile/ca-client) の `createCaClient().sign()` を使用してください。
760
746
 
761
747
  ### Website Profile の署名 (単一 / 多言語)
762
748
 
@@ -1,4 +1,4 @@
1
- import { n as sign } from "../../content-attestation-BydW0zgM.js";
1
+ import { n as sign } from "../../content-attestation-BLoVpN01.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-BydW0zgM.js";
1
+ import { r as unsignedCa } from "../../content-attestation-BLoVpN01.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";
@@ -25,7 +25,6 @@ async function documentProvider({ type, content = "" }) {
25
25
  //#region src/content-attestation.ts
26
26
  var content_attestation_exports = /* @__PURE__ */ __exportAll({
27
27
  sign: () => sign,
28
- signByServer: () => signByServer,
29
28
  unsignedCa: () => unsignedCa
30
29
  });
31
30
  /**
@@ -69,49 +68,5 @@ async function sign(uca, signer, options = {}) {
69
68
  documentProvider
70
69
  });
71
70
  }
72
- /**
73
- * CA server 経由で Content Attestation を作成
74
- * @param uca 未署名 Content Attestation オブジェクト
75
- * @param options Content Attestation の生成オプション
76
- * @param options.endpoint CA server のエンドポイント URL
77
- * @param options.accessToken CA server 呼び出しに利用する Bearer トークン
78
- * @return JWT でエンコードされた Content Attestation
79
- */
80
- async function signByServer(uca, { endpoint, accessToken, ...options }) {
81
- const { issuedAt, expiredAt } = parseDates(options);
82
- const payload = await unsignedCa(uca, {
83
- ...options,
84
- issuedAt,
85
- expiredAt,
86
- assignId: false
87
- });
88
- const response = await fetch(endpoint, {
89
- method: "POST",
90
- headers: {
91
- "Content-Type": "application/json",
92
- Authorization: `Bearer ${accessToken}`
93
- },
94
- body: JSON.stringify({
95
- ...payload,
96
- issuedAt: issuedAt.toISOString(),
97
- expiredAt: expiredAt.toISOString()
98
- })
99
- });
100
- if (!response.ok) {
101
- const responseBody = await response.text();
102
- throw new Error(`CA API error: ${response.status} ${response.statusText}: ${responseBody}`);
103
- }
104
- const responseBody = (await response.text()).trim();
105
- if (responseBody === "") throw new Error("CA API returned no JWT.");
106
- let result;
107
- try {
108
- result = JSON.parse(responseBody);
109
- } catch {
110
- return responseBody;
111
- }
112
- if (typeof result === "string") return result;
113
- if (Array.isArray(result) && typeof result[0] === "string") return result[0];
114
- throw new Error("CA API returned no JWT.");
115
- }
116
71
  //#endregion
117
72
  export { documentProvider as i, sign as n, unsignedCa as r, content_attestation_exports as t };
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ type TimingOptions = {
26
26
  expiredAt?: Date | string;
27
27
  };
28
28
  declare namespace content_attestation_d_exports {
29
- export { sign$1 as sign, signByServer, unsignedCa };
29
+ export { sign$1 as sign, unsignedCa };
30
30
  }
31
31
  type UnsignedCaOptions = TimingOptions & {
32
32
  integrityAlg?: HashAlgorithm;
@@ -57,22 +57,6 @@ declare function unsignedCa(uca: UnsignedContentAttestation, {
57
57
  * @return Content Attestation
58
58
  */
59
59
  declare function sign$1(uca: UnsignedContentAttestation, signer: KeyMaterial | JwtSigner, options?: TimingOptions): Promise<string>;
60
- /**
61
- * CA server 経由で Content Attestation を作成
62
- * @param uca 未署名 Content Attestation オブジェクト
63
- * @param options Content Attestation の生成オプション
64
- * @param options.endpoint CA server のエンドポイント URL
65
- * @param options.accessToken CA server 呼び出しに利用する Bearer トークン
66
- * @return JWT でエンコードされた Content Attestation
67
- */
68
- declare function signByServer(uca: UnsignedContentAttestation, {
69
- endpoint,
70
- accessToken,
71
- ...options
72
- }: UnsignedCaOptions & {
73
- endpoint: string;
74
- accessToken: string;
75
- }): Promise<string>;
76
60
  declare namespace website_profile_d_exports {
77
61
  export { sign, unsignedWsp };
78
62
  }
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as documentProvider, t as content_attestation_exports } from "./content-attestation-BydW0zgM.js";
1
+ import { i as documentProvider, t as content_attestation_exports } from "./content-attestation-BLoVpN01.js";
2
2
  import { r as website_profile_exports } from "./website-profile-B_7x7iSY.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.7.0-beta.4",
3
+ "version": "0.7.0-beta.5",
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.7.0-beta.4",
44
- "@originator-profile/model": "0.7.0-beta.4",
45
- "@originator-profile/securing-mechanism": "0.7.0-beta.4",
46
- "@originator-profile/cryptography": "0.7.0-beta.4",
47
- "@originator-profile/sign": "0.7.0-beta.4"
43
+ "@originator-profile/core": "0.7.0-beta.5",
44
+ "@originator-profile/model": "0.7.0-beta.5",
45
+ "@originator-profile/securing-mechanism": "0.7.0-beta.5",
46
+ "@originator-profile/sign": "0.7.0-beta.5",
47
+ "@originator-profile/cryptography": "0.7.0-beta.5"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "25.6.0",
@@ -54,7 +54,7 @@
54
54
  "tsdown": "0.21.7",
55
55
  "typescript": "6.0.2",
56
56
  "websri": "1.0.1",
57
- "@originator-profile/tsconfig": "0.7.0-beta.4"
57
+ "@originator-profile/tsconfig": "0.7.0-beta.5"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsdown && oclif manifest && oclif readme",