Skip to content

fix: accept xs:duration cacheDuration on SAML EntitiesDescriptor - #2961

Open
pcbeingused333 wants to merge 1 commit into
supabase:masterfrom
pcbeingused333:fix/saml-xs-duration-1697
Open

pcbeingused333 wants to merge 1 commit into
supabase:masterfrom
pcbeingused333:fix/saml-xs-duration-1697

Conversation

@pcbeingused333

Copy link
Copy Markdown

SAML metadata whose root element is EntitiesDescriptor failed to parse when cacheDuration used a valid XML Schema duration such as PT5H. The parser read that wrapper attribute as a Go integer duration, so adding the provider returned an internal error. Those non-integer cacheDuration attributes are now dropped from EntitiesDescriptor before parsing. A duration on the EntityDescriptor itself is left as it was.

The new test parses a federation document with cacheDuration="PT5H" and checks that the identity provider entity, its sign-on URL, and its own one-hour cache duration are returned.

Prepared with the help of an AI coding assistant.

Fixes #1697

Federation metadata wrapped in EntitiesDescriptor was rejected when
cacheDuration used a value such as PT5H. The parser treated that
attribute as a Go duration integer. Those wrapper attributes are now
removed before parsing, and the entity's own duration is left intact.

Fixes supabase#1697
@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 25, 2026 09:23

This branch has not been deployed

No deployments
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.

SAML Metadata parsing does not correctly parse valid duration values.

1 participant