facebook / akd

An implementation of an auditable key directory
Apache License 2.0
243 stars 36 forks source link

Adding error checks for NodeLabel::try_from() and get_bit_at() error returns #407

Closed kevinlewi closed 1 year ago

kevinlewi commented 1 year ago

Note that we could add an extra error check for NodeLabel::try_from() to ensure that labels do not have any bits set after label_len. However, the empty_label() label is an example of a valid label which sets bits after label_len, and so it would violate that assumption.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 91.89% and no project coverage change.

Comparison is base (be1055e) 87.73% compared to head (8cf6957) 87.74%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #407 +/- ## ======================================= Coverage 87.73% 87.74% ======================================= Files 39 39 Lines 8771 8851 +80 ======================================= + Hits 7695 7766 +71 - Misses 1076 1085 +9 ``` | [Files Changed](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook) | Coverage Δ | | |---|---|---| | [akd/src/directory.rs](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook#diff-YWtkL3NyYy9kaXJlY3RvcnkucnM=) | `83.28% <ø> (ø)` | | | [akd\_core/src/types/node\_label/mod.rs](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook#diff-YWtkX2NvcmUvc3JjL3R5cGVzL25vZGVfbGFiZWwvbW9kLnJz) | `88.70% <72.41%> (-5.69%)` | :arrow_down: | | [akd\_core/src/types/node\_label/tests.rs](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook#diff-YWtkX2NvcmUvc3JjL3R5cGVzL25vZGVfbGFiZWwvdGVzdHMucnM=) | `92.54% <96.55%> (+0.34%)` | :arrow_up: | | [akd\_core/src/proto/mod.rs](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook#diff-YWtkX2NvcmUvc3JjL3Byb3RvL21vZC5ycw==) | `87.94% <100.00%> (+0.75%)` | :arrow_up: | | [akd\_core/src/proto/tests.rs](https://app.codecov.io/gh/facebook/akd/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook#diff-YWtkX2NvcmUvc3JjL3Byb3RvL3Rlc3RzLnJz) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/facebook/akd/pull/407/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facebook)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.