[PR #1472] [MERGED] refactor(server): auth guard #9088

Closed
opened 2026-02-05 13:58:18 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1472
Author: @jrasm91
Created: 1/29/2023
Status: Merged
Merged: 1/31/2023
Merged by: @alextran1502

Base: mainHead: refactor/auth-guard


📝 Commits (8)

📊 Changes

40 files changed (+327 additions, -501 deletions)

View changed files

📝 server/apps/immich/src/api-v1/communication/communication.gateway.ts (+1 -1)
📝 server/apps/immich/src/app.module.ts (+3 -4)
📝 server/apps/immich/src/decorators/authenticated.decorator.ts (+12 -9)
server/apps/immich/src/middlewares/admin-role-guard.middleware.ts (+0 -23)
server/apps/immich/src/middlewares/auth.guard.ts (+46 -0)
server/apps/immich/src/middlewares/route-not-shared-guard.middleware.ts (+0 -21)
server/apps/immich/src/modules/immich-auth/guards/auth.guard.ts (+0 -8)
server/apps/immich/src/modules/immich-auth/strategies/api-key.strategy.ts (+0 -21)
server/apps/immich/src/modules/immich-auth/strategies/public-share.strategy.ts (+0 -22)
server/apps/immich/src/modules/immich-auth/strategies/user-auth.strategy.ts (+0 -18)
📝 server/apps/immich/test/album.e2e-spec.ts (+3 -9)
📝 server/apps/immich/test/test-utils.ts (+2 -2)
📝 server/apps/immich/test/user.e2e-spec.ts (+3 -11)
server/libs/domain/src/api-key/api-key.core.ts (+27 -0)
📝 server/libs/domain/src/api-key/api-key.service.spec.ts (+8 -39)
📝 server/libs/domain/src/api-key/api-key.service.ts (+2 -19)
📝 server/libs/domain/src/auth/auth.core.ts (+2 -21)
📝 server/libs/domain/src/auth/auth.service.spec.ts (+66 -43)
📝 server/libs/domain/src/auth/auth.service.ts (+42 -20)
📝 server/libs/domain/src/auth/index.ts (+0 -1)

...and 20 more files

📄 Description

This PR refactors the auth guard to not use passport, making it easier to understand what's going on in the authentication process.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1472 **Author:** [@jrasm91](https://github.com/jrasm91) **Created:** 1/29/2023 **Status:** ✅ Merged **Merged:** 1/31/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `refactor/auth-guard` --- ### 📝 Commits (8) - [`7d3ac23`](https://github.com/immich-app/immich/commit/7d3ac234a100db6612914d665baaa5e2f463ccc6) refactor: auth guard - [`d1a96fb`](https://github.com/immich-app/immich/commit/d1a96fb4e099c88afa3308ede3c2434e3384bb56) chore: move auth guard to middleware - [`8621247`](https://github.com/immich-app/immich/commit/8621247bb0075bd86adbdbddf2e668b59e3b93ea) chore: tests - [`9952af9`](https://github.com/immich-app/immich/commit/9952af9e7b6711fa4b62cbd888e2d54e772157d9) chore: merge - [`3e8d9c6`](https://github.com/immich-app/immich/commit/3e8d9c6861bad2a00a53a7d7e9f49b419f6e62da) chore: remove unused code - [`71080c7`](https://github.com/immich-app/immich/commit/71080c7d02e0d3d12ad4cff2c5b603342ab96dd0) fix: migration to uuid without dataloss - [`a678bd7`](https://github.com/immich-app/immich/commit/a678bd7a47508dc125de0e40a0634a4dee06e4fc) chore: e2e tests - [`2ee7aba`](https://github.com/immich-app/immich/commit/2ee7abaae9cda4462881c9f492674c33a562c336) chore: removed unused guards ### 📊 Changes **40 files changed** (+327 additions, -501 deletions) <details> <summary>View changed files</summary> 📝 `server/apps/immich/src/api-v1/communication/communication.gateway.ts` (+1 -1) 📝 `server/apps/immich/src/app.module.ts` (+3 -4) 📝 `server/apps/immich/src/decorators/authenticated.decorator.ts` (+12 -9) ➖ `server/apps/immich/src/middlewares/admin-role-guard.middleware.ts` (+0 -23) ➕ `server/apps/immich/src/middlewares/auth.guard.ts` (+46 -0) ➖ `server/apps/immich/src/middlewares/route-not-shared-guard.middleware.ts` (+0 -21) ➖ `server/apps/immich/src/modules/immich-auth/guards/auth.guard.ts` (+0 -8) ➖ `server/apps/immich/src/modules/immich-auth/strategies/api-key.strategy.ts` (+0 -21) ➖ `server/apps/immich/src/modules/immich-auth/strategies/public-share.strategy.ts` (+0 -22) ➖ `server/apps/immich/src/modules/immich-auth/strategies/user-auth.strategy.ts` (+0 -18) 📝 `server/apps/immich/test/album.e2e-spec.ts` (+3 -9) 📝 `server/apps/immich/test/test-utils.ts` (+2 -2) 📝 `server/apps/immich/test/user.e2e-spec.ts` (+3 -11) ➕ `server/libs/domain/src/api-key/api-key.core.ts` (+27 -0) 📝 `server/libs/domain/src/api-key/api-key.service.spec.ts` (+8 -39) 📝 `server/libs/domain/src/api-key/api-key.service.ts` (+2 -19) 📝 `server/libs/domain/src/auth/auth.core.ts` (+2 -21) 📝 `server/libs/domain/src/auth/auth.service.spec.ts` (+66 -43) 📝 `server/libs/domain/src/auth/auth.service.ts` (+42 -20) 📝 `server/libs/domain/src/auth/index.ts` (+0 -1) _...and 20 more files_ </details> ### 📄 Description This PR refactors the auth guard to not use `passport`, making it easier to understand what's going on in the authentication process. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:58:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#9088