@inixiative/signet 0.12.2 → 0.12.3
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 +5 -3
- package/package.json +2 -2
- package/src/client.ts +1 -1
- package/src/files.ts +1 -1
- package/src/proof.ts +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @inixiative/signet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Part of [inixiative](https://www.inixiative.com), technology for cooperation. See [all the projects](https://github.com/inixiative).
|
|
4
|
+
|
|
5
|
+
Pass-through execution with tracking and audit. A Signet is how anything uses an integration through Kingdom: a revocable pass on the owner's terms. Kingdom decides who may grant and use one with [`@inixiative/permissions`](https://github.com/inixiative/permissions); a grant's lens is [json-rules](https://github.com/inixiative/json-rules). This package presents Kingdom Signets.
|
|
4
6
|
|
|
5
7
|
A **Signet** is Kingdom's only grant for using an integration. It names the resources, operations, lens and limits, and it can be revoked. Its grantee is a user or an integration, for example a paired Foundry or a machine's local Archive. The grantee presents it with an access token plus a DPoP proof signed by its device key (RFC 9449).
|
|
6
8
|
|
|
7
|
-
This package is the one implementation of that protocol, shared by Kingdom (which verifies) and Archive, Foundry and
|
|
9
|
+
This package is the one implementation of that protocol, shared by Kingdom (which verifies) and Archive, Foundry, Oracle and KCP (which present):
|
|
8
10
|
|
|
9
11
|
- `contracts`: the wire schemas: keys, grants (operation picks, lens layers, terms), proposals, pairing requests, delivered credentials, `describe` and `execute`, and the conversation frames.
|
|
10
12
|
- `proof`: create and verify DPoP proofs (ES256, nonce-bound, access-token-bound).
|
|
@@ -106,7 +108,7 @@ socket.start();
|
|
|
106
108
|
await signet.execute({
|
|
107
109
|
integrationId,
|
|
108
110
|
operation: 'thread.prompt',
|
|
109
|
-
input: { resourceId, threadId, postId:
|
|
111
|
+
input: { resourceId, threadId, postId: Bun.randomUUIDv7(), text: 'The role you wanted opened' },
|
|
110
112
|
});
|
|
111
113
|
```
|
|
112
114
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inixiative/signet",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Present Kingdom Signets: the wire contracts, DPoP proofs, device pairing and a renewing client shared by Kingdom, Archive, Foundry and Oracle.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
37
37
|
"@biomejs/biome": "2.5.2",
|
|
38
|
-
"@inixiative/config": "^0.5.
|
|
38
|
+
"@inixiative/config": "^0.5.188",
|
|
39
39
|
"@inixiative/json-rules": "^3.16.0",
|
|
40
40
|
"@types/bun": "1.4.4",
|
|
41
41
|
"lefthook": "2.1.9",
|
package/src/client.ts
CHANGED
|
@@ -643,7 +643,7 @@ export class SignetClient {
|
|
|
643
643
|
return accessResultSchema.parse(
|
|
644
644
|
await this.post(
|
|
645
645
|
'execute',
|
|
646
|
-
{ ...request, signetId: this.signetId, requestId:
|
|
646
|
+
{ ...request, signetId: this.signetId, requestId: Bun.randomUUIDv7() },
|
|
647
647
|
undefined,
|
|
648
648
|
options,
|
|
649
649
|
),
|
package/src/files.ts
CHANGED
|
@@ -32,7 +32,7 @@ export async function writePrivateJson(path: string, value: unknown): Promise<vo
|
|
|
32
32
|
(process.getuid && parent.uid !== process.getuid())
|
|
33
33
|
)
|
|
34
34
|
throw Error('Signet credential directory must be owned and private (0700)');
|
|
35
|
-
const temporary = join(dirname(path), `.credential-${
|
|
35
|
+
const temporary = join(dirname(path), `.credential-${Bun.randomUUIDv7()}`);
|
|
36
36
|
try {
|
|
37
37
|
await writeFile(temporary, JSON.stringify(value), { mode: 0o600, flag: 'wx' });
|
|
38
38
|
await rename(temporary, path);
|
package/src/proof.ts
CHANGED
|
@@ -76,7 +76,7 @@ export const createSignetProof = async (input: {
|
|
|
76
76
|
jwk: publicClientKeySchema.parse(input.publicKey),
|
|
77
77
|
})
|
|
78
78
|
.setIssuedAt()
|
|
79
|
-
.setJti(input.proofId ??
|
|
79
|
+
.setJti(input.proofId ?? Bun.randomUUIDv7())
|
|
80
80
|
.sign(await importJWK(input.privateKey, 'ES256'));
|
|
81
81
|
|
|
82
82
|
export const keyThumbprint = (key: unknown) =>
|