From 7f1c14d2852c9f01f1470a074c9804a0d321e5e9 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 24 Dec 2021 17:23:06 +0000 Subject: [PATCH] Remove scripts --- scripts/get-token.sh | 7 ------- scripts/make-jwt.py | 20 -------------------- scripts/refresh-token.sh | 7 ------- 3 files changed, 34 deletions(-) delete mode 100755 scripts/get-token.sh delete mode 100644 scripts/make-jwt.py delete mode 100755 scripts/refresh-token.sh diff --git a/scripts/get-token.sh b/scripts/get-token.sh deleted file mode 100755 index 338d44a..0000000 --- a/scripts/get-token.sh +++ /dev/null @@ -1,7 +0,0 @@ -curl https://sandbox-b2b.revolut.com/api/1.0/auth/token \ - -H "Content-Type: application/x-www-form-urlencoded"\ - --data "grant_type=authorization_code"\ - --data "code=oa_sand_[...]"\ - --data "client_id=XXXX_[...]"\ - --data "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer"\ - --data "client_assertion=long string [...]" diff --git a/scripts/make-jwt.py b/scripts/make-jwt.py deleted file mode 100644 index fcc0af8..0000000 --- a/scripts/make-jwt.py +++ /dev/null @@ -1,20 +0,0 @@ -from cryptography.hazmat.primitives import serialization -from cryptography.hazmat.backends import default_backend -from json import load -import jwt - -PRIVATE_KEY = "pkcs8privatekey.pem" -PAYLOAD = "jwt" - -with open(PRIVATE_KEY, "rb") as f: - pem_bytes = f.read() - -with open(PAYLOAD, "rb") as f: - payload = load(f) - -print(pem_bytes) -print(payload) - -private_key = serialization.load_pem_private_key(pem_bytes, password=None, backend=default_backend()) -encoded = jwt.encode(payload, private_key, algorithm="RS256") -print(encoded) diff --git a/scripts/refresh-token.sh b/scripts/refresh-token.sh deleted file mode 100755 index 59a4f05..0000000 --- a/scripts/refresh-token.sh +++ /dev/null @@ -1,7 +0,0 @@ -curl https://sandbox-b2b.revolut.com/api/1.0/auth/token \ - -H "Content-Type: application/x-www-form-urlencoded"\ - --data "grant_type=refresh_token"\ - --data "refresh_token=oa_sand_[...]"\ - --data "client_id=XXXX_[...]"\ - --data "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer"\ - --data "client_assertion=long string [...]"