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

Add option for Plain Status List and reorder document #57

Closed
wants to merge 14 commits into from
Closed
283 changes: 177 additions & 106 deletions draft-looker-oauth-jwt-cwt-status-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ normative:
RFC3986: RFC3986
RFC1952: RFC1952
RFC7515: RFC7515
RFC6125: RFC6125
RFC9111: RFC9111
RFC9110: RFC9110
informative:

--- abstract
Expand All @@ -39,20 +42,28 @@ The status list data structures themselves are also represented as JWTs or CWTs.

JSON Web Tokens (JWTs) {{RFC7519}} and CBOR Web Tokens (CWTs) {{RFC8392}} as secure token formats, have vast possible applications. Some of these applications can involve issuing a token whereby certain semantics about the token can change over time, which are important to be able to communicate to relying parties in an interoperable manner, such as whether the token is considered invalidated or suspended by its issuer.

This document defines Status List representations in JWT and CWT formats that describe the individual statuses of multiple Referenced Tokens, which themselves are also JWTs or CWTs. The statuses of all Referenced Tokens are conveyed via a bit array in the Status List. Each Referenced Token is allocated an index during issuance that represents its position within this bit array. The value of the bit(s) at this position correspond to the Referenced Token's status. The document also defines how an issuer of a Referenced Token references a Status List Token. Status Lists may be composed for expressing a range of Status Types. This document defines basic Status Types for the most common use cases as well as an extensibility mechanism for custom Status Types. The Status List Token may be used by an issuer in the Issuer-Holder-Verifier model to express the status of verifiable credentials (Referenced Tokens) issued by an issuer.
This document defines Status List representations in JSON or CBOR formats and a Status List Token representation in JWT or CWT formats that describe the individual statuses of multiple Referenced Tokens, which themselves are also JWTs or CWTs. The statuses of all Referenced Tokens are conveyed via a bit array in the Status List. Each Referenced Token is allocated an index during issuance that represents its position within this bit array. The value of the bit(s) at this position correspond to the Referenced Token's status. The document also defines how an issuer of a Referenced Token references a Status List (Token). Status Lists may be composed for expressing a range of Status Types. This document defines basic Status Types for the most common use cases as well as an extensibility mechanism for custom Status Types. The Status List Token may be used by an issuer in the Issuer-Holder-Verifier model to express the status of verifiable credentials (Referenced Tokens) issued by an issuer.

The following diagram depicts the basic conceptual relationship.

~~~ ascii-art

+------------------+ +-------------------+
| | References | |
| |------------------->| |
| Referenced Token | | Status List Token |
| (JWT or CWT) | | (JWT or CWT) |
| | Describes Status | |
| |<-------------------| |
+------------------+ +-------------------+
+-------------------+ +------------------------+
| | describes status | |
| Status List +------------------>| Referenced Token |
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
| (JSON or CBOR) <------------------+ (JWT or CWT) |
| | references | |
+-------+-----------+ +--------+---------------+
|
|embedded
v
+-------------------+
| |
| Status List Token |
| (JWT or CWT) |
| |
+-------------------+

~~~

## Rationale
Expand All @@ -61,58 +72,30 @@ Revocation mechanisms are an essential part for most identity ecosystems. In the

This specification seeks to find a balance between scalability, security, and privacy by minimizing the status information to mere bits (often a single bit) and compressing the resulting binary data. Thereby, a Status List may contain statuses of 100,000 or more Referenced Tokens, but still remain relatively small. Placing large amounts of Referenced Tokens into the same list also enables herd privacy relative to the Issuer.

## Design Considerations

TBD

# Conventions and Definitions

{::boilerplate bcp14-tagged}

# Terminology

Status List:
: A bit array that lists the statuses of many Referenced Tokens.
: An object in JSON or CBOR representation containing a bit array that lists the statuses of many Referenced Tokens.

Status List Token:
: A token in JWT or CWT representation that contains a Status List.

Referenced Token:
: A token in JWT or CWT representation which contains a reference to a Status List Token. The information from the contained Status List may give a verifier additional information about up-to-date status of the Referenced Token.

# JSON Web Token Representation

## Status List JWT Format and Processing Requirements {#jwt-status-list-format-and-processing}
# Status List

The following rules apply to validating a JWT-based Status List Token. Application of additional restrictions and policy are at the discretion of the verifying party.

1. The JWT MUST contain an "iss" (issuer) claim that contains a unique string identifier for the entity that issued the JWT. In the absence of an application profile specifying otherwise, compliant applications MUST compare issuer values using the Simple String Comparison method defined in Section 6.2.1 of {{RFC3986}}. The value MUST be equal to that of the "iss" claim contained within the Referenced Token.

2. The JWT MUST contain a "sub" (subject) claim that contains an unique string identifier for that Referenced Token. The value MUST be equal to that of the "uri" claim contained in the "status" claim of the Referenced Token.

3. The JWT MUST contain an "iat" (issued at) claim that identifies the time at which it was issued.

4. The JWT MUST contain an "status_list" (status list) claim conforming to the rules outlined in [](#jwt-status-list-claim-format).

5. The JWT MAY contain an "exp" (expiration time) claim that conveys when it is considered expired by its issuer.

6. The JWT MAY contain other claims.

7. The JWT MUST be digitally signed using an asymmetric cryptographic algorithm. Relying parties MUST reject the JWT if it is using a Message Authentication Code (MAC) algorithm. Relying parties MUST reject JWTs with an invalid signature.

8. Relying parties MUST reject JWTs that are not valid in all other respects per "JSON Web Token (JWT)" {{RFC7519}}.

~~~~~~~~~~
{::include ./examples/status_list_jwt}
~~~~~~~~~~
## Status List Encoding {#status-list-base-encoding}

### Status List Claim Format {#jwt-status-list-claim-format}

The following rules apply to validating the "status_list" (status list) claim

1. The claim value MUST be a valid JSON object.

2. The claim value object MUST contain a "bits" (bit size) member with an numeric value that represents the number of bits per Referenced Token in the Status List ("lst") of the Status List JWT. The allowed values for "bits" are 1,2,4 and 8.

3. The claim value object MUST contain a "lst" (list) member with a string value that represents the status values for all the tokens it conveys statuses for. The value MUST be computed using the algorithm described in [](#jwt-status-list-claim-encoding).

### Status List Encoding {#jwt-status-list-claim-encoding}
The following rules apply to the Status List:

Each status of a Referenced Token MUST be represented with a bit size of 1,2,4, or 8. Therefore up to 2,4,16, or 256 statuses for a Referenced Token are possible, depending on the bit size. This limitation is intended to limit bit manipulation necessary to a single byte for every operation and thus keeping implementations simpler and less error prone.

Expand All @@ -122,62 +105,7 @@ Each status of a Referenced Token MUST be represented with a bit size of 1,2,4,

3. The result of the gZIP compression is then base64url-encoded, as defined in Section 2 of {{RFC7515}}.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

## Referenced Token Format and Processing Requirements {#jwt-referenced-token}

The following rules apply to validating a Referenced Token in JWT representation, which references a Status List Token. Application of additional restrictions and policy are at the discretion of the verifying party.

1. The JWT MUST contain an "iss" (issuer) claim that contains a unique string identifier for the entity that issued the JWT. In the absence of an application profile specifying otherwise, compliant applications MUST compare issuer values using the Simple String Comparison method defined in Section 6.2.1 of {{RFC3986}}. The value MUST be equal to that of the "iss" claim contained within the referenced Status List Token.

2. The JWT MUST contain an "status" (status) claim conforming to the rules outlined in [](#jwt-referenced-token-status)

The following example is the decoded header and payload of a JWT meeting the processing rules as defined above.

~~~ ascii-art

{
"alg": "ES256",
"kid": "11"
}
.
{
"iss": "https://example.com",
"status": {
"idx": 0,
"uri": "https://example.com/statuslists/1"
}
}
~~~

### Status Claim Format {#jwt-referenced-token-status}

The following rules apply to validating the "status" (status) claim

1. The claim value MUST be a valid JSON object.

2. The claim value object MUST contain an "idx" (index) member with a numeric value that represents the index to check for status information in the Status List for the current JWT. The value of this member MUST be a non-negative number, containing a value of zero or greater.

3. The claim value object MUST contain a "uri" member with a string value that identifies the Status List containing the status information for the JWT. The value of this member MUST be a uri conforming to {{RFC3986}}.

# Status Types {#status-types}

This document defines potential statuses of Referenced Tokens as Status Type values. If the Status List contains more than one bit per token (as defined by "bits" in the Status List), then the whole value of bits MUST describe one value. A Status List can not represent multiple statuses per Referenced Token.

The registry in this document describes the basic Status Type values required for the most common use cases.
Additional values may defined for particular use cases.

## Status Types Values

A status describes the state, mode, condition or stage of an entity that is described by the status list. Status Types MUST be numeric values between 0 and 255.
Status types described by this specification comprise:
- 0x00 - "VALID" - The status of the Token is valid, correct or legal.
- 0x01 - "INVALID" - The status of the Token is revoked, annulled, taken back, recalled or cancelled. This state is irreversible.
- 0x02 - "SUSPENDED" - The status of the Token is temporarily invalid, hanging, debarred from privilege. This state is reversible.

The issuer of the Status List Token MUST choose an adequate "bits" (bit size) to be able to describe the required Status Types for the application.

# Example JWT Status Lists

## Example Status List with 1-Bit Status Values
### Example Status List with 1-Bit Status Values

In this example, the Status List is used as a revocation list. It only requires the Status Types "VALID" and "INVALID"; therefore a "bits" of 1 is sufficient.

Expand Down Expand Up @@ -220,13 +148,15 @@ index 7 6 5 4 3 2 1 0 15 ... 10 9 8 23

Resulting in the byte array and compressed/base64url encoded status list:

~~~~~~~~~~
{::include ./examples/status_list_encoding}
~~~~~~~~~~
~~~ ascii-art

H4sIAOpbjGQC_9u5GABc9QE7AgAAAA

~~~

## Example Status List with 2-Bit Status Values
### Example Status List with 2-Bit Status Values

In thisexample, the Status List additionally includes the Status Type "SUSPENDED. As the Status Type value for "SUSPENDED" is 0x02 and does not fit into 1 bit, the "bits" is required to be 2.
In this example, the Status List additionally includes the Status Type "SUSPENDED. As the Status Type value for "SUSPENDED" is 0x02 and does not fit into 1 bit, the "bits" is required to be 2.

This example Status List represents the status of 12 Referenced Tokens, requiring 24 bits (3 bytes) of status.

Expand Down Expand Up @@ -265,10 +195,151 @@ index 3 2 1 0 7 6 5 4 11 10 9 8

Resulting in the byte array and compressed/base64url encoded status list:

~~~ ascii-art

H4sIAOpbjGQC_zvp8hMAZLRLMQMAAAA

~~~

## Status List in JSON Format and Processing Requirements {#jwt-status-list-claim-format}

The following rules apply to validating the "status_list" (status list) claim

1. The claim value MUST be a valid JSON object.

2. The claim value object MUST contain a "bits" (bit size) member with an numeric value that represents the number of bits per Referenced Token in the Status List ("lst") of the Status List JWT. The allowed values for "bits" are 1,2,4 and 8.

3. The claim value object MUST contain a "lst" (list) member with a string value that represents the status values for all the tokens it conveys statuses for. The value MUST be computed as the base64url-encoded result of the algorithm described in [](#status-list-base-encoding).

The examples from [](#status-list-base-encoding) represented in a Status List JSON format result in:

~~~~~~~~~~
{::include ./examples/status_list_encoding}
~~~~~~~~~~

~~~~~~~~~~
{::include ./examples/status_list_encoding2}
~~~~~~~~~~

## Status List Token in JWT Format and Processing Requirements {#jwt-status-list-format-and-processing}

The following rules apply to validating a JWT-based Status List Token. Application of additional restrictions and policy are at the discretion of the verifying party.

1. The JWT MUST contain an "iss" (issuer) claim that contains a unique string identifier for the entity that issued the JWT. In the absence of an application profile specifying otherwise, compliant applications MUST compare issuer values using the Simple String Comparison method defined in Section 6.2.1 of {{RFC3986}}. The value MUST be equal to that of the "iss" claim contained within the Referenced Token.

2. The JWT MUST contain a "sub" (subject) claim that contains an unique string identifier for that Referenced Token. The value MUST be equal to that of the "uri" claim contained in the "status" claim of the Referenced Token.

3. The JWT MUST contain an "iat" (issued at) claim that identifies the time at which it was issued.

4. The JWT MUST contain an "status_list" (status list) claim conforming to the rules outlined in [](#jwt-status-list-claim-format).

5. The JWT MAY contain an "exp" (expiration time) claim that conveys when it is considered expired by its issuer.

6. The JWT MAY contain other claims.

7. The JWT MUST be digitally signed using an asymmetric cryptographic algorithm. Relying parties MUST reject the JWT if it is using a Message Authentication Code (MAC) algorithm. Relying parties MUST reject JWTs with an invalid signature.

8. Relying parties MUST reject JWTs that are not valid in all other respects per "JSON Web Token (JWT)" {{RFC7519}}.

~~~~~~~~~~
{::include ./examples/status_list_jwt}
~~~~~~~~~~

# Status Reference

## Status Reference in JSON Format {#status-reference-json}

The following rules apply to validating the "status" (status) claim that references a Status List:

1. The claim value MUST be a valid JSON object.

2. The claim value object MUST contain an "idx" (index) member with a numeric value that represents the index to check for status information in the Status List for the current JWT. The value of this member MUST be a non-negative number, containing a value of zero or greater.

3. The claim value object MUST contain a "uri" member with a string value that identifies the Status List containing the status information for the JWT. The value of this member MUST be a uri conforming to {{RFC3986}}.

~~~ ascii-art
{
"idx": 0,
"uri": "https://example.com/statuslists/1"
}
~~~

## Status Referencing Token in JWT Format and Processing Requirements {#status-referencing-token-jwt}

The following rules apply to validating a Referenced Token in JWT representation, which references a Status List Token. Application of additional restrictions and policy are at the discretion of the verifying party.

1. The JWT MUST contain an "iss" (issuer) claim that contains a unique string identifier for the entity that issued the JWT. In the absence of an application profile specifying otherwise, compliant applications MUST compare issuer values using the Simple String Comparison method defined in Section 6.2.1 of {{RFC3986}}. The value MUST be equal to that of the "iss" claim contained within the referenced Status List Token.

2. The JWT MUST contain an "status" (status) claim conforming to the rules outlined in [](#status-reference-json)

The following example is the decoded header and payload of a JWT meeting the processing rules as defined above.

~~~ ascii-art

{
"alg": "ES256",
"kid": "11"
}
.
{
"iss": "https://example.com",
"status": {
"idx": 0,
"uri": "https://example.com/statuslists/1"
}
}
~~~

# Verification and Processing

## Status List Request

To obtain the Status List or Status List Token, the Verifier MUST send a HTTP GET request to the Status List Endpoint. Communication with the Status List Endpoint MUST utilize TLS. Which version(s) should be implemented will vary over time. A TLS server certificate check MUST be performed as defined in Section 5 and 6 of {{RFC6125}}.

The Verifier SHOULD send the following Accept-Header to indicate the requested response type:

- "application/statuslist+json" for Status Lists
- "application/statuslist+jwt" for Status List JWTs

If the Verifier does not send an Accept Header, the reponse type is assumed to be known implicit or out-of-band.

## Status List Response

In the successful response, the Status List Provider MUST use the following content-type:

- "application/statuslist+json" for Status Lists
- "application/statuslist+jwt" for Status List JWTs

In the case of "application/statuslist+json", the response MUST be of type JSON and follow the rules of [](#jwt-status-list-claim-format).

In the case of "application/statuslist+jwt", the response MUST be of type JWT and follow the rules of [](#jwt-status-list-format-and-processing).

The response SHOULD use gzip Contente-Encoding as defined in {{RFC9110}}.

## Caching

If caching is required (e.g., to enable the use of alternative mechanisms for hosting, like Content Delivery Networks), the control of the caching mechanism SHOULD be implemented using the standard HTTP Cache-Control as defined in {{RFC9111}}.

## Validation Rules

# Status Types {#status-types}

This document defines potential statuses of Referenced Tokens as Status Type values. If the Status List contains more than one bit per token (as defined by "bits" in the Status List), then the whole value of bits MUST describe one value. A Status List can not represent multiple statuses per Referenced Token.

The registry in this document describes the basic Status Type values required for the most common use cases.
Additional values may defined for particular use cases.

## Status Types Values

A status describes the state, mode, condition or stage of an entity that is described by the status list. Status Types MUST be numeric values between 0 and 255.
Status types described by this specification comprise:

- 0x00: "VALID" - The status of the Token is valid, correct or legal.
- 0x01: "INVALID" - The status of the Token is revoked, annulled, taken back, recalled or cancelled. This state is irreversible.
- 0x02: "SUSPENDED" - The status of the Token is temporarily invalid, hanging, debarred from privilege. This state is reversible.

The issuer of the Status List Token MUST choose an adequate "bits" (bit size) to be able to describe the required Status Types for the application.

# CWT Representations

TBD Define parallel CWT representations for Status Lists and Referenced Tokens.
Expand Down
Loading