memos/server/auth
Steven 26d10212c6 refactor: consolidate duplicated auth logic into auth package
Add ApplyToContext and AuthenticateToUser helpers to the auth package,
then remove the duplicated auth code spread across the MCP middleware,
file server, Connect interceptor, and gRPC-Gateway middleware.

- auth.ApplyToContext: single place to set claims/user into context after Authenticate()
- auth.AuthenticateToUser: resolves any credential (bearer token or refresh cookie) to a *store.User
- MCP middleware: replaced manual PAT DB lookup + expiry check with Authenticator.AuthenticateByPAT
- File server: replaced authenticateByBearerToken/authenticateByRefreshToken with AuthenticateToUser
- Connect interceptor + Gateway middleware: replaced duplicated context-setting block with ApplyToContext
- MCPService now accepts secret to construct its own Authenticator
2026-02-24 23:08:16 +08:00
..
authenticator.go refactor: consolidate duplicated auth logic into auth package 2026-02-24 23:08:16 +08:00
context.go refactor: consolidate duplicated auth logic into auth package 2026-02-24 23:08:16 +08:00
extract.go refactor(auth): remove legacy session cookie authentication 2025-12-19 00:09:08 +08:00
token.go refactor(auth): remove legacy session cookie authentication 2025-12-19 00:09:08 +08:00
token_test.go refactor: migrate HOST roles to ADMIN 2026-01-20 23:38:30 +08:00