mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 18:37:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
163
dom/apps/tests/create_test_receipts.py
Normal file
163
dom/apps/tests/create_test_receipts.py
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import jwt
|
||||
|
||||
receipt1 = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314356"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt2 = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314357"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_typ = {
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_product = {
|
||||
"typ": "purchase-receipt",
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_user = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_iss = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_nbf = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_without_iat = {
|
||||
"typ": "purchase-receipt",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
receipt_with_wrong_typ = {
|
||||
"typ": "fake",
|
||||
"product": {
|
||||
"url": "https://www.mozilla.org",
|
||||
"storedata": "5169314358"
|
||||
},
|
||||
"user": {
|
||||
"type": "directed-identifier",
|
||||
"value": "4fb35151-2b9b-4ba2-8283-c49d381640bd"
|
||||
},
|
||||
"iss": "http://mochi.test:8888",
|
||||
"nbf": 131360185,
|
||||
"iat": 131360188,
|
||||
"detail": "http://mochi.test:8888/receipt/5169314356",
|
||||
"verify": "http://mochi.test:8888/verify/5169314356",
|
||||
"reissue": "http://mochi.test:8888/reissue/5169314356"
|
||||
}
|
||||
|
||||
print("let valid_receipt1 = \"" + jwt.encode(receipt1, "") + "\";\n")
|
||||
print("let valid_receipt2 = \"" + jwt.encode(receipt2, "") + "\";\n")
|
||||
print("let receipt_without_typ = \"" + jwt.encode(receipt_without_typ, "") + "\";\n")
|
||||
print("let receipt_without_product = \"" + jwt.encode(receipt_without_product, "") + "\";\n")
|
||||
print("let receipt_without_user = \"" + jwt.encode(receipt_without_user, "") + "\";\n")
|
||||
print("let receipt_without_iss = \"" + jwt.encode(receipt_without_iss, "") + "\";\n")
|
||||
print("let receipt_without_nbf = \"" + jwt.encode(receipt_without_nbf, "") + "\";\n")
|
||||
print("let receipt_without_iat = \"" + jwt.encode(receipt_without_iat, "") + "\";\n")
|
||||
print("let receipt_with_wrong_typ = \"" + jwt.encode(receipt_with_wrong_typ, "") + "\";\n")
|
||||
Loading…
Add table
Add a link
Reference in a new issue