wip
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
import pprint
|
||||
from base64 import b64encode
|
||||
from http import HTTPMethod, HTTPStatus
|
||||
from urllib.parse import urlencode
|
||||
@@ -44,7 +43,7 @@ def token(
|
||||
return json.loads(r['body'])
|
||||
|
||||
|
||||
def test_token(
|
||||
def test_revoke(
|
||||
app,
|
||||
token,
|
||||
seeds,
|
||||
|
||||
@@ -7,6 +7,10 @@ from layercake.dynamodb import DynamoDBPersistenceLayer
|
||||
|
||||
from ..conftest import HttpApiProxy, LambdaContext
|
||||
|
||||
CLIENT_ID = 'd72d4005-1fa7-4430-9754-80d5e2487bb6'
|
||||
CLIENT_SECRET = '1nFD8alDbGHgc3g1RLY960xyRJVee0SlMoIB0MUlSuiJy28W'
|
||||
AUTH = b64encode(f'{CLIENT_ID}:{CLIENT_SECRET}'.encode()).decode()
|
||||
|
||||
|
||||
def test_token(
|
||||
app,
|
||||
@@ -91,22 +95,19 @@ def test_refresh_token(
|
||||
http_api_proxy: HttpApiProxy,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
client_id = 'd72d4005-1fa7-4430-9754-80d5e2487bb6'
|
||||
client_secret = '1nFD8alDbGHgc3g1RLY960xyRJVee0SlMoIB0MUlSuiJy28W'
|
||||
auth = b64encode(f'{client_id}:{client_secret}'.encode()).decode()
|
||||
r = app.lambda_handler(
|
||||
http_api_proxy(
|
||||
raw_path='/token',
|
||||
method=HTTPMethod.POST,
|
||||
headers={
|
||||
'Authorization': f'Basic {auth}',
|
||||
'Authorization': f'Basic {AUTH}',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body=urlencode(
|
||||
{
|
||||
'grant_type': 'refresh_token',
|
||||
'refresh_token': 'CyF3Ik3b9hMIo3REVv27gZAHd7dvwZq6QrkhWr7qHEen4UVy',
|
||||
'client_id': client_id,
|
||||
'client_id': CLIENT_ID,
|
||||
}
|
||||
),
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// User data
|
||||
{"id": "357db1c5-7442-4075-98a3-fbe5c938a419", "sk": "0", "name": "Sérgio R Siqueira", "email": "sergio@somosbeta.com.br"}
|
||||
// {"id": "357db1c5-7442-4075-98a3-fbe5c938a419", "sk": "PASSWORD", "hash": "$pbkdf2-sha256$29000$IuTcm7M2BiAEgPB.b.3dGw$d8xVCbx8zxg7MeQBrOvCOgniiilsIHEMHzoH/OXftLQ"}
|
||||
{"id": "357db1c5-7442-4075-98a3-fbe5c938a419", "sk": "PASSWORD", "hash": "$pbkdf2-sha256$29000$IuTcm7M2BiAEgPB.b.3dGw$d8xVCbx8zxg7MeQBrOvCOgniiilsIHEMHzoH/OXftLQ"}
|
||||
{"id": "357db1c5-7442-4075-98a3-fbe5c938a419", "sk": "SCOPE", "scope": "openid profile email offline_access read:users read:courses"}
|
||||
{"id": "357db1c5-7442-4075-98a3-fbe5c938a419", "sk": "SESSION#36af142e-9f6d-49d3-bfe9-6a6bd6ab2712", "created_at": "2025-09-17T13:44:34.544491-03:00", "ttl": 1760719474}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user