Skip to content

Commit ce693f4

Browse files
authored
Merge pull request #164 from oauth-wg/159-remove-requirement-on-matching-iss-values
remove requirement for matching iss claim in Referenced Token and Sta…
2 parents 4bf0c65 + 0076ade commit ce693f4

File tree

4 files changed

+19
-24
lines changed

4 files changed

+19
-24
lines changed

draft-ietf-oauth-status-list.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ The following content applies to the JWT Header:
258258

259259
The following content applies to the JWT Claims Set:
260260

261-
* `iss`: REQUIRED when also present in the Referenced Token. The `iss` (issuer) claim MUST specify a unique string identifier for the entity that issued the Status List Token. 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.
262261
* `sub`: REQUIRED. The `sub` (subject) claim MUST specify the URI of the Status List Token. The value MUST be equal to that of the `uri` claim contained in the `status_list` claim of the Referenced Token.
263262
* `iat`: REQUIRED. The `iat` (issued at) claim MUST specify the time at which the Status List Token was issued.
264263
* `exp`: OPTIONAL. The `exp` (expiration time) claim, if present, MUST specify the time at which the Status List Token is considered expired by its issuer.
@@ -291,7 +290,6 @@ The following content applies to the CWT protected header:
291290

292291
The following content applies to the CWT Claims Set:
293292

294-
* `1` (issuer): REQUIRED. Same definition as `iss` claim in [](#status-list-token-jwt).
295293
* `2` (subject): REQUIRED. Same definition as `sub` claim in [](#status-list-token-jwt).
296294
* `6` (issued at): REQUIRED. Same definition as `iat` claim in [](#status-list-token-jwt).
297295
* `4` (expiration time): OPTIONAL. Same definition as `exp` claim in [](#status-list-token-jwt).
@@ -332,7 +330,6 @@ The Referenced Token MAY be encoded as a "JSON Web Token (JWT)" according to {{R
332330

333331
The following content applies to the JWT Claims Set:
334332

335-
* `iss`: REQUIRED when also present in the Status List Token. The `iss` (issuer) claim MUST specify a unique string identifier for the entity that issued the Referenced Token. 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.
336333
* `status`: REQUIRED. The `status` (status) claim MUST specify a JSON Object that contains at least one reference to a status mechanism.
337334
* `status_list`: REQUIRED when the status list mechanism defined in this specification is used. It contains a reference to a Status List or Status List Token. It MUST at least contain the following claims:
338335
* `idx`: REQUIRED. The `idx` (index) claim MUST specify an Integer that represents the index to check for status information in the Status List for the current Referenced Token. The value of `idx` MUST be a non-negative number, containing a value of zero or greater.
@@ -350,7 +347,6 @@ The following is a non-normative example for a decoded header and payload of a R
350347
}
351348
.
352349
{
353-
"iss": "https://example.com",
354350
"status": {
355351
"status_list": {
356352
"idx": 0,
@@ -413,7 +409,6 @@ The Referenced Token MUST be encoded as a "COSE Web Token (CWT)" object accordin
413409

414410
The following content applies to the CWT Claims Set:
415411

416-
* `1` (issuer): REQUIRED when also present in the Referenced Token. Same definition as `iss` claim in [](#referenced-token-jwt).
417412
* `65535` (status): REQUIRED. The status claim is encoded as a `Status` CBOR structure and MUST include at least one data item that refers to a status mechanism. Each data item in the `Status` CBOR structure comprises a key-value pair, where the key must be a CBOR text string (Major Type 3) specifying the identifier of the status mechanism, and the corresponding value defines its contents. This specification defines the following data items:
418413
* `status_list` (status list): REQUIRED when the status list mechanism defined in this specification is used. It has the same definition as the `status_list` claim in [](#referenced-token-jwt) but MUST be encoded as a `StatusListInfo` CBOR structure with the following fields:
419414
* `idx`: REQUIRED. Same definition as `idx` claim in [](#referenced-token-jwt).
@@ -519,8 +514,7 @@ If this validation was not successful, the Referenced Token MUST be rejected. If
519514
1. The subject claim (`sub` or `2`) of the Status List Token MUST be equal to the `uri` claim in the `status_list` object of the Referenced Token
520515
2. If the Relying Party has custom policies regarding the freshness of the Status List Token, it SHOULD check the issued at claim (`iat` or `6`)
521516
3. If expiration time is defined (`exp` or `4`), it MUST be checked if the Status List Token is expired
522-
4. If the Referenced Token contains an issuer claim, the Status List Token MUST contain the same issuer claim (`iss` or `1`)
523-
5. If the Relying Party is using a system for caching the Status List Token, it SHOULD check the `ttl` claim of the Status List Token and retrieve a fresh copy if (time status was resolved + ttl < current time)
517+
4. If the Relying Party is using a system for caching the Status List Token, it SHOULD check the `ttl` claim of the Status List Token and retrieve a fresh copy if (time status was resolved + ttl < current time)
524518
5. Decompress the Status List with a decompressor that is compatible with DEFLATE {{RFC1951}} and ZLIB {{RFC1950}}
525519
6. Retrieve the status value of the index specified in the Referenced Token as described in [](#status-list). Fail if the provided index is out of bound of the status list
526520
7. Check the status value as described in [](#status-types)
@@ -915,6 +909,7 @@ for their valuable contributions, discussions and feedback to this specification
915909

916910
-04
917911

912+
* remove requirement for matching iss claim in Referenced Token and Status List Token
918913
* add sd-jwt-vc example
919914
* fix CWT status_list map encoding
920915
* editorial fixes

src/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def statusListEncoding2BitCBOR():
101101
def statusListJWT():
102102
status_list = exampleStatusList1Bit()
103103
jwt = StatusListToken(
104-
issuer="https://example.com",
105104
subject="https://example.com/statuslists/1",
106105
list=status_list,
107106
key=key,
@@ -114,7 +113,6 @@ def statusListJWT():
114113
def statusListCWT():
115114
status_list = exampleStatusList1Bit()
116115
cwt = StatusListToken(
117-
issuer="https://example.com",
118116
subject="https://example.com/statuslists/1",
119117
list=status_list,
120118
key=key,

src/referenced_token.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def CWT(
1111
iss: str,
1212
status_url: str,
1313
status_idx: int,
14-
exp: datetime = None,
14+
exp: datetime | None = None,
1515
):
1616
claims = {}
1717
claims[CWTClaims.SUB] = sub

src/status_token.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class StatusListToken:
2222

2323
def __init__(
2424
self,
25-
issuer: str,
2625
subject: str,
2726
key: jwk.JWK,
28-
list: StatusList = None,
27+
issuer: str | None = None,
28+
list: StatusList | None = None,
2929
size: int = 2**20,
3030
bits: int = 1,
31-
alg: str = None,
31+
alg: str | None = None,
3232
):
3333
if list is not None:
3434
self.list = list
@@ -78,10 +78,10 @@ def get(self, pos: int) -> int:
7878
def buildJWT(
7979
self,
8080
iat: datetime = datetime.utcnow(),
81-
exp: datetime = None,
82-
ttl: timedelta = None,
83-
optional_claims: Dict = None,
84-
optional_header: Dict = None,
81+
exp: datetime | None = None,
82+
ttl: timedelta | None = None,
83+
optional_claims: Dict | None = None,
84+
optional_header: Dict | None = None,
8585
compact=True,
8686
) -> str:
8787
# build claims
@@ -90,7 +90,8 @@ def buildJWT(
9090
else:
9191
claims = {}
9292
claims["sub"] = self.subject
93-
claims["iss"] = self.issuer
93+
if self.issuer is not None:
94+
claims["iss"] = self.issuer
9495
claims["iat"] = int(iat.timestamp())
9596
if exp is not None:
9697
claims["exp"] = int(exp.timestamp())
@@ -115,19 +116,20 @@ def buildJWT(
115116
def buildCWT(
116117
self,
117118
iat: datetime = datetime.utcnow(),
118-
exp: datetime = None,
119-
ttl: timedelta = None,
120-
optional_claims: Dict = None,
121-
optional_protected_header: Dict = None,
122-
optional_unprotected_header: Dict = None,
119+
exp: datetime | None = None,
120+
ttl: timedelta | None = None,
121+
optional_claims: Dict | None = None,
122+
optional_protected_header: Dict | None = None,
123+
optional_unprotected_header: Dict | None = None,
123124
) -> bytes:
124125
# build claims
125126
if optional_claims is not None:
126127
claims = optional_claims
127128
else:
128129
claims = {}
129130
claims[CWTClaims.SUB] = self.subject
130-
claims[CWTClaims.ISS] = self.issuer
131+
if self.issuer is not None:
132+
claims[CWTClaims.ISS] = self.issuer
131133
claims[CWTClaims.IAT] = int(iat.timestamp())
132134
if exp is not None:
133135
claims[CWTClaims.EXP] = int(exp.timestamp())

0 commit comments

Comments
 (0)