Skip to content

[SQL-283] Authentication for CSV export#467

Merged
kelvinqian00 merged 14 commits intocsv-exportfrom
csv-export-auth
Mar 10, 2025
Merged

[SQL-283] Authentication for CSV export#467
kelvinqian00 merged 14 commits intocsv-exportfrom
csv-export-auth

Conversation

@kelvinqian00
Copy link
Copy Markdown
Contributor

@kelvinqian00 kelvinqian00 commented Mar 6, 2025

Implement authentication for the GET /admin/csv endpoint, as HTML download attributes cannot have headers, thus making the usual JWT authentication impossible.

We introduce the concept of "one-time JWTs" that have "one-time IDs." These one-time JWTs are stored in the jwt_blocklist SQL table (added in v0.8.0), where if the one_time_id column is not null then they are ignored during the query for blocked JWTs. Thus, these JWTs can easily be blocked/revoked by updating one_time_id to be null, which happens once they are validated. These one-time JWTs can be added as a token parameter for any GET endpoint, this case the CSV download endpoint.

@kelvinqian00 kelvinqian00 marked this pull request as ready for review March 6, 2025 16:14
Copy link
Copy Markdown
Member

@cliffcaseyyet cliffcaseyyet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it should work well. I was questioning the table reuse/repurpose but i think its been pretty well handled.

@kelvinqian00 kelvinqian00 merged commit 88d9279 into csv-export Mar 10, 2025
15 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