Repository navigation
DEV - Explore: open the Explore reads to anonymous visitors, the expo… - #10
Merged
Merged
Conversation
…rts still need a login Every /explore route (projects, map, selection, ecotaxa, images, graphs) now uses the new auth_optional middleware: a request without an access cookie goes on anonymous, a valid cookie carries its user, and an invalid or expired one is still refused (401) so that the client refreshes it instead of browsing as anonymous. The /exports routes keep `auth`. An anonymous caller is resolved as a user without any privilege: the access matrix decides what it sees, the exportable selection showing what a login would let it export. The contact and manager e-mails are only served to a logged-in caller (empty for an anonymous one), and /explore/images only draws from the projects whose figures the caller may see, for everybody. A failed refresh (missing, invalid or revoked refresh token, unknown or unusable user) now clears both session cookies: a stale access cookie would otherwise keep refusing this browser on the routes open to anonymous visitors. Docs and spec updated (CLAUDE.md, route docs, openapi.json regenerated). TODO.md item 4: no per-client rate limit on the open Explore routes yet.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
- Coverage 81.72% 81.70% -0.02%
==========================================
Files 214 214
Lines 12551 12541 -10
Branches 3020 3000 -20
==========================================
- Hits 10257 10247 -10
Misses 2125 2125
Partials 169 169 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rts still need a login
Every /explore route (projects, map, selection, ecotaxa, images, graphs) now uses the new auth_optional middleware: a request without an access cookie goes on anonymous, a valid cookie carries its user, and an invalid or expired one is still refused (401) so that the client refreshes it instead of browsing as anonymous. The /exports routes keep
auth.An anonymous caller is resolved as a user without any privilege: the access matrix decides what it sees, the exportable selection showing what a login would let it export. The contact and manager e-mails are only served to a logged-in caller (empty for an anonymous one), and /explore/images only draws from the projects whose figures the caller may see, for everybody.
A failed refresh (missing, invalid or revoked refresh token, unknown or unusable user) now clears both session cookies: a stale access cookie would otherwise keep refusing this browser on the routes open to anonymous visitors.
Docs and spec updated (CLAUDE.md, route docs, openapi.json regenerated). TODO.md item 4: no per-client rate limit on the open Explore routes yet.