Commit Graph
5 Commits
Author SHA1 Message Date
Gabriel20xxandClaude Sonnet 5 f58579290d Add project-key support to Python/Node/Java AuthClient equivalents
Mirrors Go's authclient.WithProjectKey: each client now accepts a
project_key/projectKey and sends it as X-Project-Key on every request,
so AuthGuard can enforce per-user project-access restriction for
consumers written in these languages too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-13 21:08:49 +02:00
Gabriel20xxandClaude Sonnet 5 449bb6fd6a Auto-detect scheme for AUTHGUARD_URL instead of always assuming https
A bare host:port (e.g. a LAN AuthGuard reachable only over plain HTTP)
was always defaulting to https, so a TLS handshake against a plain-HTTP
AuthGuard failed at the transport level. Now a loopback, RFC1918/RFC4193
private, or link-local host (or a .local name) defaults to http instead;
an explicit http:// or https:// is still always honored as-is.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 21:46:53 +02:00
Gabriel20xx de9b599232 authclient: auto-detect https for a bare AUTHGUARD_URL host, extend Java client to full surface
AUTHGUARD_URL only needs to name a host/IP now - all four language
clients (Go/Node/Python/Java) assume https:// when no scheme is given,
so a bare value like 192.168.1.50:8080 works instead of failing
outright; an explicit http://scheme is still left alone for local/LAN
deployments.

Java's AuthClient was validate-only; it now mirrors the Go/Node/Python
clients' full surface (register/login/logout/me/totp*/passwordReset*/
managedUsers*/setupStatus) using Jackson for the request/response JSON
this larger surface has to build and parse, since MegaBasterd (this
package's only verified consumer) already depends on Jackson.
2026-09-02 20:49:29 +02:00
Gabriel20xxandClaude Sonnet 5 f5a20b72af Extend Go/Python/Node authclient with the full AuthGuard API surface
Previously each authclient only supported GET /api/session/validate - the
"just gate requests behind a valid session" case. A service that runs its
own login/register/admin-user-management screens proxied to AuthGuard
(GameStream's pattern, now also used by InfiniteVideo and OutdoorGames)
needs much more: register, login, logout, me, totp_enable/verify/disable,
password-reset request/confirm, and managed-user list/create/update/delete.

The Go client already had this full surface from GameStream's original
migration; Python and Node only had validate(), so both gained the same
method set as Go, mirroring its behavior and JSON wire shapes exactly
(register/login/logout return the raw Set-Cookie values to forward,
totp_required surfaces on a 401 from login, etc). Also adds a SetupStatus/
setup_status/setupStatus method (GET /api/setup-status) so a service's own
first-launch flow can tell whether AuthGuard already has an account before
showing its own account-creation form, and adds totp_enabled to the Go
client's PublicUser (AuthGuard has reported it for a while; the client
just hadn't picked it up).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-02 10:37:21 +02:00
Gabriel20xxandClaude Sonnet 5 858cc1ac63 Add Node.js authclient (mirrors the Go shared/backend/authclient)
Lets any Node service validate requests against AuthGuard instead of
maintaining its own local user table - the missing piece needed to
wire AuthGuard into OutdoorGamesPlatform/server-node and any other
Node service, matching what authclient already provides for Go.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-31 22:31:46 +02:00