✨ Add ForwardAuth transparent SSO authentication support#4
Merged
Conversation
c421f2d to
98ee682
Compare
b1882c0 to
c36cd97
Compare
There was a problem hiding this comment.
Pull request overview
Adds ForwardAuth-style transparent SSO support by trusting X-Auth-Request-* headers (when enabled via flags), plus an optional frontend logout redirect for mPass “full signout” flows.
Changes:
- Backend: introduce
app.http.auth-requestmiddleware, wire it into RPC routes, and add middleware tests. - Frontend: allow logout to redirect to an externally provided signout URL (via runtime
config.js). - Docker: inject
MPASS_SIGNOUT_URLintoconfig.jsat container start.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/main/data/auth.cljs | Redirect logout to external signout URL when configured. |
| frontend/src/app/config.cljs | Read penpotMpassSignoutUrl from runtime config. |
| docker/images/files/nginx-entrypoint.sh | Inject MPASS_SIGNOUT_URL into frontend config.js. |
| docker/images/files/config.js | Add runtime config placeholder for penpotMpassSignoutUrl. |
| backend/test/backend_tests/http_middleware_test.clj | Add tests for X-Auth-Request middleware behavior. |
| backend/src/app/rpc.clj | Add auth-request middleware to RPC route middleware chain. |
| backend/src/app/http/auth_request.clj | New middleware implementing ForwardAuth/X-Auth-Request trust + optional auto-register. |
| backend/src/app/config.clj | Add :smb-name config key to schema. |
| backend/scripts/_env | Enable new X-Auth-Request flags in dev env script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| (l/inf :hint "x-auth-request: auto-registered profile" | ||
| :email email | ||
| :profile-id (str (:id profile))) | ||
| (auth/create-profile-rels cfg profile))))))) |
There was a problem hiding this comment.
auth/create-profile-rels expects a DB connection as its first argument, but this code passes the full cfg map. This will break the auto-registration flow at runtime when :x-auth-request-auto-register is enabled. Pass conn (from the tx context) instead of cfg.
Suggested change
| (auth/create-profile-rels cfg profile))))))) | |
| (auth/create-profile-rels conn profile))))))) |
5eac2f7 to
23e369d
Compare
23e369d to
c6f1d37
Compare
UsamaSadiq
approved these changes
Apr 15, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Ticket
Summary
Steps to reproduce
Checklist
developby default.CHANGES.mdfile, referencing the related GitHub issue, if applicable.