This commit is contained in:
2025-10-31 15:15:31 -03:00
parent 460748492a
commit 26a87b8445
5 changed files with 69 additions and 28 deletions

View File

@@ -1,4 +1,5 @@
import json
import pprint
from base64 import b64encode
from http import HTTPMethod, HTTPStatus
from urllib.parse import urlencode

View File

@@ -1,4 +1,5 @@
import json
import pprint
from base64 import b64encode
from http import HTTPMethod, HTTPStatus
from urllib.parse import urlencode
@@ -125,3 +126,32 @@ def test_refresh_token(
)
assert len(r['items']) == 2
def test_refresh_token_invalid_grant(
app,
seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/token',
method=HTTPMethod.POST,
headers={
'Authorization': f'Basic {AUTH}',
'Content-Type': 'application/x-www-form-urlencoded',
},
body=urlencode(
{
'grant_type': 'refresh_token',
'refresh_token': '1234',
'client_id': CLIENT_ID,
}
),
),
lambda_context,
)
assert r['statusCode'] == 400