apd
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: apd | ||
| Version: 0.4.3 | ||
| Version: 0.4.4 | ||
| Summary: Tool to access the Analysis production Data | ||
@@ -5,0 +5,0 @@ License: BSD-3-Clause |
+2
-0
@@ -51,2 +51,4 @@ [metadata] | ||
| E203, | ||
| B017, | ||
| B905, | ||
| select = C,E,F,W,B,B9 | ||
@@ -53,0 +55,0 @@ exclude = |
| Metadata-Version: 2.1 | ||
| Name: apd | ||
| Version: 0.4.3 | ||
| Version: 0.4.4 | ||
| Summary: Tool to access the Analysis production Data | ||
@@ -5,0 +5,0 @@ License: BSD-3-Clause |
@@ -14,2 +14,3 @@ ############################################################################### | ||
| import base64 | ||
| import binascii | ||
| import hashlib | ||
@@ -125,7 +126,16 @@ import json | ||
| """ | ||
| random_state = secrets.token_hex(8) | ||
| code_verifier = secrets.token_hex(96) | ||
| code_hash = hashlib.sha256(code_verifier.encode()).digest() | ||
| code_challenge = base64.urlsafe_b64encode(code_hash).decode() | ||
| random_state = binascii.hexlify(os.urandom(8)) | ||
| # code_verifier: https://www.rfc-editor.org/rfc/rfc7636#section-4.1 | ||
| # 48*2 = 96 characters, which is within 43-128 limits. | ||
| code_verifier = binascii.hexlify(os.urandom(48)) | ||
| # code_challenge: https://www.rfc-editor.org/rfc/rfc7636#section-4.2 | ||
| # BUT Keycloak decided to reject any base64 input containing '=' (!!) | ||
| # so we have to remove it even if we are following the standard. | ||
| code_challenge = ( | ||
| base64.urlsafe_b64encode(hashlib.sha256(code_verifier).digest()) | ||
| .decode() | ||
| .replace("=", "") | ||
| ) | ||
| r = requests.post( | ||
@@ -132,0 +142,0 @@ f"{OIDC_BASE_URL}/auth/device", |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
2993830
0.01%54679
0.02%