Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jon-UID2-3680-test-coverage-v4-base64-tokens #62

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

jon8787
Copy link
Contributor

@jon8787 jon8787 commented Jul 26, 2024

No description provided.

var tokenAsBinary = UID2Base64UrlCoder.Decode(advertisingTokenBase64Url);
var advertisingTokenBase64 = Convert.ToBase64String(tokenAsBinary);
Assert.True(advertisingTokenBase64.Contains("="));
Assert.True(advertisingTokenBase64.Contains("/"));
Copy link
Contributor

Choose a reason for hiding this comment

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

there is a slim chance that there may not be / or + char? is it better to assert that advertisingTokenBase64Url must contain - and _ char first (if not, generate a new token value again) and then we are assured that we are testing the Bae64url->base64 conversion with these asserts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added some code to regenerate in a loop until it finds all these base64 chars. Tested a few times, but in practice I've never seen it generate a token that doesn't have all of these chars.

@jon8787 jon8787 merged commit e0b5899 into main Jul 29, 2024
3 checks passed
@jon8787 jon8787 deleted the jon-UID2-3680-test-coverage-v4-base64-tokens branch July 29, 2024 02:48
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