Conversation
Spec Reviewer Report 📬0 / 2 Requirements met for ticket:
2 unmet requirement(s)
|
30db459 to
18f5a9d
Compare
rpylipow
left a comment
There was a problem hiding this comment.
Changes look good. Could you please also document this new functionality in the README.md?
|
@rpylipow README.md updated ✅ |
|
@rpylipow How does the release process work for this library? Do we need to do anything else besides merging? |
|
@john-sonz Our axon application runs again the main branch of this So my suggestion is waiting to merge this until after you tested the axon integration with it incase you need to make changes. You should be able to test locally/staging on axon using something like |
f0c40a5 to
c22d5ff
Compare
|
@john-sonz I was helping @madsmorrison test this today and we discovered that our error pipeline needs to be moved up a level (my fault, I gave you short-sided instructions). Here's the general approach I discussed w/ Claude (I chopped off the implementation instructions bc I didn't have to time to vet them). |
|
@rpylipow Ooh, that makes sense, I'll rewrite it this way |
Co-authored-by: baz-reviewer[bot] <174234987+baz-reviewer[bot]@users.noreply.github.com>
d949292 to
5a1a500
Compare
lib/samly/sp_handler.ex
Outdated
| |> redirect(302, target_url) | ||
| else | ||
| error -> conn |> send_resp(403, "invalid_request #{inspect(error)}") | ||
| error -> | ||
| conn | ||
| |> put_private(:samly_error, {:invalid_logout_response, error}) | ||
| |> Helper.run_error_pipeline() | ||
| |> case do | ||
| %Conn{halted: true} = conn -> conn | ||
| conn -> conn |> send_resp(403, "invalid_request #{inspect(error)}") | ||
| end |
There was a problem hiding this comment.
Logout response fallback still renders send_resp(403, "invalid_request #{inspect(error)}") when the new on_error_pipeline is absent or doesn't halt, so SSO errors continue to leak internal reasons to the user despite the ticket's requirement for secure, user-friendly defaults; can we stop returning inspect(error) and use a generic response when the pipeline isn't handling the request?
Finding type: Basic Security Patterns
- Apply fix with Baz
| |> Helper.run_error_pipeline() | ||
| |> case do | ||
| %Conn{halted: true} = conn -> | ||
| conn | ||
|
|
There was a problem hiding this comment.
This block reruns the on-error pipeline + halted check that Helper.handle_error_response/4 already centralizes, so any future changes to pipeline/response flow require editing the helper and this branch separately; can we delegate the debug-HTML branch to that helper (e.g. by passing a custom responder) instead of copying the pipeline/case logic?
Finding type: Code Dedup and Conventions
- Apply fix with Baz
User description
This PR adds the
on_error_pipelineoption to the IDP config data.on_error_pipelineis a plug pipeline and follows the same behaviour aspre_session_create_pipelineon_error_pipelineis not provided, then the default Samly behaviour is not affectedGenerated description
Below is a concise technical summary of the changes proposed in this PR:
Introduces a configurable error handling pipeline within the
Samlylibrary to replace verbose technical SAML error messages with secure, user-friendly responses, addressing a critical security concern. This change centralizes error management by routing various authentication failures through a newon_error_pipelinefor consistent and customizable error page rendering.Samly.Helper.handle_error_response. This ensures consistent error processing for scenarios like invalid requests, unknown identity providers, and access denials, while also passing relevant error and assertion data to the custom pipeline for detailed logging or display. A minor code formatting adjustment inlib/samly/idp_data.exis also included.Modified files (5)
Latest Contributors(2)
on_error_pipelineinfrastructure inSamly.Helperto allow custom handling of SAML errors, including setting error context in the Plug connection. Configure this pipeline viaSamly.Providerand document its usage and benefits in theREADME.mdto guide developers in creating secure and user-friendly error experiences.Modified files (3)
Latest Contributors(2)