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

Radmap#3 #7

Merged
merged 38 commits into from
Sep 10, 2024
Merged

Radmap#3 #7

merged 38 commits into from
Sep 10, 2024

Conversation

tripledoublev
Copy link
Collaborator

@tripledoublev tripledoublev commented Jul 30, 2024

Refactoring:

  • Created common.rs
  • Moved constants to their own module.
  • Moved tests to lib.rs.

Implemented features:

  • Created CommonKeypair struct and DHTEntity trait in common.rs file.
  • Added create_repo and get_repo functions.

Enhancements:

  • Updated Group struct to include repos and implement the DHTEntity trait.
  • Updated Repo struct with necessary fields and implemented the DHTEntity trait.
  • Replaced CryptoKey with SharedSecret for encryption_key.
  • Ensured encryption_key uses random_shared_secret.

@tripledoublev tripledoublev self-assigned this Jul 30, 2024
src/backend.rs Outdated Show resolved Hide resolved
src/backend.rs Outdated Show resolved Hide resolved
src/backend.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

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

Looks great, good job! Just one thing for cleaning up the group struct a little

src/group.rs Outdated Show resolved Hide resolved
…nagement

- Removed redundant `record_key` and `id` fields, utilizing `group.id()` to reference DHT record keys directly.
- Simplified the process of storing keypairs and adding groups to the internal state by using `group.id()` for both.
- Adjusted group initialization to remove unnecessary secret key handling, relying on DHTRecordDescriptor for this data.
- Removed redundant `id`, `record_key`, and `secret_key` fields from the Group struct.
- Implemented `id()`, `owner_key()`, and `owner_secret()` getters to extract the necessary information directly from `dht_record`.
- Simplified the `get_secret_key()` method to use `owner_secret()` instead of storing a separate secret key.
- Streamlined the Group initialization process by removing unnecessary parameters related to key management.
…tor changes

- Refactored test cases to reference Group by `TypedKey` instead of `record_key` and removed unused variables.
- Replaced direct use of `group.get_id()` with `group.id()` getter.
- Updated `TypedKey::new` calls to include `CRYPTO_KIND_VLD0` for correct key initialization.
- Adjusted assertions to compare `group.id()` with retrieved keypair fields, ensuring proper key handling after refactor.
Copy link
Collaborator

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

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

Are the tests passing still?

src/backend.rs Show resolved Hide resolved
@tripledoublev
Copy link
Collaborator Author

Are the tests passing still?

Tests are passing

Copy link
Collaborator

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

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

Looks great! 🥳

@tripledoublev tripledoublev merged commit c3b0549 into OpenArchive:main Sep 10, 2024
2 checks passed
@tripledoublev tripledoublev deleted the radmap#3 branch September 10, 2024 19:39
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