Skip to content

Conversation

@stanislav-tkach
Copy link
Member

@stanislav-tkach stanislav-tkach commented Dec 20, 2024

Description

  • The Cip0134UriSet type was added.
  • Option<Vec<_>> fields of the Cip509RbacMetadata structure were changed to Vec<_>.
  • Error handling becomes stricter.

Related Issue(s)

Closes #104.

Description of Changes

I have renamed Cip0134UriList to Cip0134UriSet because I don't think that "list" is a proper description for the current structure.

This pull request should be merged into the rbac-registration-improvements branch instead of main. The goal is to have separate smaller incremental changes that can be reviewed together in a separate pull request (from rbac-registration-improvements to main).

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

@stanislav-tkach stanislav-tkach added the do not merge yet PR is not ready to be merged yet label Dec 20, 2024
@stanislav-tkach stanislav-tkach self-assigned this Dec 20, 2024
@stanislav-tkach stanislav-tkach changed the title feat(rust/rbac-registration): Introduce Cip0134UriSet type feat(rust/rbac-registration): Introduce Cip0134UriSet type Dec 20, 2024
@stanislav-tkach stanislav-tkach force-pushed the cip0134set branch 2 times, most recently from d1251df to 5d20379 Compare December 25, 2024 14:51
@stanislav-tkach stanislav-tkach force-pushed the cip0134set branch 3 times, most recently from a4366b2 to 6bb16b6 Compare December 25, 2024 17:11
@stanislav-tkach stanislav-tkach marked this pull request as ready for review December 25, 2024 17:12
@stanislav-tkach stanislav-tkach added review me PR is ready for review and removed do not merge yet PR is not ready to be merged yet labels Dec 25, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 25, 2024

Test Report | ${\color{lightgreen}Pass: 230/230}$ | ${\color{red}Fail: 0/230}$ |

///
/// 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,
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Member Author

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.

@stanislav-tkach stanislav-tkach force-pushed the cip0134set branch 3 times, most recently from 4c4d4e4 to 448899b Compare December 28, 2024 14:04
Copy link
Contributor

@bkioshn bkioshn left a 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
Copy link
Contributor

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

Copy link
Member Author

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.

@stanislav-tkach stanislav-tkach merged commit 6ad8cdc into rbac-registration-improvements Dec 30, 2024
21 of 24 checks passed
@stanislav-tkach stanislav-tkach deleted the cip0134set branch December 30, 2024 11:17
stanislav-tkach added a commit that referenced this pull request Jan 24, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review me PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants