Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple status codes #65

Merged
merged 23 commits into from
Jun 26, 2023
Merged
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
740cd8e
chore: initial additions for better caching guidance and backwards co…
mprorock May 24, 2023
e58c806
Apply suggestions from code review
mprorock May 24, 2023
84cc35d
chore: add issue tracker for examples
mprorock May 24, 2023
0160a27
Correct a typo
mprorock May 25, 2023
4caa8d3
Correct typos
mprorock May 25, 2023
08e4d53
remove a double space
mprorock Jun 6, 2023
982ca01
improve language for just bitstring since we have multiple purposes
mprorock Jun 6, 2023
b75fb1a
clean up formatting from code review
mprorock Jun 7, 2023
a59a9dd
chore: updates after a careful read and incorporating an external ref…
mprorock Jun 12, 2023
73cd886
update message to statusMessages for array name based on code review
mprorock Jun 13, 2023
b4b48bf
improve example
mprorock Jun 14, 2023
08174ee
remove redundancy in language
mprorock Jun 14, 2023
637b947
clarify that size is an int
mprorock Jun 14, 2023
2e84cb6
add a default behavior for 0 and 1 to match revocation and suspension
mprorock Jun 14, 2023
fc40fb3
Correct a typo
mprorock Jun 14, 2023
b0d3456
grammar improvements from code review
mprorock Jun 16, 2023
c66ba7d
Apply suggestions from code review re phrasing
mprorock Jun 20, 2023
f9e84f4
remove verify property per special topic call
mprorock Jun 20, 2023
7b9f63c
editorial
mprorock Jun 20, 2023
73b02e0
remove last mention of verify property (i hope)
mprorock Jun 20, 2023
112d203
remove issue tag calling for example now that it has been added
mprorock Jun 20, 2023
d0a58fa
correcting two missing commas in example
mprorock Jun 20, 2023
887f87e
add issue flag
mprorock Jun 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 134 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ <h3>StatusList2021Entry</h3>
<td>statusListIndex</td>
<td>
The <code>statusListIndex</code> property MUST be an arbitrary size integer
greater than or equal to 0, expressed as a string. The value identifies the bit
greater than or equal to 0, expressed as a string. The value identifies the
position of the status of the <a>verifiable credential</a>.
</td>
</tr>
Expand Down Expand Up @@ -446,11 +446,7 @@ <h3>StatusList2021Credential</h3>
The latest point in time at which the status list is valid. This property is
defined in the Verifiable Credentials Data Model specification in
<a href="https://www.w3.org/TR/vc-data-model-2.0/#validity-period">
Section 4.6: Validity Period</a>. Implementations that consume the status list
SHOULD cache the status list <a>verifiable credential</a> until this
time. Implementations that publish the status list are expected to align
any protocol-specific caching information, such as the HTTP `Cache-Control`
header, with the value in this field.
Section 4.6: Validity Period</a>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -488,6 +484,15 @@ <h3>StatusList2021Credential</h3>
This status is reversible.
</td>
</tr>
<tr>
<td><code>status</code></td>
<td>
Used to indicate a status message associated with a <a>verifiable credential</a>.
The status message descriptions MUST be defined in <code>credentialSubject.statusMessages</code>.
<code>credentialSubject.size</code> MUST be defined with this <code>statusPurpose</code>.
<p class="issue" data-number="66">We need to add an example for multiple status codes</p>
</td>
</tr>
</tbody>
</table>
</td>
Expand All @@ -507,7 +512,90 @@ <h3>StatusList2021Credential</h3>
<a href="#bitstring-encoding"></a>.
</td>
</tr>

<tr>
<td>
credentialSubject.ttl
</td>
<td>
The <code>ttl</code> indicates the "time to live" in milliseconds.
This property MAY be present. If not present, implementers MUST
use a value of <code>300000</code> for this property. A verifier
MUST NOT use a cached <code>StatusList2021Credential</code> that was
cached for more than the <code>ttl</code> duration prior to the
start of verification operation on a <a>verifiable credential</a>.
Implementations that publish the status list SHOULD align
any protocol-specific caching information, such as the
HTTP `Cache-Control` header, with the value in this field.
</td>
</tr>
<tr>
<td>
credentialSubject.size
</td>
<td>
The <code>size</code> indicates the size of the status entry in bits.
<code>size</code> MAY be provided. If <code>size</code> is not present
as a property of the <code>credentialStatus</code>, then <code>size</code>
MUST be processed as `1`. <code>size</code> MUST be an integer greater than zero.
If <code>size</code> is provided and is greater than `1`, then the property
<code>credentialStatus.statusMessages</code> MUST be present, and the number of
status messages must equal the number of possible values.
</td>
</tr>
<tr>
<td>
credentialSubject.statusMessages
</td>
<td>
The <code>statusMessages</code> property MUST be an array. If present,
the length of the array must equal the number of possible status states
indicated by <code>size</code>. <code>statusMessages</code> MAY be present if
<code>size</code> is `1`. <code>statusMessages</code> MUST be present if
<code>size</code> is greater than `1`. If not present, the message value
associated with the bit value of <code>0</code> is "unset" and the bit
value of <code>1</code> is "set".
If present, elements in the <code>statusMessages</code> array MUST contain at
minimum two properties:
<ul>
<li><code>status</code>, being a string of the hex value of the status</li>
<li><code>value</code>, being a string containing the associated message</li>
</ul>
Implementers MAY add additional values to objects in the <code>statusMessages</code>
array.
Implementers MAY add a boolean value to elements in the <code>statusMessages</code>
named <code>verify</code> which adds an instruction to verifiers where if the
value of <code>verify</code> is <code>true</code> the verifier SHOULD not
use the status to reject verification of the verifiable credential. If the
value of <code>verify</code> is <code>false</code>, then a verifier SHOULD
NOT verify the verifiable credential.
If <code>verify</code> is present, then the values of `0` and `1` should
be processed identically to the values of `0` and `1` in a status list with a
<code>statusPurpose<code> of <code>suspension</code>.
Implementers MAY use the string value of <code>undefined</code> in the value
to indicate that a status corresponding is not defined for the associated
status value, but that it may be definied in the future.
Rules for how to handle various status messages are outside the scope of
normative reuqirements in this document, but it is assumed that implementers
SHOULD and will document rules for processing various status codes.
</td>
</tr>
<tr>
<td>
credentialSubject.reference
</td>
<td>
The <code>reference</code> property provides a point for implementers to
include a [[URL]] to material related to the status. An implementer MAY include
the <code>reference</code> property, and if they do, the value MUST be a
[[URL]] or an array of URLs. Implementers using a `statusPurpose` of `status`
are strongly encouraged to provide a <code>reference</code>.
<p class="note" title="Details around reference">
<code>reference</code> is especially important when interpertation of the
status for a credential may involve some understanding of the business case
involved.
</p>
</td>
</tr>
</tbody>
</table>

Expand All @@ -530,6 +618,33 @@ <h3>StatusList2021Credential</h3>
"proof": { ... }
}
</pre>
<pre class="example nohighlight" title="Example StatusList2021Credential">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "<span class="highlight">https://example.com/credentials/status/3</span>",
"type": ["VerifiableCredential", "<span class="highlight">StatusList2021Credential</span>"],
"issuer": "did:example:12345",
"issued": "2021-04-05T14:27:40Z",
"credentialSubject": {
"id": "https://example.com/status/3#list",
"type": "<span class="highlight">StatusList2021</span>",
"ttl": 500,
"statusPurpose": "<span class="highlight">status</span>",
"reference": "https://example.org/status-dictionary/"
"size": 2
"statusMessages": [
{"status":"0x0", "value":"valid", "verify": true},
{"status":"0x1", "value":"invalid", "verify": false},
{"status":"0x2", "value":"pending_review", "verify": true},
...
],
"encodedList": "H4sIAAAAAAAAA-3BMQEAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"
}
}
</pre>
</section>

</section>
Expand Down Expand Up @@ -620,12 +735,16 @@ <h3>Validate Algorithm</h3>
<a href="#bitstring-expansion-algorithm">Bitstring Expansion Algorithm</a>.
</li>
<li>
Let <strong>status</strong> be the value of the bit at position
<strong>credentialIndex</strong> in the <strong>revocation bitstring</strong>.
Let <strong>status</strong> be the value at the position indicated by the
<strong>credentialIndex</strong> times the <strong>size</strong> in the
<strong>bitstring</strong>.
</li>
<li>
Return <code>true</code> if <strong>status</strong> is 1, <code>false</code>
otherwise.
For <code>statusPurpose</code> of <code>revocation</code> or <code>suspension</code>,
return <code>true</code> if <code>status</code> is `1`, and return <code>false</code>
if <code>status</code> has any other value. For other <code>statusPurpose</code>,
return the corresponding <code>value</code> of the <code>status</code>
as indicated in the <code>statusMessages</code> array.
</li>
</ol>
</section>
Expand All @@ -645,10 +764,11 @@ <h3>Bitstring Generation Algorithm</h3>
where each bit is initialized to 0 (zero).
</li>
<li>
For each bit in <strong>bitstring</strong>, if there is a
For each value in <code>bitstring</code>, if there is a
corresponding <code>statusListIndex</code> value in
a revoked credential in <strong>issuedCredentials</strong>, set the bit to
1 (one), otherwise set the bit to 0 (zero).
a credential in <code>issuedCredentials</code>, set the value to the
appropriate status. The position of the value is computed as <code>statusListIndex</code>
times the <code>size</code>.
</li>
<li>
Generate a <strong>compressed bitstring</strong> by using the GZIP
Expand Down