This commit is contained in:
2025-03-27 11:54:19 -03:00
parent 8118dfd403
commit 76c2656dd1
15 changed files with 200 additions and 151 deletions

View File

@@ -40,18 +40,27 @@ def test_bearer_apikey(
event = {
'headers': {
'authorization': 'Bearer sk-32504457-f133-4c00-936b-6aa712ca9f40',
'authorization': 'Bearer sk-MzI1MDQ0NTctZjEzMy00YzAwLTkzNmItNmFhNzEyY2E5ZjQw',
}
}
# This data was added from seeds
assert app.lambda_handler(event, lambda_context) == {
'isAuthorized': True,
'context': {'tenant': {'name': 'default', 'id': '*'}},
'context': {
'tenant': {
'name': 'default',
'id': '*',
}
},
}
# This data was added from seeds
assert app.lambda_handler(
{'headers': {'authorization': 'Bearer sk-abc'}},
{
'headers': {
'authorization': 'Bearer sk-abc',
}
},
lambda_context,
) == {'isAuthorized': False}