Skip to content

feat(oauth): update library to v0.1.6 and surface client URI - #656

Merged
pcfreak30 merged 2 commits into
developfrom
aider-desk/task/update-oauth-lib-and-re-enable-client-uri
Sep 1, 2026
Merged

feat(oauth): update library to v0.1.6 and surface client URI#656
pcfreak30 merged 2 commits into
developfrom
aider-desk/task/update-oauth-lib-and-re-enable-client-uri

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Mirrors the finalized LumeWeb/portal#1852: bumps go.lumeweb.com/oauth to v0.1.6 and wires up OAuth client URI support.

Changes

Library bump

  • go.mod/go.sum: go.lumeweb.com/oauth v0.1.5 → v0.1.6. v0.1.6 persists resolved CIMD clients (RFC 9291) and their URL-form client_uri into the storage layer.

Migration

  • New goose migration 00004_oauth_clients_add_client_uri.sql adds oauth_clients.client_uri (sqlite; pinner-cli is sqlite-only) so the v0.1.6 GORM storage can read/write the column on existing databases.

Client URI surfacing

  • The OAuth authorize/login page now shows the client's client_uri (its RFC 9291 metadata document URL) so the resource owner can see which publisher is requesting access.
  • Per the SSRF-safe design in the finalized portal PR, the value is read only from durable storage (store.GetClient) — never via an outbound CIMD fetch. CIMD clients persisted by the library round-trip their client_uri through the store, so the authorize page surfaces it without resolving the metadata document again.

Testing

make test passes across the full suite (assets + go test -tags sqlite_fts5 ./...).


Summary

This pull request updates the OAuth library to v0.1.6 and introduces a new feature to surface the client URI (publisher information) on the OAuth authorization page.

Changes

Database Migration

  • Added a new SQLite migration (00004_oauth_clients_add_client_uri.sql) that adds a client_uri column to the oauth_clients table to store the client's metadata document URL.

OAuth Server Updates

  • New helper function clientForDisplay was added to retrieve stored client information for a given client ID. This is a best-effort, read-only operation that returns an empty record if the client is unknown or not persisted—it never performs an outbound CIMD fetch.
  • Updated AuthorizeGET and AuthorizePOST handlers to populate the new ClientURI field in the authorization page data by looking up the client's stored URI.

Login Page UI Enhancement

  • Added a ClientURI field to the oauthAuthorizeData template struct.
  • Updated the authorization page template to display a "Publisher" link when a client URI is available, showing the URI as a clickable link (opens in a new tab with security attributes). This lets the resource owner see which publisher is requesting access. The link is only shown when the URI is non-empty (e.g., for clients that don't publish a CIMD document).

The change improves transparency on the OAuth authorization page by showing users which publisher is requesting access, based on stored client metadata rather than performing additional network requests.

@kody-ai

This comment has been minimized.

Bump go.lumeweb.com/oauth to v0.1.6, which persists resolved CIMD clients
(and their URL-form client URI) into the oauth storage layer. Add a goose
migration adding the oauth_clients.client_uri column so the v0.1.6 GORM
storage can read/write it on existing databases.

Surface the client URI on the OAuth authorize/login page so a resource owner
can see which publisher (RFC 9291 client_id metadata document URL) is
requesting access. The value is resolved via a best-effort store read only
(never an outbound CIMD fetch), matching the SSRF-safe design in
LumeWeb/portal#1852.
@pcfreak30
pcfreak30 force-pushed the aider-desk/task/update-oauth-lib-and-re-enable-client-uri branch from d0afb86 to e00030f Compare September 1, 2026 04:46
@kody-ai

kody-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

kody code-review Kody Rules medium

Unbounded database query in clientForDisplay at line 215: calling o.store.GetClient(clientID) without context or timeout can block the HTTP handler indefinitely on a slow database, exhausting connection pools. Pass r.Context() (or equivalent) to clientForDisplay, propagate it via .WithContext(ctx) in GetClient, or apply a default timeout in the store call.

Kody rule violation: Disallow GORM queries without timeout

Comment thread internal/mcp/auth/oauth_login.templ

@kody-ai kody-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Kody K# (stored XSS): client_uri is influenced by the connecting client (it
is persisted from the CIMD document the client publishes), so rendering it
unvalidated in an <a href> could let a javascript:/data: scheme execute in
the resource owner's browser. Only an absolute http(s) client_uri is now
surfaced on the authorize page; all other values render no link.

Adds regression tests covering a valid https client_uri (surfaced) and
javascript:/data:/relative/scheme-less values (suppressed).
@kody-ai

kody-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Code Coverage Report

Total Coverage: 50.1%

Generated from commit: 0f9b21b
Repository: LumeWeb/pinner-cli

@pcfreak30
pcfreak30 merged commit cc40b89 into develop Sep 1, 2026
13 checks passed
@pcfreak30
pcfreak30 deleted the aider-desk/task/update-oauth-lib-and-re-enable-client-uri branch September 1, 2026 04:51
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.

1 participant