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

feat: decoding of url-safe base64 encoding for oobnotes #4259

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

dpc
Copy link
Contributor

@dpc dpc commented Feb 7, 2024

To help the transition, we first implement decoding of url-safe base64 version (accepting both that and old version) and after a while we'll switch the encoding to url-safe one.

Re #4040

To help the transition, we first implement decoding of
url-safe base64 version (accepting both that and old version)
and after a while we'll switch the encoding to url-safe one.

Re fedimint#4040
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7245b06) 58.06% compared to head (fc0a7c6) 58.09%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4259      +/-   ##
==========================================
+ Coverage   58.06%   58.09%   +0.02%     
==========================================
  Files         197      197              
  Lines       43700    43702       +2     
==========================================
+ Hits        25376    25390      +14     
+ Misses      18324    18312      -12     

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

Copy link
Contributor

@elsirion elsirion left a comment

Choose a reason for hiding this comment

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

Great idea!

Comment on lines +241 to +245
let bytes = if let Ok(bytes) = BASE64_URL_SAFE.decode(s) {
bytes
} else {
base64::engine::general_purpose::STANDARD.decode(s)?
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Looked at the standard and there seems to be no case where there is a valid non-URL-safe base64 string that is also a valid url-safe base64 string encoding different data.

@elsirion
Copy link
Contributor

elsirion commented Feb 7, 2024

Let's backport so we can make the window between introducing decoding and switching encoding longer/allow earlier switching without breaking backwards compat guarantees.

@elsirion
Copy link
Contributor

elsirion commented Feb 7, 2024

I see you were already a step ahead 😆 #4260

@dpc dpc enabled auto-merge February 7, 2024 18:23
@dpc dpc added this pull request to the merge queue Feb 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 9, 2024
@dpc dpc added this pull request to the merge queue Feb 9, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 10, 2024
@dpc dpc added this pull request to the merge queue Feb 10, 2024
Merged via the queue into fedimint:master with commit 06dcc97 Feb 10, 2024
24 checks passed
@dpc dpc deleted the 24-02-06-oob-base64 branch February 10, 2024 06:20
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.

None yet

3 participants