The eleven W1 test cases · Chapter 4 of 6

Produce or read the bytes

Use the profile clock 1700000000 seconds since the Unix epoch as time zero. All origin and key names are fixtures. The service is https://compute.example, the account is lab, the project is p7, the purpose is simulation, and the shared pool is pool-p7 with ten credits. The original planner key is root1. Workers use a1 and b1, and the replacement for worker A uses a2. The keys named human, admission, delegator, appraiser, state, resource, keeper, and recovery exercise the roles in the companion. A holder signs its join. Its current parent signs a child grant request.

  1. For each objects[name] use signer and claims to construct the compact signed object. The x in the key entry is the raw 32-byte public key encoded as unpadded base64url. testSeed encodes a 32-byte Ed25519 signing seed in the same alphabet. The protected JWS algorithm is Ed25519. compact is the expected output.
  2. For each messages[name] start from input and the entry's absolute created time. In a request body replace each chain label and the appraisal label with the corresponding newly produced compact strings. In a response replace any non-null evidence label likewise, and insert requestRef computed from the named request's HTTP Signature field value. The response inputs deliberately include properly signed statements for the wrong recipient or outcome. A valid signature alone is insufficient to accept them.
  3. Serialize the body using the restricted canonical JSON in the companion. Build the signature base with LF between component lines and no LF at the end. The HTTP signature algorithm identifier is lowercase ed25519. In the request, cover "@method" "@target-uri" "content-type" "content-digest" in order. In the response, cover "@status" "content-type" "content-digest" "@method";req "@target-uri";req "content-digest";req. Include the final "@signature-params" line in each base. The signing interval in each golden message is 30 seconds.
  4. For the producer byte challenge, use POST <path> HTTP/1.1 or HTTP/1.1 <status> <reason>, then fields in the order below. The status phrases are OK, Accepted, Forbidden, Conflict and Service Unavailable for 200, 202, 403, 409 and 503 respectively. Use one space after the field-name colon, CRLF between lines, a CRLF blank line, and the exact body with no trailing newline.
  5. Three entries instead specify source, oldAscii, and newAscii. Replace the single occurrence in the source packet byte string after signing. They have baseB64: null and must fail verification. For every entry, compare the raw wire SHA-256, padded standard Base64 wireB64, and any supplied baseB64. The diagnostic base is the one the producer signed. The receiver derives its own base from the packet and the request association.
Request field order Response field order
Host: compute.example Cache-Control: private, no-store
Content-Type: application/json Content-Type: application/json
Content-Digest Content-Digest
Signature-Input Signature-Input
Signature Signature
Content-Length Content-Length

To inspect a complete byte example, run the following from this directory. Changing baseB64 to wireB64 prints the transmitted packet.

node -e "const f=require('./fixtures.json'); process.stdout.write(Buffer.from(f.messages['charge-a'].baseB64,'base64'))"