@logicsrc/schemas 0.1.0 → 0.1.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.
Files changed (38) hide show
  1. package/README.md +8 -1
  2. package/fixtures/openfleet/mixed.json +86 -0
  3. package/fixtures/openprd/conformance.json +14 -3
  4. package/fixtures/openprd/invalid/bad-filename.md +10 -1
  5. package/fixtures/openprd/invalid/bad-id-format.md +10 -1
  6. package/fixtures/openprd/invalid/bad-status.md +10 -1
  7. package/fixtures/openprd/invalid/dates-backwards.md +10 -1
  8. package/fixtures/openprd/invalid/duplicate-requirement.md +10 -1
  9. package/fixtures/openprd/invalid/id-mismatch.md +10 -1
  10. package/fixtures/openprd/invalid/missing-monetization.md +45 -0
  11. package/fixtures/openprd/invalid/missing-section.md +10 -1
  12. package/fixtures/openprd/invalid/missing-title.md +10 -1
  13. package/fixtures/openprd/invalid/no-front-matter.md +9 -0
  14. package/fixtures/openprd/invalid/out-of-order.md +10 -1
  15. package/fixtures/openprd/invalid/superseded-without-replacement.md +10 -1
  16. package/fixtures/openprd/invalid/unknown-key.md +10 -1
  17. package/fixtures/openprd/valid/bold-requirements.md +10 -1
  18. package/fixtures/openprd/valid/full.md +10 -1
  19. package/fixtures/openprd/valid/legacy-0-2.md +41 -0
  20. package/fixtures/openprd/valid/minimal.md +9 -1
  21. package/fixtures/openprd/valid/none-sections.md +9 -1
  22. package/fixtures/openprd/valid/subsections.md +10 -1
  23. package/fixtures/openprd/valid/superseded.md +10 -1
  24. package/fixtures/openwall/announcement.json +16 -0
  25. package/fixtures/openwall/broadcast.json +27 -0
  26. package/fixtures/openwall/direct.json +17 -0
  27. package/fixtures/openwall/receipt-accepted.json +13 -0
  28. package/fixtures/openwall/receipt-retrying.json +14 -0
  29. package/package.json +16 -3
  30. package/schemas/logicsrc-opencreds-audit-event.schema.json +54 -0
  31. package/schemas/logicsrc-opencreds-database.schema.json +94 -0
  32. package/schemas/logicsrc-opencreds-envelope.schema.json +38 -0
  33. package/schemas/logicsrc-opencreds-item.schema.json +240 -0
  34. package/schemas/logicsrc-opencreds-manifest.schema.json +31 -0
  35. package/schemas/logicsrc-opencreds-vault-meta.schema.json +70 -0
  36. package/schemas/logicsrc-openfleet.schema.json +323 -0
  37. package/schemas/logicsrc-openwall-message.schema.json +246 -0
  38. package/schemas/logicsrc-openwall-receipt.schema.json +229 -0
@@ -0,0 +1,17 @@
1
+ {
2
+ "openwall": "0.1-draft",
3
+ "id": "urn:uuid:07b2b83e-27f6-4d59-bdfa-cdcd42548678",
4
+ "sender": "did:web:ops.example",
5
+ "createdAt": "2026-09-13T12:00:00Z",
6
+ "expiresAt": "2026-09-13T12:10:00Z",
7
+ "visibility": "private",
8
+ "topic": "maintenance",
9
+ "audience": {
10
+ "kind": "direct",
11
+ "recipient": "did:web:ada.example"
12
+ },
13
+ "content": {
14
+ "mediaType": "text/plain",
15
+ "text": "Ready when you are."
16
+ }
17
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "openwall": "0.1-draft",
3
+ "id": "urn:uuid:963f9109-803f-4f0c-8506-10c70ec47ee6",
4
+ "messageId": "urn:uuid:94d908df-2876-48f1-bec8-c931f5c847d4",
5
+ "recipient": "did:web:ada.example",
6
+ "sequence": 3,
7
+ "state": "accepted",
8
+ "at": "2026-09-13T12:00:03Z",
9
+ "attempt": 1,
10
+ "route": "https://chat.example",
11
+ "providerMessageId": "provider-msg-123",
12
+ "deliveryId": "urn:uuid:db925d64-4e1a-4e5a-83c1-e37b68aa5eef"
13
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "openwall": "0.1-draft",
3
+ "id": "urn:uuid:211bb615-90e1-4773-b7c0-49d59d7cd6bc",
4
+ "messageId": "urn:uuid:94d908df-2876-48f1-bec8-c931f5c847d4",
5
+ "recipient": "did:web:ada.example",
6
+ "sequence": 3,
7
+ "state": "retrying",
8
+ "at": "2026-09-13T12:00:03Z",
9
+ "attempt": 1,
10
+ "route": "https://chat.example",
11
+ "reason": "rate-limited",
12
+ "nextAttemptAt": "2026-09-13T12:01:00Z",
13
+ "deliveryId": "urn:uuid:db925d64-4e1a-4e5a-83c1-e37b68aa5eef"
14
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@logicsrc/schemas",
3
- "version": "0.1.0",
4
- "description": "LogicSRC JSON schemas for tasks, agents, runs, events, plugins, the AgentAd ad standard, the OpenOntology knowledge contracts, and the OpenContext context plane.",
3
+ "version": "0.1.1",
4
+ "description": "LogicSRC JSON schemas for tasks, agents, runs, events, plugins, the AgentAd ad standard, the OpenOntology knowledge contracts, the OpenContext context plane, the OpenCreds credential vault, OpenFleet membership and rental offers, and the OpenWall messaging proposal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "repository": {
@@ -21,8 +21,12 @@
21
21
  "logicsrc",
22
22
  "ontology",
23
23
  "opencontext",
24
+ "opencreds",
25
+ "openfleet",
24
26
  "openontology",
25
- "standards"
27
+ "password-manager",
28
+ "standards",
29
+ "vault"
26
30
  ],
27
31
  "publishConfig": {
28
32
  "access": "public"
@@ -55,6 +59,13 @@
55
59
  "./opencontext-object": "./schemas/logicsrc-opencontext-object.schema.json",
56
60
  "./opencontext-provenance": "./schemas/logicsrc-opencontext-provenance.schema.json",
57
61
  "./opencontext-role": "./schemas/logicsrc-opencontext-role.schema.json",
62
+ "./opencreds-audit-event": "./schemas/logicsrc-opencreds-audit-event.schema.json",
63
+ "./opencreds-database": "./schemas/logicsrc-opencreds-database.schema.json",
64
+ "./opencreds-envelope": "./schemas/logicsrc-opencreds-envelope.schema.json",
65
+ "./opencreds-item": "./schemas/logicsrc-opencreds-item.schema.json",
66
+ "./opencreds-manifest": "./schemas/logicsrc-opencreds-manifest.schema.json",
67
+ "./opencreds-vault-meta": "./schemas/logicsrc-opencreds-vault-meta.schema.json",
68
+ "./openfleet": "./schemas/logicsrc-openfleet.schema.json",
58
69
  "./openontology-action": "./schemas/logicsrc-openontology-action.schema.json",
59
70
  "./openontology-approval": "./schemas/logicsrc-openontology-approval.schema.json",
60
71
  "./openontology-changeset": "./schemas/logicsrc-openontology-changeset.schema.json",
@@ -74,6 +85,8 @@
74
85
  "./openontology-review": "./schemas/logicsrc-openontology-review.schema.json",
75
86
  "./openontology-source": "./schemas/logicsrc-openontology-source.schema.json",
76
87
  "./openprd-prd": "./schemas/openprd-prd.schema.json",
88
+ "./openwall-message": "./schemas/logicsrc-openwall-message.schema.json",
89
+ "./openwall-receipt": "./schemas/logicsrc-openwall-receipt.schema.json",
77
90
  "./plugin": "./schemas/logicsrc-plugin.schema.json",
78
91
  "./pull-request": "./schemas/logicsrc-pull-request.schema.json",
79
92
  "./repo": "./schemas/logicsrc-repo.schema.json",
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/audit-event.schema.json",
4
+ "title": "OpenCreds Audit Event",
5
+ "description": "One recorded vault operation. An audit event MUST NOT contain a secret value. Where a value must be referenced it is referenced by salted, truncated SHA-256 fingerprint — an equality and integrity marker, not secret storage. Item names are also secret-adjacent (a folder list is a good description of someone's life), so an event carries the item id and type rather than its name.",
6
+ "type": "object",
7
+ "required": ["type", "id", "action", "createdAt"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "type": { "type": "string", "const": "opencreds.audit_event" },
11
+ "id": { "type": "string" },
12
+ "action": {
13
+ "type": "string",
14
+ "enum": [
15
+ "vault.create",
16
+ "vault.unlock",
17
+ "vault.unlock_failed",
18
+ "vault.rekey",
19
+ "vault.recovery_reset",
20
+ "item.create",
21
+ "item.update",
22
+ "item.delete",
23
+ "item.restore",
24
+ "item.purge",
25
+ "database.export",
26
+ "database.export_plaintext",
27
+ "database.import"
28
+ ]
29
+ },
30
+ "itemId": { "type": "string" },
31
+ "itemType": { "type": "string", "enum": ["login", "card", "identity", "note", "key", "account"] },
32
+ "namespace": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" },
33
+ "profile": { "type": "string", "enum": ["user", "team"] },
34
+ "principal": {
35
+ "type": "object",
36
+ "description": "Who acted. Shape borrowed from LogicSRC account-core so an OpenCreds event sits alongside the credential-sharing audit trail.",
37
+ "additionalProperties": true,
38
+ "properties": {
39
+ "kind": { "type": "string", "enum": ["user", "agent", "service"] },
40
+ "id": { "type": "string" },
41
+ "label": { "type": "string" }
42
+ }
43
+ },
44
+ "fingerprint": {
45
+ "type": "string",
46
+ "description": "Salted, truncated SHA-256 of the value observed or written. Never the value."
47
+ },
48
+ "itemCount": { "type": "integer", "minimum": 0, "description": "For database.* actions." },
49
+ "dryRun": { "type": "boolean", "default": false },
50
+ "outcome": { "type": "string", "enum": ["succeeded", "failed", "refused"] },
51
+ "reason": { "type": "string", "description": "Why a failed or refused action did not proceed. Never contains a value." },
52
+ "createdAt": { "type": "string", "format": "date-time" }
53
+ }
54
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/database.schema.json",
4
+ "title": "OpenCreds Portable Database",
5
+ "description": "A vault as one file: what you hand to another product, keep as a backup, and read to import. Encrypted by default. The plaintext form exists because the products people move to frequently read nothing else, and an export format that cannot express that gets worked around with a script that is worse — no warning, no file mode, no label. So it is specified and made loud: an explicit opt-in, and protected:false in the header so tooling can identify the file without parsing the rest of it. Media type application/vnd.logicsrc.opencreds+json; conventional extension .opencreds.",
6
+ "type": "object",
7
+ "required": ["opencreds", "type", "protected", "namespace", "exportedAt", "manifest"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "opencreds": { "type": "string", "const": "0.1" },
11
+ "type": { "type": "string", "const": "opencreds.database" },
12
+ "protected": { "type": "boolean" },
13
+ "namespace": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" },
14
+ "exportedAt": { "type": "string", "format": "date-time" },
15
+ "generator": {
16
+ "type": "object",
17
+ "required": ["name", "version"],
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "name": { "type": "string" },
21
+ "version": { "type": "string" }
22
+ }
23
+ },
24
+ "kdf": {
25
+ "type": "object",
26
+ "required": ["kdf", "iterations", "salt"],
27
+ "additionalProperties": false,
28
+ "description": "Parameters for the export key, which is derived from an export passphrase and is NOT the vault's user key — a file encrypted under the user key would only open inside the vault it came from, which is the opposite of portable. Omitted when a raw 32-byte key was supplied instead.",
29
+ "properties": {
30
+ "kdf": { "type": "string", "enum": ["pbkdf2-sha256", "argon2id"] },
31
+ "iterations": { "type": "integer", "minimum": 100000 },
32
+ "salt": { "type": "string", "pattern": "^[A-Za-z0-9+/]*={0,2}$" }
33
+ }
34
+ },
35
+ "manifest": { "$ref": "https://logicsrc.com/schemas/opencreds/manifest.schema.json" },
36
+ "iv": { "type": "string", "pattern": "^[A-Za-z0-9+/]*={0,2}$" },
37
+ "ciphertext": {
38
+ "type": "string",
39
+ "pattern": "^[A-Za-z0-9+/]*={0,2}$",
40
+ "description": "AES-256-GCM over the UTF-8 JSON of {folders, items}, with the header (opencreds, type, protected, namespace, exportedAt, generator, kdf, manifest, in that key order) bound as additional authenticated data. An attacker cannot restate the item count, swap the generator, or downgrade protected without the decryption failing."
41
+ },
42
+ "folders": {
43
+ "type": "array",
44
+ "items": { "$ref": "#/$defs/folder" },
45
+ "description": "Plaintext form only."
46
+ },
47
+ "items": {
48
+ "type": "array",
49
+ "items": { "$ref": "https://logicsrc.com/schemas/opencreds/item.schema.json" },
50
+ "description": "Plaintext form only. Every secret in the vault, in the clear."
51
+ }
52
+ },
53
+ "allOf": [
54
+ {
55
+ "$comment": "The two forms are mutually exclusive: an encrypted database carries a payload it cannot also state in the clear. A false subschema is how JSON Schema says 'this property must be absent'.",
56
+ "if": { "properties": { "protected": { "const": true } }, "required": ["protected"] },
57
+ "then": {
58
+ "required": ["iv", "ciphertext"],
59
+ "properties": {
60
+ "iv": { "type": "string" },
61
+ "ciphertext": { "type": "string" },
62
+ "items": false,
63
+ "folders": false
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "if": { "properties": { "protected": { "const": false } }, "required": ["protected"] },
69
+ "then": {
70
+ "required": ["items"],
71
+ "properties": {
72
+ "items": { "type": "array" },
73
+ "iv": false,
74
+ "ciphertext": false,
75
+ "kdf": false
76
+ }
77
+ }
78
+ }
79
+ ],
80
+ "$defs": {
81
+ "folder": {
82
+ "type": "object",
83
+ "required": ["id", "name"],
84
+ "additionalProperties": false,
85
+ "properties": {
86
+ "id": {
87
+ "type": "string",
88
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
89
+ },
90
+ "name": { "type": "string" }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/envelope.schema.json",
4
+ "title": "OpenCreds Item Envelope",
5
+ "description": "One encrypted item as it is stored. AES-256-GCM over the item's UTF-8 JSON, with UTF8(\"<namespace>:vault:item:<v>:<id>\") bound as additional authenticated data. Binding the id means a ciphertext cannot be moved between rows: without it, anyone with write access to the storage could copy a low-value login's ciphertext into a high-value one's row and watch what the user does next. Only id and type are plaintext, and that is the metadata this design accepts leaking — the server learns you hold forty logins and two cards, never which sites or what values.",
6
+ "type": "object",
7
+ "required": ["id", "type", "ciphertext", "iv"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "id": {
11
+ "type": "string",
12
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
13
+ "description": "Matches the id inside the ciphertext. A decrypting implementation MUST verify the two agree; the AAD already makes a mismatch unreachable, and the check costs nothing."
14
+ },
15
+ "type": {
16
+ "type": "integer",
17
+ "minimum": 1,
18
+ "maximum": 6,
19
+ "description": "1 login, 2 card, 3 identity, 4 note, 5 key, 6 account. Plaintext on purpose, so a server can filter and paginate without decrypting."
20
+ },
21
+ "ciphertext": { "type": "string", "pattern": "^[A-Za-z0-9+/]*={0,2}$" },
22
+ "iv": {
23
+ "type": "string",
24
+ "pattern": "^[A-Za-z0-9+/]*={0,2}$",
25
+ "description": "96 bits, fresh per encryption. With GCM a repeated IV under one key is not a weakness but a break, leaking the XOR of two plaintexts along with the authentication subkey."
26
+ },
27
+ "v": { "type": "integer", "minimum": 1, "description": "Item schema version, when the storage carries it outside the ciphertext. Defaults to 1." },
28
+ "revision": {
29
+ "type": "integer",
30
+ "minimum": 1,
31
+ "description": "Optimistic concurrency. Two devices editing two different passwords at the same moment must not cost anyone a credential; a client that writes with a stale revision is rejected rather than overwriting."
32
+ },
33
+ "deletedAt": { "type": ["string", "null"], "description": "Trash bin, not erasure." },
34
+ "purgeAfter": { "type": ["string", "null"] },
35
+ "createdAt": { "type": "string", "format": "date-time" },
36
+ "updatedAt": { "type": "string", "format": "date-time" }
37
+ }
38
+ }
@@ -0,0 +1,240 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/item.schema.json",
4
+ "title": "OpenCreds Item",
5
+ "description": "One credential record: a login, a card, an identity, a note, a key, or an account. These are not six features but one record with a type and a named field group, so that everything the user typed lives inside a single encrypted blob. That is what makes password history free — it is an array in that blob, encrypted by construction, rather than a second table someone can forget to protect. Every field in every group is optional and defaults to an empty string, because a real vault holds half-filled records and a model that requires fields produces importers that invent them.",
6
+ "type": "object",
7
+ "required": ["v", "id", "type", "name", "createdAt", "updatedAt"],
8
+ "additionalProperties": true,
9
+ "properties": {
10
+ "v": {
11
+ "type": "integer",
12
+ "minimum": 1,
13
+ "description": "Item schema version, stamped into every record from the first write. A record you cannot identify is a record you cannot migrate. 1 for OpenCreds 0.1."
14
+ },
15
+ "id": {
16
+ "$ref": "#/$defs/uuid",
17
+ "description": "Generated on the client, because it is bound into the ciphertext as additional authenticated data. A ciphertext moved to another row fails to decrypt rather than silently showing the wrong credential."
18
+ },
19
+ "type": {
20
+ "$ref": "#/$defs/itemType",
21
+ "description": "Selects the field group. An item MUST NOT carry a group other than the one named here."
22
+ },
23
+ "name": {
24
+ "type": "string",
25
+ "description": "Display name. MAY be empty; importers fall back to the URL host when an export had none."
26
+ },
27
+ "favorite": { "type": "boolean", "default": false },
28
+ "folderId": {
29
+ "oneOf": [{ "$ref": "#/$defs/uuid" }, { "type": "null" }],
30
+ "description": "A folder declared in the same vault, or null. Folders are flat: a name may contain a slash and a client may render that as a hierarchy, but the model does not nest, because every product that nests disagrees about what a move does."
31
+ },
32
+ "notes": {
33
+ "type": "string",
34
+ "description": "Free text. For a note item this is the content."
35
+ },
36
+ "fields": {
37
+ "type": "array",
38
+ "items": { "$ref": "#/$defs/customField" },
39
+ "description": "Custom fields. A hidden field is displayed masked; it is not encrypted differently, because everything in the item is already inside one ciphertext."
40
+ },
41
+ "attachments": {
42
+ "type": "array",
43
+ "items": { "$ref": "#/$defs/attachment" },
44
+ "description": "Attachment references, never bytes. An implementation that does not store blobs MUST still round-trip these."
45
+ },
46
+ "history": {
47
+ "type": "array",
48
+ "maxItems": 20,
49
+ "items": { "$ref": "#/$defs/historyEntry" },
50
+ "description": "Password history, newest first, defined only for login items. Capped at 20: the item blob is rewritten on every save, so an uncapped array grows the ciphertext without bound and the growth is invisible until sync starts timing out."
51
+ },
52
+ "createdAt": { "$ref": "#/$defs/timestamp" },
53
+ "updatedAt": {
54
+ "$ref": "#/$defs/timestamp",
55
+ "description": "Belongs to the item, not to a transfer. An importer that restamps this destroys the only evidence of when a password was last rotated."
56
+ },
57
+ "login": { "$ref": "#/$defs/loginGroup" },
58
+ "card": { "$ref": "#/$defs/cardGroup" },
59
+ "identity": { "$ref": "#/$defs/identityGroup" },
60
+ "key": { "$ref": "#/$defs/keyGroup" },
61
+ "account": { "$ref": "#/$defs/accountGroup" }
62
+ },
63
+ "allOf": [
64
+ {
65
+ "$comment": "An item MUST NOT carry a field group other than the one named by its type. A card group on a login item is either a broken importer or an attempt to smuggle a field past a type-based permission check; neither should be stored. A false subschema is how JSON Schema says 'this property must be absent'.",
66
+ "if": { "properties": { "type": { "const": "login" } }, "required": ["type"] },
67
+ "then": { "properties": { "card": false, "identity": false, "key": false, "account": false } }
68
+ },
69
+ {
70
+ "if": { "properties": { "type": { "const": "card" } }, "required": ["type"] },
71
+ "then": { "properties": { "login": false, "identity": false, "key": false, "account": false } }
72
+ },
73
+ {
74
+ "if": { "properties": { "type": { "const": "identity" } }, "required": ["type"] },
75
+ "then": { "properties": { "login": false, "card": false, "key": false, "account": false } }
76
+ },
77
+ {
78
+ "if": { "properties": { "type": { "const": "note" } }, "required": ["type"] },
79
+ "then": { "properties": { "login": false, "card": false, "identity": false, "key": false, "account": false } }
80
+ },
81
+ {
82
+ "if": { "properties": { "type": { "const": "key" } }, "required": ["type"] },
83
+ "then": { "properties": { "login": false, "card": false, "identity": false, "account": false } }
84
+ },
85
+ {
86
+ "if": { "properties": { "type": { "const": "account" } }, "required": ["type"] },
87
+ "then": { "properties": { "login": false, "card": false, "identity": false, "key": false } }
88
+ },
89
+ {
90
+ "$comment": "Password history is defined only for logins.",
91
+ "if": { "not": { "properties": { "type": { "const": "login" } }, "required": ["type"] } },
92
+ "then": { "properties": { "history": { "type": "array", "maxItems": 0 } } }
93
+ }
94
+ ],
95
+ "$defs": {
96
+ "uuid": {
97
+ "type": "string",
98
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
99
+ },
100
+ "timestamp": { "type": "string", "format": "date-time" },
101
+ "itemType": {
102
+ "type": "string",
103
+ "enum": ["login", "card", "identity", "note", "key", "account"],
104
+ "description": "Type codes 1 login, 2 card, 3 identity, 4 note, 5 key, 6 account. Codes 1-4 are fixed by a deployed vault and MUST NOT be renumbered; 5 and 6 are introduced by OpenCreds; 7+ are reserved."
105
+ },
106
+ "customField": {
107
+ "type": "object",
108
+ "required": ["name", "value", "type"],
109
+ "additionalProperties": false,
110
+ "properties": {
111
+ "name": { "type": "string" },
112
+ "value": { "type": "string" },
113
+ "type": { "type": "string", "enum": ["text", "hidden", "boolean", "linked"] },
114
+ "hidden": { "type": "boolean", "default": false }
115
+ }
116
+ },
117
+ "attachment": {
118
+ "type": "object",
119
+ "required": ["id", "name"],
120
+ "additionalProperties": false,
121
+ "properties": {
122
+ "id": { "type": "string" },
123
+ "name": { "type": "string" },
124
+ "size": { "type": "integer", "minimum": 0 },
125
+ "contentType": { "type": "string" },
126
+ "digest": { "type": "string", "description": "sha256-<base64> over the plaintext blob." },
127
+ "key": {
128
+ "type": "string",
129
+ "description": "Base64 AES-256 key the blob was encrypted under, held inside the item ciphertext so the blob store never sees it."
130
+ }
131
+ }
132
+ },
133
+ "historyEntry": {
134
+ "type": "object",
135
+ "required": ["password", "changedAt"],
136
+ "additionalProperties": false,
137
+ "properties": {
138
+ "password": { "type": "string" },
139
+ "changedAt": { "$ref": "#/$defs/timestamp" }
140
+ }
141
+ },
142
+ "uri": {
143
+ "type": "object",
144
+ "required": ["uri"],
145
+ "additionalProperties": false,
146
+ "properties": {
147
+ "uri": { "type": "string" },
148
+ "match": {
149
+ "type": "string",
150
+ "enum": ["domain", "host", "startsWith", "exact", "regex", "never"],
151
+ "default": "domain",
152
+ "description": "Carried so that a move does not silently widen where a credential will be offered. An implementation that does not autofill still round-trips it."
153
+ }
154
+ }
155
+ },
156
+ "loginGroup": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "username": { "type": "string" },
161
+ "password": { "type": "string" },
162
+ "totp": {
163
+ "type": "string",
164
+ "description": "An otpauth:// URI, or a bare base32 seed. Store the URI where you have it: it carries the algorithm, digits and period, and a bare seed loses them."
165
+ },
166
+ "uris": { "type": "array", "items": { "$ref": "#/$defs/uri" } }
167
+ }
168
+ },
169
+ "cardGroup": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "properties": {
173
+ "cardholderName": { "type": "string" },
174
+ "brand": { "type": "string", "description": "Free text; issuers add brands." },
175
+ "number": { "type": "string" },
176
+ "expMonth": { "type": "string", "description": "1-12, no leading zero required." },
177
+ "expYear": { "type": "string", "description": "Four digits. Two-digit years from an import are expanded to 20xx." },
178
+ "code": { "type": "string" }
179
+ }
180
+ },
181
+ "identityGroup": {
182
+ "type": "object",
183
+ "additionalProperties": false,
184
+ "properties": {
185
+ "title": { "type": "string" },
186
+ "firstName": { "type": "string" },
187
+ "middleName": { "type": "string" },
188
+ "lastName": { "type": "string" },
189
+ "username": { "type": "string" },
190
+ "company": { "type": "string" },
191
+ "email": { "type": "string" },
192
+ "phone": { "type": "string" },
193
+ "address1": { "type": "string" },
194
+ "address2": { "type": "string" },
195
+ "address3": { "type": "string" },
196
+ "city": { "type": "string" },
197
+ "state": { "type": "string" },
198
+ "postalCode": { "type": "string" },
199
+ "country": { "type": "string" },
200
+ "ssn": { "type": "string", "description": "National identity number. Named ssn for import compatibility; it is not US-specific." },
201
+ "passportNumber": { "type": "string" },
202
+ "licenseNumber": { "type": "string" }
203
+ }
204
+ },
205
+ "keyGroup": {
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "description": "SSH and PGP keys, API tokens, certificates, and the .env secrets that Credential Sharing synchronizes. path and mode exist so a restore is total: a private key written back with the wrong mode is a key ssh will refuse to use, and one written to the wrong path is a key nothing finds.",
209
+ "properties": {
210
+ "keyType": { "type": "string", "enum": ["ssh", "pgp", "api", "symmetric", "certificate", "env"] },
211
+ "algorithm": { "type": "string" },
212
+ "publicKey": { "type": "string" },
213
+ "privateKey": { "type": "string" },
214
+ "passphrase": { "type": "string" },
215
+ "fingerprint": { "type": "string", "description": "SHA256:… — a public, non-secret identifier." },
216
+ "value": { "type": "string", "description": "The secret for key types that are one opaque string (api, env, symmetric)." },
217
+ "path": { "type": "string" },
218
+ "mode": { "type": "string", "pattern": "^0?[0-7]{3}$" },
219
+ "expiresAt": { "type": "string" }
220
+ }
221
+ },
222
+ "accountGroup": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "description": "A provider account and the tokens that authorize acting as it. Deliberately not a login: a login is what a person types at a sign-in form, an account is what a machine presents to an API. They expire differently and are revoked differently, and conflating them is how a rotated refresh token ends up in a password history array.",
226
+ "properties": {
227
+ "provider": { "type": "string", "description": "google, github, x, stripe, … An OpenOntology entity id where one is in use." },
228
+ "accountId": { "type": "string" },
229
+ "handle": { "type": "string" },
230
+ "email": { "type": "string" },
231
+ "accessToken": { "type": "string" },
232
+ "refreshToken": { "type": "string" },
233
+ "tokenType": { "type": "string" },
234
+ "scopes": { "type": "array", "items": { "type": "string" } },
235
+ "expiresAt": { "type": "string" },
236
+ "environment": { "type": "string", "description": "production, sandbox, … A test key and a live key look identical and are not." }
237
+ }
238
+ }
239
+ }
240
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/manifest.schema.json",
4
+ "title": "OpenCreds Database Manifest",
5
+ "description": "The authenticated inventory of a portable database. In an encrypted database the manifest sits in the header, which is bound as additional authenticated data over the payload — so the counts can be shown in a preview before anyone types a passphrase, and they cannot be lied about. After decrypting, an implementation MUST recompute all four fields and MUST refuse the import if any disagrees. This is the difference between an import you can trust and a CSV: a CSV truncated at 3,000 rows imports 3,000 rows and reports success.",
6
+ "type": "object",
7
+ "required": ["itemCount", "types", "folderCount", "digest"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "itemCount": { "type": "integer", "minimum": 0 },
11
+ "types": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "description": "Item count per type name. Types with zero items are omitted.",
15
+ "properties": {
16
+ "login": { "type": "integer", "minimum": 1 },
17
+ "card": { "type": "integer", "minimum": 1 },
18
+ "identity": { "type": "integer", "minimum": 1 },
19
+ "note": { "type": "integer", "minimum": 1 },
20
+ "key": { "type": "integer", "minimum": 1 },
21
+ "account": { "type": "integer", "minimum": 1 }
22
+ }
23
+ },
24
+ "folderCount": { "type": "integer", "minimum": 0 },
25
+ "digest": {
26
+ "type": "string",
27
+ "pattern": "^[A-Za-z0-9+/]*={0,2}$",
28
+ "description": "Base64 SHA-256 over the item ids, sorted lexicographically and joined by a newline. Detects a dropped item and a re-ordered payload alike."
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://logicsrc.com/schemas/opencreds/vault-meta.schema.json",
4
+ "title": "OpenCreds Vault Metadata",
5
+ "description": "Per-vault key material and parameters. Every value here is encrypted or derived on the client; nothing in this document can be decrypted with anything a server, its backups, or an operator with full access can see. Key material is base64 text rather than binary because this travels as JSON over HTTP, where binary round-trips as an escaped hex string and invites encoding mistakes on exactly the values that must not be corrupted.",
6
+ "type": "object",
7
+ "required": ["opencreds", "namespace", "profile", "kdf", "kdfIterations", "kdfSalt", "protectedUserKey", "protectedUserKeyIv"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "opencreds": { "type": "string", "const": "0.1" },
11
+ "namespace": {
12
+ "$ref": "#/$defs/namespace",
13
+ "description": "Domain-separation label prefix. Carried as data because labels are compiled into the additional authenticated data of every ciphertext a vault has written: editing one does not migrate a vault, it makes it undecryptable. Registered: opencreds, marksyncr."
14
+ },
15
+ "profile": {
16
+ "type": "string",
17
+ "enum": ["user", "team"],
18
+ "description": "How the user key is managed. user: wrapped by a key derived from a master password. team: sealed to each member's X25519 public key. The item envelope is identical under both. An implementation MUST refuse a profile it does not implement rather than attempting to open the vault."
19
+ },
20
+ "kdf": {
21
+ "type": "string",
22
+ "enum": ["pbkdf2-sha256", "argon2id"],
23
+ "description": "argon2id is registered and not yet specified. A client that does not implement it MUST refuse the vault rather than fall back."
24
+ },
25
+ "kdfIterations": {
26
+ "type": "integer",
27
+ "minimum": 100000,
28
+ "default": 600000,
29
+ "description": "Floor enforced in the client before deriving anything. These parameters arrive from a server, which makes them attacker-controlled if the server is compromised: serving 1 would turn every captured auth hash into an offline guessing exercise with no work factor."
30
+ },
31
+ "kdfMemoryKib": { "type": "integer", "minimum": 1, "description": "Reserved for argon2id." },
32
+ "kdfParallelism": { "type": "integer", "minimum": 1, "description": "Reserved for argon2id." },
33
+ "kdfSalt": { "$ref": "#/$defs/base64", "description": "Per vault, random, at least 16 bytes." },
34
+ "protectedUserKey": {
35
+ "$ref": "#/$defs/base64",
36
+ "description": "The 32-byte random user key, encrypted under the wrap key. Random rather than derived, so a master password change re-wraps 32 bytes instead of re-encrypting every item."
37
+ },
38
+ "protectedUserKeyIv": { "$ref": "#/$defs/base64" },
39
+ "recoveryKeyBlob": {
40
+ "$ref": "#/$defs/base64",
41
+ "description": "A second copy of the same user key under the recovery key, so a forgotten master password is survivable without the server learning anything."
42
+ },
43
+ "recoveryKeyIv": { "$ref": "#/$defs/base64" },
44
+ "authHash": {
45
+ "$ref": "#/$defs/base64",
46
+ "description": "The only password-derived value that may leave the device. It comes out of a different HKDF label than the wrap key, so holding every auth hash ever sent does not help derive a wrapping key. A server storing it MUST hash it again."
47
+ },
48
+ "wrappedKeys": {
49
+ "type": "array",
50
+ "description": "team profile only: one sealed copy of the vault key per member. The server holds these and never the key.",
51
+ "items": {
52
+ "type": "object",
53
+ "required": ["memberId", "publicKey", "wrappedKey"],
54
+ "additionalProperties": false,
55
+ "properties": {
56
+ "memberId": { "type": "string" },
57
+ "publicKey": { "$ref": "#/$defs/base64" },
58
+ "wrappedKey": { "$ref": "#/$defs/base64" },
59
+ "grantedAt": { "type": "string", "format": "date-time" }
60
+ }
61
+ }
62
+ },
63
+ "createdAt": { "type": "string", "format": "date-time" },
64
+ "updatedAt": { "type": "string", "format": "date-time" }
65
+ },
66
+ "$defs": {
67
+ "base64": { "type": "string", "pattern": "^[A-Za-z0-9+/]*={0,2}$" },
68
+ "namespace": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" }
69
+ }
70
+ }