Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users can create API keys with the expiration set to today #517

Open
ckaipf opened this issue Dec 12, 2023 · 0 comments
Open

Users can create API keys with the expiration set to today #517

ckaipf opened this issue Dec 12, 2023 · 0 comments

Comments

@ckaipf
Copy link
Contributor

ckaipf commented Dec 12, 2023

Users can create API keys with the expiration set to today. However, those are always invalid since they can't specify the time to expire. We should either forbid that or return a more verbose response (currently it returns 401 not authorized).

def check_expiration(expiration_datetime: Optional[datetime]):
"""Checks if an expiration date was exceeded. Returns true if expired."""
return expiration_datetime is not None and datetime.now() >= expiration_datetime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant