-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2260 lines (2206 loc) · 70.2 KB
/
Copy pathopenapi.yaml
File metadata and controls
2260 lines (2206 loc) · 70.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: HTMLTrust Directory API
description: |
Reference implementation of the HTMLTrust trust directory API. Provides endpoints
for author management, content signing and verification, claims, and a federated
trust directory with reputation tracking. The canonical v1 directory paths
use RFC 9421 authentication for writes, negotiate the HTMLTrust JSON media
types (with application/json as a compatibility representation), and use
standard Cache-Control, ETag, and Vary headers on public reads.
version: 1.0.0
contact:
name: HTMLTrust
url: https://github.com/HTMLTrust/htmltrust-server-reference
email: jason@jason-grey.com
license:
name: PolyForm Noncommercial License 1.0.0
url: https://polyformproject.org/licenses/noncommercial/1.0.0/
servers:
- url: /
description: Same origin as the API document
tags:
- name: Authors
description: Operations related to author management and key pairs
- name: Content
description: Operations for signing and verifying content
- name: Claims
description: Operations for managing claim types and assertions
- name: Directory
description: Operations for the Network of Trust directory services
- name: Keys
description: Draft HTMLTrust key document lookup
- name: Signers
description: Draft signer reputation lookup
- name: Endorsements
description: |
Operations for storing and retrieving third-party endorsements per
HTMLTrust spec §2.5. Endorsements are standalone signed JSON blobs
that attest a third party's opinion about a specific content hash.
The directory is a passive store; verification is performed locally
by the client.
security:
- {} # No default security
components:
securitySchemes:
HttpSignatureInput:
type: apiKey
in: header
name: Signature-Input
description: |
RFC 9421 signature metadata. Send this header together with the
`Signature` header represented by `HttpMessageSignature`.
HttpMessageSignature:
type: apiKey
in: header
name: Signature
description: |
RFC 9421 HTTP Message Signature, the scheme draft §9.8 REQUIRES for
POST endpoints: "POST endpoints MUST be authenticated using HTTP
Message Signatures [RFC9421] with a key that the directory can resolve
via Section 8."
The request carries `Signature-Input` and `Signature` header fields.
For the canonical v1 POST endpoints, `sig1` MUST cover exactly these
components in this order: `@method`, `@target-uri`, `host`, `date`,
and `content-digest` (RFC 9530). The
`keyid` signature parameter is resolved per draft §8 (DID, HTTPS key
document, or a directory `/keys/{id}` reference) and the signature is
verified against that key, so the authenticated identity is the key
itself rather than a shared secret.
Example:
Signature-Input: sig1=("@method" "@target-uri" "host" "date" \
"content-digest");created=1770000000;keyid="https://directory.example/keys/k-abc123";alg="ed25519"
Signature: sig1=:BASE64_ED25519_SIGNATURE:
Failed verification returns 401 with a
`WWW-Authenticate: Signature realm="htmltrust-directory"` challenge
and an `application/problem+json` body.
AuthorApiKey:
type: apiKey
in: header
name: X-AUTHOR-API-KEY
description: |
Supplementary scheme. API key linked to a specific author, used by the
directory's own convenience signing endpoint. It is a bearer secret,
not a resolvable identity, and is refused when NODE_ENV=production
unless HTMLTRUST_ALLOW_API_KEY_AUTH=1 is set.
GeneralApiKey:
type: apiKey
in: header
name: X-API-KEY
description: |
Supplementary demo/admin scheme for submission endpoints. A shared
secret proves nothing about who submitted a record, so it cannot carry
the submitter identity the protocol depends on; prefer the paired
HttpSignatureInput and HttpMessageSignature schemes. Refused when NODE_ENV=production unless
HTMLTRUST_ALLOW_API_KEY_AUTH=1 is set.
AdminApiKey:
type: apiKey
in: header
name: X-ADMIN-API-KEY
description: Admin-level API key for directory-operator operations
schemas:
Problem:
type: object
description: |
RFC 9457 problem details, the error format draft §9.9 requires. Served
as `application/problem+json`.
required:
- type
- title
- status
properties:
type:
type: string
description: URI identifying the problem type
title:
type: string
description: Short human-readable summary of the problem type
status:
type: integer
description: HTTP status code
detail:
type: string
description: Human-readable explanation specific to this occurrence
contentHash:
type: string
description: Present on submission errors that concern a specific content hash
example:
type: "https://htmltrust.org/errors/signature-invalid"
title: "Signature verification failed"
status: 400
detail: "The endorsement signature did not verify against the canonical JSON payload."
Error:
type: object
description: |
Legacy error envelope, still returned by endpoints outside the
authentication, endorsement, and content paths. New code should expect
`Problem`.
required:
- code
- message
properties:
code:
type: string
description: Error code
message:
type: string
description: Error message
details:
type: object
description: Additional error details
example:
code: "UNAUTHORIZED"
message: "Invalid API key"
Author:
type: object
required:
- id
- name
- keyType
- createdAt
properties:
id:
type: string
format: uuid
description: Unique identifier for the author
name:
type: string
description: Name of the author
description:
type: string
description: Description of the author
url:
type: string
format: uri
description: URL associated with the author
keyType:
type: string
enum: [HUMAN, AI, HUMAN_AI_MIX, ORGANIZATION]
description: Type of the author key
createdAt:
type: string
format: date-time
description: Creation timestamp
updatedAt:
type: string
format: date-time
description: Last update timestamp
example:
id: "123e4567-e89b-12d3-a456-426614174000"
name: "John Doe"
description: "Technology writer and researcher"
url: "https://johndoe.example.com"
keyType: "HUMAN"
createdAt: "2023-01-01T12:00:00Z"
updatedAt: "2023-01-01T12:00:00Z"
PublicKey:
type: object
required:
- id
- authorId
- key
- algorithm
- createdAt
properties:
id:
type: string
description: Opaque public identifier for the key document
pattern: "^(k_[A-Za-z0-9_-]{20,64}|[0-9A-Fa-f]{24})$"
authorId:
type: string
format: uuid
description: ID of the author this key belongs to
key:
type: string
description: Legacy public key in PEM format
algorithm:
type: string
description: The cryptographic algorithm used
enum: [RSA, ECDSA, ED25519, ed25519, ecdsa-p256, ecdsa-p384, rsa-pkcs1-sha256, rsa-pss-sha256]
createdAt:
type: string
format: date-time
description: Creation timestamp
expiresAt:
type: string
format: date-time
description: Expiration timestamp (if applicable)
example:
id: "k_2Y7mB8xQ4nP6rT9vW3zA5cD7eF"
authorId: "123e4567-e89b-12d3-a456-426614174000"
key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...\n-----END PUBLIC KEY-----"
algorithm: "RSA"
createdAt: "2023-01-01T12:00:00Z"
expiresAt: "2024-01-01T12:00:00Z"
DirectoryDiscovery:
type: object
required: [directory, version, capabilities, supportedAlgorithms, supportedProfiles]
properties:
directory:
type: string
format: uri
version:
type: string
capabilities:
type: object
required: [content, endorsements, keys, reputation]
properties:
content: { type: boolean }
endorsements: { type: boolean }
keys: { type: boolean }
reputation: { type: boolean }
supportedAlgorithms:
type: object
properties:
signature:
type: array
items: { type: string }
hash:
type: array
items: { type: string }
supportedProfiles:
type: array
items: { type: string }
KeyDocument:
type: object
required: [algorithm, publicKey, publicKeyEncoding]
properties:
kid:
type: string
algorithm:
type: string
enum: [ed25519, ecdsa-p256, ecdsa-p384, rsa-pss-sha256, rsa-pkcs1-sha256]
publicKey:
type: string
description: Canonical unpadded standard Base64 SPKI DER public key bytes.
publicKeyEncoding:
enum: [spki-der]
type: string
description: Reference-server extension describing how publicKey was derived from the stored PEM.
publicKeyPem:
type: string
description: Legacy PEM compatibility field.
expires:
type: string
format: date-time
revoked:
type: boolean
ContentRecord:
type: object
required: [contentHash, firstSeen, signers, endorsementCount]
properties:
contentHash:
type: string
description: Hash with algorithm prefix and canonical unpadded standard Base64 digest.
firstSeen:
type: string
format: date-time
signers:
type: array
items:
type: object
required: [profile, keyid, algorithm, signedAt, scope, location, signature]
properties:
profile:
type: string
keyid:
type: string
algorithm:
type: string
signedAt:
type: string
format: date-time
scope:
type: string
enum: [url, origin]
location:
type: string
format: uri
signature:
type: string
description: Canonical unpadded standard Base64 signature.
endorsementCount:
type: integer
ContentSubmission:
type: object
required: [profile, contentHash, keyid, algorithm, signedAt, scope, location, signature, sourceURL, claims]
properties:
profile:
type: string
enum: [htmltrust-signature-v1]
contentHash:
type: string
keyid:
type: string
algorithm:
type: string
enum: [ed25519, ecdsa-p256, ecdsa-p384, rsa-pss-sha256, rsa-pkcs1-sha256]
signedAt:
type: string
format: date-time
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
scope:
type: string
enum: [url, origin]
location:
type: string
format: uri
signature:
type: string
description: Canonical unpadded standard Base64 signature.
sourceURL:
type: string
format: uri
pattern: "^[hH][tT][tT][pP][sS]://"
claims:
type: array
items:
type: object
required: [name, content]
additionalProperties: false
properties:
name: { type: string }
content: { type: string }
SignerReputation:
type: object
required: [keyid, score, asOf, components]
properties:
keyid:
type: string
score:
type: number
minimum: 0
maximum: 1
asOf:
type: string
format: date-time
components:
type: array
items: { type: string }
methodology:
type: string
format: uri
Claim:
type: object
required:
- id
- name
- description
properties:
id:
type: string
format: uuid
description: Unique identifier for the claim type
name:
type: string
description: Name of the claim type
description:
type: string
description: Description of what this claim type represents
possibleValues:
type: array
description: Possible values for this claim type (if applicable)
items:
type: string
createdAt:
type: string
format: date-time
description: Creation timestamp
updatedAt:
type: string
format: date-time
description: Last update timestamp
example:
id: "123e4567-e89b-12d3-a456-426614174002"
name: "ContentType"
description: "The type of content being signed"
possibleValues: ["Article", "Image", "Video", "Audio", "Dataset"]
createdAt: "2023-01-01T12:00:00Z"
updatedAt: "2023-01-01T12:00:00Z"
V1ContentSignature:
type: object
required:
- profile
- context
- canonicalizationProfile
- attributeProfile
- urlProfile
- contentHash
- claimsHash
- signedAt
- scope
- location
- sourceURL
- keyid
- algorithm
- signature
- claims
properties:
profile:
type: string
enum: [htmltrust-signature-v1]
context:
type: string
format: uri
canonicalizationProfile:
type: string
enum: [htmltrust-c14n-v1]
attributeProfile:
type: string
enum: [htmltrust-attrs-v1]
urlProfile:
type: string
enum: [htmltrust-safe-url-v1]
contentHash:
type: string
description: Hash of the canonical signed content
claimsHash:
type: string
description: Directory-computed hash of the canonical v1 claims serialization
signedAt:
type: string
description: Exact UTC timestamp in YYYY-MM-DDTHH:MM:SSZ form
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
scope:
type: string
enum: [url, origin]
location:
type: string
format: uri
description: URL or origin derived from sourceURL under scope
sourceURL:
type: string
format: uri
description: Final HTTPS occurrence URL
pattern: "^[hH][tT][tT][pP][sS]://"
keyid:
type: string
description: Exact directory key identifier bound into the JCS payload
algorithm:
type: string
description: Canonical signature algorithm identifier
signature:
type: string
description: Signature over the RFC 8785 JCS v1 signing payload
claims:
type: array
items:
type: object
required: [name, content]
additionalProperties: false
properties:
name: { type: string }
content: { type: string }
authorId:
type: string
description: Directory author that owns the signing key
domain:
type: string
format: uri
description: Occurrence origin retained for compatibility and indexing
createdAt:
type: string
format: date-time
ContentSignature:
type: object
required:
- contentHash
- claimsHash
- signedAt
- domain
- authorId
- keyid
- algorithm
- signature
- claims
properties:
contentHash:
type: string
description: Hash of the normalized content using canonical unpadded standard Base64
claimsHash:
type: string
description: Hash of all direct child meta claims using the same hash algorithm as contentHash
signedAt:
type: string
description: UTC RFC3339 timestamp from the direct child signed-at claim
domain:
type: string
description: Serialized Web origin associated with the content; bare hostnames are invalid
authorId:
type: string
format: uuid
description: ID of the author who signed the content
keyid:
type: string
description: Resolvable identifier for the signing key
algorithm:
type: string
description: Signature algorithm identifier from the registry
signature:
type: string
description: Canonical unpadded standard Base64 signature over contentHash:claimsHash:domain:signedAt
claims:
type: object
description: Claims about the content
additionalProperties: true
createdAt:
type: string
format: date-time
description: Creation timestamp
example:
contentHash: "sha256:RAyBCvKTW5KNnGZSyXZYe+8V8DEEnUMRxjk5LSgCHo4"
claimsHash: "sha256:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU"
signedAt: "2026-05-01T10:30:00Z"
domain: "https://example.com"
authorId: "123e4567-e89b-12d3-a456-426614174000"
keyid: "https://directory.example/keys/k_2Y7mB8xQ4nP6rT9vW3zA5cD7eF"
algorithm: "ed25519"
signature: "MEUCIQD7y5SxmQJ9f0lE9B0BwqIJKKdL5fZMNQOiPnKWUJfmrgIgEbHtPwDxM9xGbCZzW9k2R9jFxwJZQQlPfhgj+0YP7vQ="
claims:
ContentType: "Article"
License: "CC-BY-4.0"
AIAssistance: "Minimal"
createdAt: "2023-01-01T12:00:00Z"
KeyReputation:
type: object
required:
- keyId
- trustScore
- verifiedSignatures
properties:
keyId:
type: string
description: Opaque public key id, or a legacy ObjectId accepted by the compatibility route
trustScore:
type: number
format: float
minimum: 0
maximum: 1
description: Trust score between 0 and 1
verifiedSignatures:
type: integer
description: Number of verified signatures using this key
reports:
type: integer
description: Number of reports against this key
lastUpdated:
type: string
format: date-time
description: Last update timestamp
example:
keyId: "k_2Y7mB8xQ4nP6rT9vW3zA5cD7eF"
trustScore: 0.95
verifiedSignatures: 1250
reports: 2
lastUpdated: "2023-01-01T12:00:00Z"
ContentOccurrence:
type: object
required:
- url
- domain
- firstSeen
properties:
url:
type: string
format: uri
description: URL where the content was found
domain:
type: string
description: Domain where the content was found
firstSeen:
type: string
format: date-time
description: When the content was first seen at this location
lastSeen:
type: string
format: date-time
description: When the content was last seen at this location
authorId:
type: string
format: uuid
description: ID of the author who signed the content at this location (if any)
signatureValid:
type: boolean
description: Whether the signature at this location is valid
example:
url: "https://example.com/article/123"
domain: "example.com"
firstSeen: "2023-01-01T12:00:00Z"
lastSeen: "2023-01-02T12:00:00Z"
authorId: "123e4567-e89b-12d3-a456-426614174000"
signatureValid: true
Endorsement:
type: object
description: |
A standalone signed endorsement document per draft §10.1.
The directory verifies the endorser's signature over
JCS(document minus `signature`) before storing it (§9.7), and serves
every submitted member without adding fields of its own. Section 10.1
requires unrecognised members to be preserved and
included in the signed payload, so an injected `_id`, `createdAt`, or
`contentHash` alias would invalidate the endorser's signature for
anyone who recomputes it. The server-assigned identifier is returned
in the `Location` header of the 201 response instead.
Additional members not listed here MAY be present and are preserved.
required:
- endorser
- endorsement
- algorithm
- signature
- timestamp
properties:
endorser:
type: string
description: Endorser keyid, resolvable per draft §8 (e.g. "did:web:publisher.org")
endorsement:
type: string
description: Content hash being endorsed, including algorithm prefix
signature:
type: string
description: Canonical unpadded standard Base64 signature over JCS(document with signature omitted)
timestamp:
type: string
description: RFC 3339 UTC timestamp at which the endorsement was issued
algorithm:
type: string
description: Signature algorithm identifier from draft §7.1
claim:
type: string
description: Free-text human-readable rationale for the endorsement
expires:
type: string
description: RFC 3339 UTC timestamp after which the endorsement is no longer valid
revokedBy:
type: string
description: Content hash of the document that supersedes this one
contentHash:
type: string
deprecated: true
description: |
Legacy alias for `endorsement`. Only present on documents stored
before the directory began serving submissions verbatim; new
submissions are served exactly as signed.
example:
endorser: "did:web:publisher.org"
endorsement: "sha256:RAyBCvKTW5KNnGZSyXZYe+8V8DEEnUMRxjk5LSgCHo4"
signature: "BASE64_SIG"
timestamp: "2025-05-01T00:00:00Z"
algorithm: "ed25519"
paths:
/.well-known/htmltrust:
get:
tags:
- Directory
summary: Discover trust directory capabilities
operationId: discoverDirectory
responses:
"200":
description: Directory discovery document
headers:
Cache-Control:
schema: { type: string }
ETag:
schema: { type: string }
Vary:
schema: { type: string }
content:
application/htmltrust-directory+json:
schema:
$ref: "#/components/schemas/DirectoryDiscovery"
application/json:
schema:
$ref: "#/components/schemas/DirectoryDiscovery"
"406":
description: Requested representation is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
/keys/{id}:
get:
tags:
- Keys
summary: Retrieve a draft HTMLTrust key document
operationId: getKeyDocument
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: "^(k_[A-Za-z0-9_-]{20,64}|[0-9A-Fa-f]{24})$"
responses:
"200":
description: Key document
headers:
Cache-Control:
schema: { type: string }
ETag:
schema: { type: string }
Vary:
schema: { type: string }
content:
application/htmltrust-key+json:
schema:
$ref: "#/components/schemas/KeyDocument"
application/json:
schema:
$ref: "#/components/schemas/KeyDocument"
"404":
description: Key not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"400":
description: Invalid key identifier
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"406":
description: Requested representation is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"500":
description: Directory could not read the key document
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
/signers/{id}/reputation:
get:
tags:
- Signers
summary: Retrieve directory-computed signer reputation
operationId: getSignerReputation
parameters:
- name: id
in: path
required: true
description: Directory key id, author id, or percent-encoded keyid.
schema:
type: string
responses:
"200":
description: Signer reputation
headers:
Cache-Control:
schema: { type: string }
ETag:
schema: { type: string }
Vary:
schema: { type: string }
content:
application/json:
schema:
$ref: "#/components/schemas/SignerReputation"
"404":
description: Signer not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"400":
description: Invalid signer identifier
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"406":
description: Requested representation is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"500":
description: Directory could not read signer reputation
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
/content:
post:
tags:
- Content
summary: Submit a signed content occurrence for indexing
description: |
Canonical HTMLTrust v1 directory submission endpoint. The directory
recomputes the claims hash from the complete `claims` array and
re-verifies the v1 JCS signing payload. `location` must be derived
from `sourceURL` according to `scope`; callers cannot submit a
precomputed `claimsHash`.
operationId: submitContent
security:
- HttpSignatureInput: []
HttpMessageSignature: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ContentSubmission"
application/htmltrust-content+json:
schema:
$ref: "#/components/schemas/ContentSubmission"
responses:
"201":
description: Content record created
headers:
Cache-Control:
schema: { type: string }
Location:
schema: { type: string }
content:
application/htmltrust-content+json:
schema:
$ref: "#/components/schemas/ContentRecord"
application/json:
schema:
$ref: "#/components/schemas/ContentRecord"
"400":
description: Invalid submission
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"401":
description: Missing or invalid HTTP Message Signature
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"406":
description: Requested representation is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"415":
description: Request body media type is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"500":
description: Verified content could not be stored
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
/content/{hash}:
get:
tags:
- Content
summary: Retrieve a draft content record by content hash
operationId: getContentRecord
parameters:
- name: hash
in: path
required: true
description: Percent-encoded content hash including algorithm prefix.
schema:
type: string
responses:
"200":
description: Content record
headers:
Cache-Control:
schema: { type: string }
ETag:
schema: { type: string }
Vary:
schema: { type: string }
content:
application/htmltrust-content+json:
schema:
$ref: "#/components/schemas/ContentRecord"
application/json:
schema:
$ref: "#/components/schemas/ContentRecord"
"404":
description: Content not found
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"400":
description: Invalid content hash
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"406":
description: Requested representation is not supported
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
"500":
description: Directory could not read the content record
content:
application/problem+json:
schema:
$ref: "#/components/schemas/Problem"
/content/{hash}/endorsements:
get:
tags:
- Endorsements
summary: List draft structured endorsements for a content hash
operationId: listContentEndorsements
parameters:
- name: hash
in: path
required: true
description: Percent-encoded content hash including algorithm prefix.
schema:
type: string
responses:
"200":
description: Structured endorsement documents
headers:
Cache-Control:
schema: { type: string }
ETag: