Skip to content

Check dev users first in the example, fix README claims left after #341 - #344

Merged
umputun merged 1 commit into
masterfrom
docs-followup-341
Nov 25, 2026
Merged

umputun merged 1 commit into
masterfrom
docs-followup-341

Conversation

@umputun

@umputun umputun commented Nov 25, 2026

Copy link
Copy Markdown
Member

Follow-up to #341 with the corrections from its last review, made after the merge.

The example's Validator matched user id prefixes before the dev name check. Dev ids are the bare typed names, so a dev user named email_alice or custom123_x passed the dev_ rule. The signed provider name now decides first. The bitbucket endpoint comes from golang.org/x/oauth2/bitbucket, same URLs, which gosec read as hardcoded credentials.

README and example README:

  • a dev user without the dev_ prefix gets 401 and cleared cookies on the first authenticated request, not only on /private_data
  • User.Audience is filled by Get, not by Parse or the login response
  • TokenDuration applies to tokens issued through Set; a token signed with TokenService().Token gets no expiry unless ExpiresAt is set, and v2 accepts it from the header or query without limit
  • the default custom server login page also asks for a password
  • an empty Telegram base URL selects the public API
  • the service's own hostname accepts any port even when Opts.URL names one
  • the reverse proxy case is labelled as not supported
  • a restart forgets redeemed verify tokens with the default in-memory store, also in AGENTS.md, which closes that backlog item

The Opts.AudienceReader comment in both modules now says nil allows any audience and an empty list rejects every token, as checkAuds does.

Three new backlog items: aud from the login request is not proof of tenant membership, a self-built handler must set claims.ID for the XSRF check, and the LoginAuth comment still names outlook.com.

The example's Validator matched user id prefixes before the dev name
check. Dev ids are the bare typed names, so a dev user named
email_alice or custom123_x passed the dev_ rule. The signed provider
name now decides first. The bitbucket endpoint comes from
golang.org/x/oauth2/bitbucket, the same URLs, which gosec read as
hardcoded credentials.

README and example README fixes:
- a dev user without the dev_ prefix gets 401 and cleared cookies on
  the first authenticated request, not only on /private_data
- User.Audience is filled by Get, not by Parse or the login response
- TokenDuration applies to tokens issued through Set; a token signed
  with TokenService().Token gets no expiry unless ExpiresAt is set
- the default custom server login page also asks for a password
- an empty Telegram base URL selects the public API
- the service's own hostname accepts any port even when Opts.URL names
  one
- the reverse proxy case is labelled as not supported
- a restart forgets redeemed verify tokens with the default in-memory
  store, in the README and AGENTS.md, which closes that backlog item

The Opts.AudienceReader comment in both modules says nil allows any
audience and an empty list rejects every token, as checkAuds does.

New backlog items: aud from the login request is not proof of tenant
membership, a self-built handler must set claims.ID for the XSRF
check, and the LoginAuth comment still names outlook.com.
@umputun
umputun merged commit 6c14f3e into master Nov 25, 2026
8 checks passed
@umputun
umputun deleted the docs-followup-341 branch November 25, 2026 17:26
@coveralls

coveralls commented Nov 25, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 45664351901

Coverage decreased (-0.4%) to 88.193%

Details

  • Coverage decreased (-0.4%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4006
Covered Lines: 3533
Line Coverage: 88.19%
Coverage Strength: 14.57 hits per line

💛 - Coveralls

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