Skip to content

DEV - Explore: open the Explore reads to anonymous visitors, the expo… - #10

Merged
juliecoust merged 1 commit into
mainfrom
explore-public
Nov 10, 2026
Merged

juliecoust merged 1 commit into
mainfrom
explore-public

Conversation

@lamjarad-B

Copy link
Copy Markdown
Contributor

…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.

…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

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.70%. Comparing base (20d2b95) to head (31d57b3).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@juliecoust
juliecoust merged commit 24c99ff into main Nov 10, 2026
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