immich/server/src/services
Imperator Ruscal a560e08693
fix: re-evaluate OIDC role claim on every login and support array values (#29991)
* fix(server): re-evaluate OIDC role claim on every login and support array values

Previously the OIDC role claim (immich_role) was only read at user
auto-registration time and only accepted as a scalar string, so admin
status never updated after the first login and array-valued role/group
claims (common with Keycloak, Entra ID, etc.) were silently ignored.

Now the role claim is normalized from either a string or an array of
strings, and existing users have their isAdmin flag synced from the
claim on every login, keeping the IdP as the source of truth for
privileges while leaving isAdmin untouched when the claim is blank.

* fix(server): use .includes() instead of .some() for role claim check

Satisfies unicorn/prefer-includes lint rule flagged by CI.

* fix(server): resolve missing role claim to standard user and fix test mock

Default the OIDC role claim to 'user' when the IdP omits it so
auto-registration doesn't crash, and add the missing getAdmin mock in the
auth.service test so it correctly simulates an existing admin rather than
the first-user-registration path.

* fix: claim sync logic

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
2026-07-21 17:21:19 -04:00
..
shared feat: user upload heatmap (#28593) 2026-06-04 15:36:09 -04:00
activity.service.spec.ts refactor: small test factories (#26862) 2026-03-12 14:48:49 -04:00
activity.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
album.service.spec.ts feat: add album asset event handling (#29008) 2026-07-21 10:55:46 -05:00
album.service.ts feat: add album asset event handling (#29008) 2026-07-21 10:55:46 -05:00
api-key.service.spec.ts refactor: small test factories (#26862) 2026-03-12 14:48:49 -04:00
api-key.service.ts chore!: rename API key schemas (#27828) 2026-04-15 15:58:26 -04:00
api.service.spec.ts fix: ssr open graph tags (#27639) 2026-04-09 12:16:41 -04:00
api.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
asset-media.service.spec.ts fix(server): file uploads for files with extension only filenames (#30024) 2026-07-21 11:57:28 +00:00
asset-media.service.ts fix: album update event emitting (#30120) 2026-07-21 19:43:27 +00:00
asset.service.spec.ts feat(server): track video metadata (#28023) 2026-05-01 17:03:49 +00:00
asset.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
auth-admin.service.ts feat: reset oauth ids (#20798) 2025-08-08 15:42:38 -04:00
auth.service.spec.ts fix: re-evaluate OIDC role claim on every login and support array values (#29991) 2026-07-21 17:21:19 -04:00
auth.service.ts fix: re-evaluate OIDC role claim on every login and support array values (#29991) 2026-07-21 17:21:19 -04:00
base.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
cli.service.spec.ts refactor: small test factories (#26862) 2026-03-12 14:48:49 -04:00
cli.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
database-backup.service.spec.ts fix(database restores): don't assume onboarding has completed (#27052) 2026-03-26 18:30:14 +01:00
database-backup.service.ts chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092) 2026-07-21 15:33:46 +02:00
database.service.spec.ts chore(server)!: drop pgvecto.rs support (#28159) 2026-04-30 09:40:38 -04:00
database.service.ts chore(server)!: drop pgvecto.rs support (#28159) 2026-04-30 09:40:38 -04:00
download.service.spec.ts fix: sanitize filenames before adding to zip (#27893) 2026-04-17 13:05:53 -04:00
download.service.ts fix: sanitize filenames before adding to zip (#27893) 2026-04-17 13:05:53 -04:00
duplicate.service.spec.ts fix(server): do not merge metadata when multiple duplicates are kept (#29035) 2026-06-15 16:05:04 -04:00
duplicate.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
hls.service.spec.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
hls.service.ts feat(server): hls variant configuration (#29613) 2026-07-06 14:57:48 -04:00
index.ts feat: integrity check jobs (missing files, untracked files, checksums) (#24205) 2026-06-10 21:02:27 +02:00
integrity.service.spec.ts feat: integrity check jobs (missing files, untracked files, checksums) (#24205) 2026-06-10 21:02:27 +02:00
integrity.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
job.service.spec.ts refactor: more small tests (#26159) 2026-02-12 08:34:32 -05:00
job.service.ts chore(server): add switch case exhaustiveness lint (#29029) 2026-06-17 12:04:41 +02:00
library.service.spec.ts chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092) 2026-07-21 15:33:46 +02:00
library.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
maintenance.service.spec.ts feat: restore database backups (#23978) 2026-01-20 09:22:28 -06:00
maintenance.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
map.service.spec.ts fix(server): hide partner archived asset locations from map (#29028) 2026-06-15 16:30:52 +02:00
map.service.ts fix(server): hide partner archived asset locations from map (#29028) 2026-06-15 16:30:52 +02:00
media.service.spec.ts fix(server): set hvc1 tag when using hwa (#29908) 2026-07-14 11:03:30 -04:00
media.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
memory.service.spec.ts feat: hide hidden person from memories (#20877) 2026-05-07 19:54:26 +00:00
memory.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
metadata.service.spec.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
metadata.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
notification-admin.service.spec.ts feat(server): Option to configure SMTPS transport (#22833) 2025-10-17 10:21:27 +00:00
notification-admin.service.ts chore: eslint 10 (#26490) 2026-02-24 08:24:18 -05:00
notification.service.spec.ts feat: add album asset event handling (#29008) 2026-07-21 10:55:46 -05:00
notification.service.ts feat: add album asset event handling (#29008) 2026-07-21 10:55:46 -05:00
ocr.service.spec.ts refactor: small tests (#26141) 2026-02-11 11:49:00 -05:00
ocr.service.ts fix(server): use bigrams for cjk (#24285) 2025-12-01 17:24:37 +00:00
partner.service.spec.ts refactor: small test factories (#26862) 2026-03-12 14:48:49 -04:00
partner.service.ts chore: upgrade to kysely 0.28.11 (#26744) 2026-03-11 16:17:31 +01:00
person.service.spec.ts fix!: unauthorized face creation (#28561) 2026-06-02 22:44:11 +05:30
person.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
plugin.service.ts feat: workflow template (#28553) 2026-05-26 16:47:05 -04:00
queue.service.spec.ts feat: integrity check jobs (missing files, untracked files, checksums) (#24205) 2026-06-10 21:02:27 +02:00
queue.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
search.service.spec.ts fix!: search endpoints visibility can be omitted (#29385) 2026-06-29 22:00:02 +02:00
search.service.ts fix: search statistics locked folder permissions (#30063) 2026-07-20 20:08:42 -04:00
server.service.spec.ts feat: minimum face count per user (#27452) 2026-06-02 18:05:55 +02:00
server.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
session.service.spec.ts feat(server): added backchannel logout api endpoint (#26235) 2026-04-17 18:45:33 +00:00
session.service.ts feat(server): added backchannel logout api endpoint (#26235) 2026-04-17 18:45:33 +00:00
shared-link.service.spec.ts chore: upgrade to kysely 0.28.11 (#26744) 2026-03-11 16:17:31 +01:00
shared-link.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
smart-info.service.spec.ts refactor: small tests (#26141) 2026-02-11 11:49:00 -05:00
smart-info.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
stack.service.spec.ts chore: upgrade to kysely 0.28.11 (#26744) 2026-03-11 16:17:31 +01:00
stack.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
storage-template.service.spec.ts fix(server): render storage template date/time tokens in UTC (#24350) (#26917) 2026-04-14 18:45:14 +02:00
storage-template.service.ts fix(server): file uploads for files with extension only filenames (#30024) 2026-07-21 11:57:28 +00:00
storage.service.spec.ts feat: change default media location to /data (#20367) 2025-07-29 16:58:50 -04:00
storage.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
sync.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
system-config.service.spec.ts feat(server): hls variant configuration (#29613) 2026-07-06 14:57:48 -04:00
system-config.service.ts chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092) 2026-07-21 15:33:46 +02:00
system-metadata.service.spec.ts refactor: enum casing (#19946) 2025-07-15 14:50:13 -04:00
system-metadata.service.ts refactor: enum casing (#19946) 2025-07-15 14:50:13 -04:00
tag.service.spec.ts feat(server): track video metadata (#28023) 2026-05-01 17:03:49 +00:00
tag.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
telemetry.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
timeline.service.spec.ts fix(server): prevent locked assets from leaking to partners (#28652) 2026-05-27 17:33:49 -04:00
timeline.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
transcoding.service.spec.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
transcoding.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
trash.service.spec.ts refactor: job names (#19949) 2025-07-15 18:39:00 -04:00
trash.service.ts refactor: job names (#19949) 2025-07-15 18:39:00 -04:00
user-admin.service.spec.ts refactor: small test factories (#26862) 2026-03-12 14:48:49 -04:00
user-admin.service.ts feat: user upload heatmap (#28593) 2026-06-04 15:36:09 -04:00
user.service.spec.ts refactor(server)!: sanitize error messages to avoid leaking resource details (#28154) 2026-05-01 10:00:18 -04:00
user.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
version.service.spec.ts fix: version tests (#29032) 2026-06-12 15:54:42 +00:00
version.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
view.service.spec.ts chore: upgrade to kysely 0.28.11 (#26744) 2026-03-11 16:17:31 +01:00
view.service.ts refactor: remove album entity, update types (#17450) 2025-04-18 23:10:34 +02:00
workflow-execution.service.ts chore(deps): update dependency eslint-plugin-unicorn to v70 - abandoned (#29684) 2026-07-20 23:47:14 -04:00
workflow.service.ts feat: more plugin triggers and methods (#28690) 2026-05-29 14:02:07 -04:00