Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Make the b64decode filter try multiple base64 encoding variants #2885

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

sandhose
Copy link
Member

This was sometimes a problem when decoding the subject given by Dex

Copy link

cloudflare-workers-and-pages bot commented Jun 28, 2024

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe6b3ff
Status: ✅  Deploy successful!
Preview URL: https://abeb80e9.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-flexible-base64-dec.matrix-authentication-service-docs.pages.dev

View logs

)
.with_source(e)
})?;
// We're not too concerned about the performance of this filter, so we'll just
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit lax TBH, I'm not sure about the intended usage but this is the kind of thing that makes you accidentally accept something you didn't mean to and then make it hard to break that later.

If we're really sure this is fine then fine, but otherwise I'd prefer to have different filters for the different variants

Copy link
Member Author

Choose a reason for hiding this comment

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

This can be used when transforming attributes from an upstream IDP. We use this for decoding the Dex subject in ESS, and as we're not documenting this, I think it'll be fine if we want to break it later

@sandhose sandhose merged commit 8e0bfa7 into main Jun 28, 2024
16 checks passed
@sandhose sandhose deleted the quenting/flexible-base64-decode branch July 29, 2024 12:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants