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

Support for certificates with expiration date #219

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

poszu
Copy link
Collaborator

@poszu poszu commented Mar 25, 2024

Support for certificates with an optional expiration date. A certificate is a scale-encoded combination of the node's ID and (optional) expiration time. If the expiration time is None, the certificate does not expire.

The certifier will create expiring certificates if the expiration duration is set in the config.

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 94.89051% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 94.10%. Comparing base (69da0db) to head (9d9a2f2).

Files Patch % Lines
certifier/src/certifier.rs 94.69% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
+ Coverage   93.89%   94.10%   +0.20%     
==========================================
  Files          26       27       +1     
  Lines        3376     3496     +120     
==========================================
+ Hits         3170     3290     +120     
  Misses        206      206              

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

@poszu poszu requested a review from fasmat March 25, 2024 11:24
Copy link
Member

@fasmat fasmat left a comment

Choose a reason for hiding this comment

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

There is a linter warning in profiler/src/main.rs that maybe can be fixed in this PR as well?

Comment on lines +40 to 45
pub struct Certificate {
// ID of the node being certified
pub pub_key: Vec<u8>,
/// Unix timestamp
pub expiration: Option<Compact<u64>>,
}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a bit late, but we could have gone the route of using actual x509 certificates and then use client authentication (mTLS) against the certifier, would have probably been less implementation effort and made it easier to develop 3rd party tools or alternative implementations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could a x509 certificate be only valid for a single nodeID? A certificate should allow for only 1 poet registration per round.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, a certificate would be for a specific public key until a given expiration date. I don't think the effort to change it now is worth it though.

certifier/src/certifier.rs Show resolved Hide resolved
@poszu
Copy link
Collaborator Author

poszu commented Apr 12, 2024

There is a linter warning in profiler/src/main.rs that maybe can be fixed in this PR as well?

That's already fixed on the main branch :)

@poszu poszu enabled auto-merge April 18, 2024 08:52
@poszu poszu merged commit efb8fac into main Apr 18, 2024
20 checks passed
@poszu poszu deleted the certifier-support-expiration branch April 18, 2024 09: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