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

Implement labels #514

Merged
merged 5 commits into from
Aug 23, 2024
Merged

Implement labels #514

merged 5 commits into from
Aug 23, 2024

Conversation

str4d
Copy link
Owner

@str4d str4d commented Aug 10, 2024

Closes #403.

Copy link

codecov bot commented Aug 10, 2024

Codecov Report

Attention: Patch coverage is 29.53020% with 105 lines in your changes missing coverage. Please review.

Project coverage is 50.71%. Comparing base (d2c2e89) to head (3c9483f).
Report is 6 commits behind head on main.

Files Patch % Lines
age-plugin/src/recipient.rs 0.00% 43 Missing ⚠️
age/src/error.rs 0.00% 25 Missing ⚠️
age/src/plugin.rs 0.00% 24 Missing ⚠️
age-core/src/plugin.rs 46.66% 8 Missing ⚠️
age-plugin/src/identity.rs 0.00% 2 Missing ⚠️
age/src/protocol.rs 83.33% 2 Missing ⚠️
age-core/src/format.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
- Coverage   51.31%   50.71%   -0.61%     
==========================================
  Files          42       42              
  Lines        3946     4058     +112     
==========================================
+ Hits         2025     2058      +33     
- Misses       1921     2000      +79     

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

@str4d str4d force-pushed the 403-labels branch 2 times, most recently from befd8b3 to f130a4f Compare August 11, 2024 23:25
@str4d str4d marked this pull request as ready for review August 12, 2024 04:43
age-plugin/src/recipient.rs Show resolved Hide resolved
}
}
(Ok(false), false) => Err(vec![Error::Internal {
message: "Plugin requires labels but client does not support them".into(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this is an interesting decision, should a postquantum plugin refuse to work with older versions of age(1)?

Copy link
Owner Author

Choose a reason for hiding this comment

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

That was my interpretation, given this language in C2SP/C2SP#37:

  • Clients MUST check that all recipient stanzas wrapping a given file key have the exact same label set. Clients MUST NOT permit partial overlapping sets.
  • If the plugin does not respond with a labels command in phase 2, clients MUST treat the plugin's recipient stanzas has having an empty label set.

That means if the client does not advertise support for the labels extension, the plugin knows that if it proceeds apace, it will be forced to use the empty label set, which would be in violation of its desired non-empty label set. Maybe some plugins would accept that kind of fallback? But because plugins only see their relevant recipients, they cannot know what other recipients they will be combined with (the precise reason we designed the labels extension).

If we think this should be a per-plugin decision, I could add an associated constant to the trait (or alter the new labels method to return a boolean) that forces the plugin to declare whether it would allow its labels to be ignored by older clients. But that feels a bit weird.

@str4d
Copy link
Owner Author

str4d commented Aug 23, 2024

I want to add plugins to the interoperability testing in order to test these changes between age and rage, but as that will likely require some trial-and-error, I'm going to do so in a separate PR.

@str4d str4d merged commit 0cf17d9 into main Aug 23, 2024
35 of 37 checks passed
@str4d str4d deleted the 403-labels branch August 23, 2024 12:06
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.

Implement labels
2 participants