Commit Graph

18 Commits

Author SHA1 Message Date
Konstantin Chernyshev
bdb886d076 feat: add auth.registration_enabled flag and admin ui user creation (#543)
Hey! @maxdorninger, could you please take a look on the other one ;) ?

Closes #145 ; seems like a must have thing

- Add `auth.registration_enabled` flag (default `false` — sounds safer
default in current setup)
- Password registration: `/auth/register` route will return 403 if
disabled
- OIDC registration: `UserManager.oauth_callback` is overridden to
reject user without match; so no auto-provision
- `/auth/metadata` exposes the flag to the frontend
- Frontend: signup link hidden on the login card; direct navigation to
`/login/signup` redirects to `/login` via a `+page.ts` load guard
  
  
<img width="463" height="461" alt="Screenshot 2026-05-16 at 20 52 11"
src="https://github.com/user-attachments/assets/1def5142-e930-4aa6-8771-cbff54250c1f"
/>
<img width="450" height="391" alt="Screenshot 2026-05-16 at 20 52 22"
src="https://github.com/user-attachments/assets/b4013964-cace-4aeb-a848-48ced86fcc5f"
/>

  
Also this means uses need to be created somehow -- so..
- Add POST `/users` - admin-protected endpoint to create a new users
(created user can be used with OIDC)
- Fronted: Add new user button and modal dialog  

<img width="800" height="379" alt="Screenshot 2026-05-17 at 11 32 06"
src="https://github.com/user-attachments/assets/048e6c43-a1c1-42ce-a19c-fd9d916a47d9"
/>
<img width="537" height="439" alt="Screenshot 2026-05-17 at 11 32 12"
src="https://github.com/user-attachments/assets/3f83c2c1-027b-4279-b6a1-bbc8da77efed"
/>

---

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Add config toggle to enable/disable user registration; when disabled
sign-up endpoints return 403 and OIDC won’t auto-create unknown users.
Added admin API to create users.

* **Frontend**
* Login UI hides signup link when registration is disabled; signup page
redirects to login. Admin users list gains “Add User” modal to create
users.

* **Documentation**
* Authentication docs and config examples updated to document the new
option.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/maxdorninger/MediaManager/pull/543?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-05 19:41:04 +02:00
Maximilian Dorninger
a39e0d204a Ruff enable type annotations rule (#362)
This PR enables the ruff rule for return type annotations (ANN), and
adds the ty package for type checking.
2026-01-06 17:07:19 +01:00
Marcel Hellwig
ff013ac76e ruff: enable I lint 2026-01-05 19:30:42 +01:00
maxDorninger
8f5cc9329c update how oauth is handled 2025-09-13 18:42:34 +02:00
maxDorninger
1f544e55e8 add support for multiple oauth providers 2025-09-04 20:05:45 +02:00
wjbeckett
0158ac1040 fix: Add default values to config classes to resolve test validation errors
- Add default instances to all nested config classes (TorrentConfig, NotificationConfig, IndexerConfig, MetadataProviderConfig, AuthConfig)
- Add default values to AllEncompassingConfig fields to prevent validation errors during testing
- Update GitHub workflow to copy config.example.toml before running tests
- Ensures tests can run without requiring complete configuration files while maintaining production functionality

Fixes test collection errors where pydantic validation failed due to missing required config sections.
2025-07-18 16:56:19 +10:00
maxDorninger
8f7c1035c0 remove instantiation calls from settings models 2025-07-11 00:56:04 +02:00
maxDorninger
7ce6de7f85 replace all the other config usages with allencompassing config 2025-07-10 22:25:05 +02:00
maxDorninger
1b784c35c1 add allencompassing config, replace basic config usage with allencompassing config usage 2025-07-10 21:47:37 +02:00
maxDorninger
179dec0a7a add notificaton service providers (email, ntfy.sh, gotify and pushover) 2025-07-01 15:09:03 +02:00
maxDorninger
61705511b5 format files 2025-06-29 17:31:22 +02:00
maxDorninger
83521a36ff add feature: password resets via email 2025-06-29 16:26:01 +02:00
maxDorninger
cc5e9837ec add default values to config and fix import in tv/service 2025-06-07 15:49:41 +02:00
maxDorninger
31874aeb31 update admin email configuration to support multiple addresses and update documentation 2025-06-01 19:30:56 +02:00
maxDorninger
d2034d605e refactor: switch OAuth2 to OpenID and update related configurations 2025-05-30 18:41:06 +02:00
maxDorninger
6150080ac7 refactor: update API URL handling for client and server environments 2025-05-30 12:14:24 +02:00
maxDorninger
88c72e3303 switch to uv and remove old logo.svg 2025-05-29 22:33:13 +02:00
maxDorninger
206df8b150 refactor: change folder structure 2025-05-29 15:36:35 +02:00