Skip to content

test(connector/saml): backport upstream fix for expired OAM test cert - #8

Open
Optic00 wants to merge 1 commit into
netbirdio:masterfrom
Optic00:codex/backport-saml-test-cert
Open

test(connector/saml): backport upstream fix for expired OAM test cert#8
Optic00 wants to merge 1 commit into
netbirdio:masterfrom
Optic00:codex/backport-saml-test-cert

Conversation

@Optic00

@Optic00 Optic00 commented Aug 3, 2026

Copy link
Copy Markdown

Overview

Cherry-pick of upstream dexidp/dex commit bd5e9b6c onto this fork's master branch.

What this PR does / why we need it

The SAML connector test fixture certificate in connector/saml/testdata expired, so TestVerifyUnsignedMessageAndSignedAssertionWithRootXmlNs fails on every run regardless of the change under test.
The same failure appears in the fork's last CI run.

This replaces oam-ca.pem and oam-resp.xml with the regenerated fixture from upstream.
The new certificate is a self-signed test-only certificate valid until 2125, and the response is re-signed against it.
No connector or production code changes.

Special notes for your reviewer

The commit is a patch-id-equivalent cherry-pick of bd5e9b6c, with the upstream author's Signed-off-by and the cherry-pick source line retained.

Verified locally: the previously failing test passes, and go test -race ./... passes for the whole repository.

Summary by CodeRabbit

  • Tests
    • Updated the SAML authentication test data with a deterministic response.
    • Added coverage for modern RSA-SHA256 assertion signing, embedded certificates, fixed timestamps, and email identity attributes.
    • Removed environment-specific and legacy SHA-1 signature scenarios.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
(cherry picked from commit bd5e9b6)
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cd0e7105-ea86-4f1d-ac9e-a9c419e4a104

📥 Commits

Reviewing files that changed from the base of the PR and between a163de3 and 9ce7c49.

⛔ Files ignored due to path filters (1)
  • connector/saml/testdata/oam-ca.pem is excluded by !**/*.pem
📒 Files selected for processing (1)
  • connector/saml/testdata/oam-resp.xml

📝 Walkthrough

Walkthrough

The SAML response fixture was replaced with deterministic Dex OAM values. It now includes fixed timestamps, issuer, identity, audience, email claims, and an assertion-level RSA-SHA256 signature with an embedded certificate.

Changes

SAML fixture update

Layer / File(s) Summary
Replace SAML response fixture
connector/saml/testdata/oam-resp.xml
The fixture uses fixed IDs, timestamps, issuer, subject, audience, and identity values. It adds an email attribute and certificate-backed RSA-SHA256 assertion signature. Legacy SHA-1, authentication statement, and environment-specific values were removed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A rabbit checks the signed reply,
With fixed IDs beneath the sky.
Dex stamps the claims, the times align,
RSA guards each testing line.
Hop, hop—OAM is ready to fly!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the SAML test fixture change and the expired OAM test certificate fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants