-
Notifications
You must be signed in to change notification settings - Fork 1
feat(rust/rbac-registration): Introduce Cip0134UriSet type #119
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
Conversation
d1251df to
5d20379
Compare
a4366b2 to
6bb16b6
Compare
|
✅ Test Report | |
6bb16b6 to
f34c796
Compare
rust/rbac-registration/src/cardano/cip509/utils/cip134/uri_set.rs
Outdated
Show resolved
Hide resolved
| /// | ||
| /// This field isn't present in the encoded format and is populated by processing both | ||
| /// `x509_certs` and `c509_certs` fields. | ||
| pub certificate_uris: Cip0134UriSet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this certificate_uris is too specific for Cip509Metadata (specific to role 0)
Might be useful to add it in RegistrationChain.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm missing something, but certificates be present in the next registrations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIscussed: we decided to proceed with this approach for now because it isn't going to be merged directly to the main branch. But we will consider this again during the final review.
4c4d4e4 to
448899b
Compare
448899b to
8160fdf
Compare
bkioshn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM🥳
| // Handle the x509 chunks 10 11 12 | ||
| let x509_chunks = X509Chunks::decode(d, ctx)?; | ||
| cip509_metadatum.x509_chunks = x509_chunks; | ||
| // Technically it is possible to store multiple copies (or different instances) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for miscommunication, storing multiple violate the CDDL spec, so only 1 is allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you were clear, perhaps it is a misunderstanding from my side. What I wanted to say with this comment is that it is possible to produce metadata with multiple different types, but it indeed would violate the specification.
6ad8cdc
into
rbac-registration-improvements
* Introduce Cip0134UriSet type (#119) * Store x509 certificates (Cip509RbacMetadata::x509_certs) in the decoded format (#128) * Store and update certificate URIs in the registration chain (#130) * Check for presense of purpose and txn_inputs_hash fields * Use Blake2b256Hash type * Make Cip509 field private * Use problem report * More problem report usage in Cip509RbacMetadata * Cip0134Uri::try_from(&[u8]) * Move addresses extraction to a function * Move Cip0134Uri to the cardano-blockchain-types crate * role data as map * Role0 constant * Member functions * Cip509 constructors * Validation * Fix after merge * Validation tests * Registration chain * Fix clippy warnings and some tests * Test decremented_index * decode context * Role data conversion * Fix clippy lints * Update the validation tests * Update chunks decoding tests * Move payment history types * Move payment history to Cip509 * Add TODO comments * Use TxnWitness from cardano-blockchain-types * Clippy * Use (more) types from the 'cardano-blockchain-types' crate * Update the registration chain tests * Fix clippy (again) * Fix warnings in the tests * Use the 'cbork-utils' crate * Remove MultiEraBlock::new_block * Fix the 'decode_any' usage * Split certificates into multiple files * Fix some review comments * Remove duplicated hash helpers * Fix after merge * Update the payment key logic * Remove unused dependencies * More error handling * Improve role 0 signing key validation * Error handling * More error handling * Fix Clippy * Improve error handling once again * update decode_revocation_list * test(rust/rbac-registration): Fix test in CIP509 (#160) * test(rbac-registration): fix test and test data Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): name txn_index Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): add more test to registration chain Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> * Fix after merge * Add the 'assert_valid' function for the test data * test(rust/rbac-registration): RBAC None role0 key reference (#163) * test(rbac-registration): fix test and test data Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): name txn_index Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): add more test to registration chain Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway4 block Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> * Add/fix certificates/role checks * Check the encryption key for non-0 roles * Check for role 0 certificates for other roles * test(rust/rbac-registration): Fix test data + undefined bug (#168) * test(rbac-registration): fix test and test data Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): name txn_index Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): add more test to registration chain Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway4 block Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway4 block Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): consume undefined cbor Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): format Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> * Remove the 'raw_aux_module' because it was moved to cardano-blockchain-types * Use block.txn_metadata function * Remove removed params from the documentation * One more update for the role data validation * Remove unused dependency * Ensure that there is no encryption key for the role 0 * Use the encryption key value in the message * Use UuidV4 * Remove duplicated check * Revert UUID changes (temporary) * Update UUID names * Use revision for cbork-utils * Use revisions instead of paths for dependencies * test(rust/rbac-registration): Fix RBAC test data (#175) * test(rbac-registration): fix test and test data Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): name txn_index Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): add more test to registration chain Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway4 block Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway4 block Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): consume undefined cbor Signed-off-by: bkioshn <[email protected]> * fix(rbac-registration): format Signed-off-by: bkioshn <[email protected]> * test(rbac-registration): fix conway1 and 4 test data Signed-off-by: bkioshn <[email protected]> --------- Signed-off-by: bkioshn <[email protected]> * Use tag for dependencies * Update public key at 0 index error message --------- Signed-off-by: bkioshn <[email protected]> Co-authored-by: Steven Johnson <[email protected]> Co-authored-by: bkioshn <[email protected]>
Description
Cip0134UriSettype was added.Option<Vec<_>>fields of theCip509RbacMetadatastructure were changed toVec<_>.Related Issue(s)
Closes #104.
Description of Changes
I have renamed
Cip0134UriListtoCip0134UriSetbecause I don't think that "list" is a proper description for the current structure.This pull request should be merged into the
rbac-registration-improvementsbranch instead ofmain. The goal is to have separate smaller incremental changes that can be reviewed together in a separate pull request (fromrbac-registration-improvementstomain).Please confirm the following checks