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

DD-1685: Check for expired token #7

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

jo-pol
Copy link
Contributor

@jo-pol jo-pol commented Nov 4, 2024

Fixes DD-1685: Check for expired token

Description of changes

How to test

See added unit tests. authenticate_should_return_401_for_expired_dataverse_key failed before the query was fixed.

PS: The tests create their own tables. This introduces a risk of false positives due to typos compared to the actual dvndb, or changes in the dvndb. So also tested after compilation and deploy with:

update apitoken set expiretime = (CURRENT_DATE - INTERVAL '1' DAY) where id=999;
curl -i -H "X-Dataverse-Key:xxx" -X POST http://localhost:20340

Use actual values for 999 and xxx and reset the expiretime after the test. Before the DB change, curl returns 200-OK, after the change 401-Unauthorized.

Related PRs

(Add links)
*

Notify

@DANS-KNAW/core-systems

@jo-pol jo-pol requested a review from a team as a code owner November 4, 2024 10:37
@janvanmansum janvanmansum merged commit 076f511 into master Nov 4, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants