fix session

This commit is contained in:
2025-11-28 16:11:44 -03:00
parent c71e19eacb
commit f684f4021f
4 changed files with 77 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ from layercake.dynamodb import DynamoDBPersistenceLayer, PartitionKey
from ..conftest import HttpApiProxy, LambdaContext
def test_session(
def test_authentication(
app,
seeds,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
@@ -14,7 +14,7 @@ def test_session(
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/session',
raw_path='/authentication',
method=HTTPMethod.POST,
body={
'username': '07879819908',

View File

@@ -2,7 +2,7 @@ from http import HTTPMethod, HTTPStatus
from layercake.dynamodb import DynamoDBPersistenceLayer
from routes.session import new_session
from routes.authentication import new_session
from ..conftest import HttpApiProxy, LambdaContext
@@ -17,7 +17,6 @@ def test_authorize(
lambda_context: LambdaContext,
):
session = new_session(USER_ID)
print(session)
r = app.lambda_handler(
http_api_proxy(
@@ -32,7 +31,7 @@ def test_authorize(
'state': '456',
},
cookies=[
f'__session={session}; HttpOnly; Secure',
f'SID={session}; HttpOnly; Secure',
],
),
lambda_context,
@@ -76,7 +75,7 @@ def test_forbidden(
'state': '456',
},
cookies=[
f'__session={session}; HttpOnly; Secure',
f'SID={session}; HttpOnly; Secure',
],
),
lambda_context,
@@ -105,7 +104,7 @@ def test_invalid_session(
'state': '456',
},
cookies=[
'__session=10:10; HttpOnly; Secure',
'SID=10:10; HttpOnly; Secure',
],
),
lambda_context,