Skip to content

Commit 1482e02

Browse files
authored
Merge pull request #173 from oauth-wg/c2bo/fix-cwt-statuslist-encoding
fix CWT status_list map encoding
2 parents 9940f55 + 737f92c commit 1482e02

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

draft-ietf-oauth-status-list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ for their valuable contributions, discussions and feedback to this specification
868868

869869
-04
870870

871+
* fix CWT status_list map encoding
871872
* editorial fixes
872873
* add CORS considerations to the http endpoint
873874
* fix reference of Status List in CBOR format

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def statusListEncoding1Bit():
6161

6262
def statusListEncoding1BitCBOR():
6363
status_list = exampleStatusList1Bit()
64-
encoded = status_list.encodeAsCBOR()
64+
encoded = status_list.encodeAsCBORRaw()
6565
hex_encoded = encoded.hex()
6666
text = "byte_array = [{}, {}] \nencoded:\n{}".format(
6767
hex(status_list.list[0]), hex(status_list.list[1]), util.printText(hex_encoded)
@@ -85,7 +85,7 @@ def statusListEncoding2Bit():
8585

8686
def statusListEncoding2BitCBOR():
8787
status_list = exampleStatusList2Bit()
88-
encoded = status_list.encodeAsCBOR()
88+
encoded = status_list.encodeAsCBORRaw()
8989
hex_encoded = encoded.hex()
9090
text = "byte_array = [{}, {}, {}] \nencoded:\n{}".format(
9191
hex(status_list.list[0]),

src/status_list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def encodeAsCBOR(self) -> Dict:
4343
"bits": self.bits,
4444
"lst": encoded_list,
4545
}
46+
return object
47+
48+
def encodeAsCBORRaw(self) -> Dict:
49+
object = self.encodeAsCBOR()
4650
return dumps(object)
4751

4852
def decode(self, input: str):

0 commit comments

Comments
 (0)