shared/backend/auth: adds SchemaOptions.ProjectScoping and Store methods
(SetUserProjects/UserProjects/UserProjectsByUser/IsProjectAllowed,
SetKnownProjects/KnownProjects) backing AuthGuard's new per-user
project-access restriction.
shared/backend/authclient: Client can now identify its calling project to
AuthServer via WithProjectKey (sent as X-Project-Key on every request), so
AuthServer can enforce the restriction above per project.
shared/backend/mediaauth: generalized from a media-family-only package
into the one shared auth-proxy engine every AuthGuard-integrated project
should use. New accepts a projectKey; the login-required/setup-claim
storage it needs is now expressed as a small Store interface
(NewWithStore lets any project's own storage satisfy it, not just the
media family's shared `settings` table, which pgSettingsStore still backs
for existing callers). ManagedUpdateUser/ManagedDeleteUser now resolve
their {id} path param via chi.URLParam OR the stdlib 1.22+ ServeMux's
PathValue, so non-chi consumers work unchanged.
packages/web-ui: UserManagement gains an optional `projects` prop (a
per-account project-access picker), used only by AuthGuard's own admin UI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Button size variants (sm 2rem, lg 2.875rem), sc-input/sc-select (2.6rem),
and the pagination controls (2.1rem/2.25rem) each rendered at a different
height, so any row mixing them (a select next to a button, a page-size
dropdown next to pagination buttons) was visibly misaligned. Textarea
keeps its own min-height since it's multi-line by design.
The button's top offset was unset, so its absolute-position static
position was recomputed from the flex-wrap layout whenever .sc-nav
wrapped onto its own row on open, causing a visible vertical jump.
Pinning top to the header's mobile padding keeps it stationary.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The select's value was coerced to a string via String(pageSize) while
the <option> values are numbers. Svelte 5 matches a non-bound <select>
value against each option's stored value with Object.is, so "24"
never matched 24 and the dropdown rendered with no option selected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The component's markup used sc-pagination* classes that had no
matching rules anywhere in the shared stylesheet, so it rendered
unstyled in every consumer.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Uses the shared Pagination component instead of rendering every
fetched user in one unpaginated list.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The About item falls back to an <a> when no onAbout handler is wired.
The :visited fix only covered post-click state; the unvisited a:link
pseudo-class still beat the .sc-profile-menu-item class in specificity,
making the item look lighter/whiter than the button-based items until
clicked once.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Documents the hue-spaced palette used to give every project in the
workspace a unique webui primary color: which colors are claimed by
which project, and which remain reserved for future projects.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AuthPage's password (and, in setup mode, confirm-password) field no
longer forces a non-empty value client-side -- the server already
enforces the real rules (a correct password to log in, >=8 chars to
register/bootstrap), so this only replaces a native browser validation
popup with the server's own error message.
Also bring UserManagement in line with an AuthGuard-only edit that had
drifted ahead of this source (username/email/password relaxed to "at
least one of username/email, password optional" for admin-created
users) so the next consumer sync doesn't silently revert it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The workspace's Central/ and Forks/ parent folders were renamed to
Core/ and Fork/ (singular) - a pure local filesystem reorganization,
git repos don't care about their own absolute path. Updates
sync-consumers.ps1's consumer list and workspace-root detection, plus
doc-comment/README cross-references that hardcoded the old paths.
HordeWorker's entry stays at the old 'Forks/HordeWorker' path for now:
a long-running process holds that directory open, so it couldn't be
moved to Fork/HordeWorker in this pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a new persisted "wide page" preference (theme/language-style store,
settings-dialog checkbox, main-content width override) alongside the
existing theme switcher and language selector.
Also completes three project renames throughout the shared source:
MediaAnalyzer -> ContentScanner, MediaTools -> CraftStudio, and
LoggingServer -> OmniLogger, across the Go media-backend service enum,
webui AppId/app-config/project-icons, renamed feature components, and
the sync-consumers.ps1 consumer list.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Rename MediaConfig -> ProjectConfigurator throughout; drop the Parameters
tab/page; rename the Mounts tab to Projects and restructure it into three
sections: Central services, Main services, Third-party services
- Add a self-describe contract (GET /api/info returning name/tabs/mountTypes)
and a server-side discovery proxy (POST /api/discover-service) so adding a
main service only requires a URL
- Add ProjectConfigurator HA: multiple instances now sync their settings with
each other (GET /api/settings/export, POST /api/settings/sync, a periodic
background puller), last-write-wins per key by updated_at
- Add a generic, project-agnostic file-storage API on CarrierNode
(GET/POST/DELETE /api/mount/{project}/{type}[/*]) driven by the same
configured_mounts data the Projects workspace already writes, usable by any
registered project, not just the media family
- Add last_login_at tracking to the shared auth Store/User (schema, queries,
UpdateLastLogin) and surface it through the shared web-ui ManagedUser type
and UserManagement component
- Retire the "MediaCollection" name: Go module -> repos.gfranz.ch/Gabriel20xx/shared/media-backend,
binary -> mediabackend, session cookie default -> "session", media-webui
merged into webui, media-shared-assets renamed to legacy-assets and pruned
to the one file MediaDesktop still uses
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
User management is now centralized in AuthGuard's webui, so the
per-project Admin dialog (user CRUD + require-login toggle) is
redundant. The require-login toggle will move to ProjectConfigurator
in the future.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reformat the new scheme-detection test cases with `ruff format` (line
length) so `ruff format --check .` passes in consumers that lint the
whole repo, e.g. Heretic/HordeWorker's CI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
Extracts a new backend/authproxy package for the AuthGuard-proxy helper
functions (session cookie handling, input normalization, error
translation) that Bitmagnet/GameStream/media-backend/AutoCode/
CollabTable/PubliSafe/SimpleCollection/SyncServer/UnraidMonitor/
OutdoorGames were each independently reimplementing, and repoints all
of them onto it.
Extends packages/web-ui's Button/Badge with the variants media-webui
needed (outline, icon size, primary badge) and promotes EmptyState/
SectionTitle/Metric/StatusWidget/StatusDialog into the shared library,
then migrates media-webui off its own diverged ui/{button,card,badge,
metric} components and local duplicates of the promoted components
onto @gabriel20xx/web-ui, so media-webui is a proper consumer of the
same design system every other project already uses instead of a
parallel fork.
Also removes the dead `desktop`/MediaDesktop service variant from
media-backend and media-webui (MediaDesktop is an Electron client that
never actually runs this stack).
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.
margin-bottom: 1rem left too much empty space between the title card
and the cards/content on the page. Reduce to 0.5rem.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
urllib.error.HTTPError's stub declares hdrs: Message (non-optional);
passing None works at runtime but fails strict type checking. Heretic's
lint workflow runs ty over its full tree including the vendored shared/
snapshot, which is what caught this - construct an empty Message()
instead, identical runtime behavior.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Java 8-compatible (not 11+/records as originally suggested) - verified
MegaBasterd's pom.xml compiles this source directly via
build-helper-maven-plugin rather than depending on a packaged jar, and
is pinned to source/target 1.8, so newer APIs would have broken its
real build. Uses HttpURLConnection instead of java.net.http.HttpClient,
a plain final class instead of a record.
No JSON dependency added (defensive regex parsing of AuthGuard's small
fixed response shape) - java-backend has zero runtime dependencies
today and this is the only class that would need one otherwise.
Also added this package's first pom.xml, README.md, and test directory
- none existed before.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Async (asyncpg-consistent with the rest of this package), stdlib-only
HTTP via urllib + asyncio.to_thread (no new dependency for one GET
call). Framework-agnostic by design: read the two real consumers
(HordeWorker's aiohttp webui, Heretic's FastAPI app) and they don't
share a framework, so token_from_request/resolve_user work over plain
headers/cookies mappings rather than shipping a framework adapter.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
Browser theme CSS/JS assets shared across MediaCollection's client apps,
moved here per owner request to centralize shared components. The
build:theme sync script now lives inside the package itself rather than
assuming a monorepo-root scripts/ sibling; its 'test' script is a no-op
placeholder since the package has no tests of its own yet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Wires a pageHeaderActions snippet prop through to PageHeader's actions
slot, so consumers can render content (e.g. stats, buttons) in the
page title container alongside the title/description.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AutoCode's actions page depends on a Pagination component that only
ever existed in its consumer-side shared/ snapshot, never in this
canonical repo. Every sync-consumers.ps1 run deleted it as stale,
repeatedly breaking AutoCode's lint and Docker builds. Adding it here
makes the sync idempotent instead of destructive.
The page title box and the content below it (e.g. a search/filter
panel) were separated by 24px, and main had 32px/48px top/bottom
padding around that stack. Both now use a consistent 16px.
- Add a dedicated admin entry (with icon) to the header profile dropdown, visible only to admins
- Move all user-management settings from SettingsDialog/ProfileDialog into a new AdminDialog
- Export AdminDialog from the package index
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
One line was wrapped as if for an 88-column budget, violating the
100-column ruff line-length this package declares in its own
pyproject.toml - ruff format (which respects that nested config)
correctly flagged it as unformatted.
The brand <img> sized itself with width/height:100%, but it isn't
wrapped in a sized container like the fallback letter-mark is, and its
flex-item parent has no definite size for the percentage to resolve
against - so it rendered at whatever intrinsic size the favicon
happened to report instead of a consistent icon size.
- Added @lucide/svelte as a dependency for icon support in various components.
- Updated AboutDialog, AppShell, AuthPage, Header, SettingsDialog, and styles for improved functionality and UI consistency.
- Introduced new props and state management for better user experience.
- Refactored CSS for cleaner styling and improved layout.
- Added TOTP support for two-factor authentication in the auth module.
- Introduced new types and interfaces for TOTP setup and token actions in the web UI.
- Created backend logic for generating and verifying TOTP secrets and tokens.
- Implemented user management features including role assignments and user CRUD operations.
- Enhanced UI components for managing users and TOTP settings.
- Added styles for optional labels and authentication reset links.
- Implemented reset code generation and validation for admin accounts.