Skip to content

feat(saml): SimpleSaml local assertion encryption - #8319

Merged
enmande merged 4 commits into
mainfrom
auth/simple-saml-assertion-encryption
Sep 9, 2026
Merged

feat(saml): SimpleSaml local assertion encryption#8319
enmande merged 4 commits into
mainfrom
auth/simple-saml-assertion-encryption

Conversation

@enmande

@enmande enmande commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

PM-43087

📔 Objective

  • Adds the ability to configure SAML2.0 assertion encryption for the local SimpleSaml testing IdP in a standardized way, following the auth sources pattern.
  • Gitignores the resultant saml20-sp-remote.php file for local configuration.

Verified via docker compose and Aspire Apphost.

:octocat: Contributing docs related PR

@enmande enmande added ai-review Request a Claude code review t:feature Change Type - Feature Development labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR is scoped entirely to local development tooling: a new dev/saml20-sp-remote.php.example template that makes SAML 2.0 assertion encryption configurable for the bundled SimpleSAMLphp IdP, matching bind mounts on both the Compose (dev/docker-compose.yml:99) and Aspire (AppHost/BuilderExtensions.cs:141-142) dev paths, and a dev/.gitignore entry for the runtime copy. No key material is committed — the template ships a PASTE_BASE64_DER_CERTIFICATE_HERE placeholder — assertion.encryption defaults to FALSE so existing local IdP behavior is unchanged, the env var names in the template match those the image and both dev paths already use, and the documented openssl command reads dev/identity_server_dev.crt, which is the same certificate the SSO service loads as its SP signing certificate (bitwarden_license/src/Sso/Utilities/ServiceCollectionExtensions.cs:26). No production code, dependency manifests, or new container images are introduced.

Both findings from the earlier review round are resolved at head: the Aspire path now has a matching bind mount, and commit 8218258 corrected it to target metadata/ rather than config/ while dropping the auto-copy in favor of the manual copy procedure that already governs authsources.php.

Code Review Details

No code findings.

Comment thread dev/docker-compose.yml
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.89%. Comparing base (cb1f141) to head (8218258).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #8319       +/-   ##
===========================================
+ Coverage   17.70%   63.89%   +46.19%     
===========================================
  Files        1480     2471      +991     
  Lines       64163   105932    +41769     
  Branches     5148     9601     +4453     
===========================================
+ Hits        11359    67684    +56325     
+ Misses      52607    35907    -16700     
- Partials      197     2341     +2144     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@enmande
enmande marked this pull request as draft September 4, 2026 18:10
@enmande
enmande removed request for a team and coroiu September 4, 2026 18:12
Comment thread AppHost/BuilderExtensions.cs Outdated
Comment thread AppHost/BuilderExtensions.cs Fixed
Rely on manual copy procedure, outlined in contributing docs. Follows
the same pattern as auth sources for the IdP.
@enmande
enmande marked this pull request as ready for review September 4, 2026 19:54
@enmande
enmande requested review from a team as code owners September 4, 2026 19:54
Comment thread dev/docker-compose.yml
SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: null
volumes:
- ./authsources.php:/var/www/simplesamlphp/config/authsources.php
- ./saml20-sp-remote.php:/var/www/simplesamlphp/metadata/saml20-sp-remote.php

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interested in any feedback here.

Docker Compose can't bind to a conditionally-present file. If the file is not present, Compose will make a placeholder directory behind the scenes. This asks us to add another setup step for idp (copy the un-configured example, much like authsources.php) or accept behavior that can be hard to debug later.

We don't have a precedent for this today. I have an idea outlined here, but holding on a gut-check for that approach.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree w/ this approach. Reasoning given bitwarden/contributing-docs#858 (comment)

Thank you for adding this new capability.

@JaredSnider-Bitwarden JaredSnider-Bitwarden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you

@JaredSnider-Bitwarden
JaredSnider-Bitwarden removed the request for review from ike-kottlowski September 9, 2026 15:51
@enmande
enmande merged commit 7cd925b into main Sep 9, 2026
72 checks passed
@enmande
enmande deleted the auth/simple-saml-assertion-encryption branch September 9, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants