Skip to content

feat: validating user id from orchestrator#1769

Open
tfheud wants to merge 1 commit intonexus-xyz:mainfrom
tfheud:0.0.1
Open

feat: validating user id from orchestrator#1769
tfheud wants to merge 1 commit intonexus-xyz:mainfrom
tfheud:0.0.1

Conversation

@tfheud
Copy link

@tfheud tfheud commented Jul 24, 2025

What has been changed in this block:

User ID validation:
A check has been added to ensure that user_id is not empty and is a valid UUID using uuid::Uuid::parse_str. If the uuid crate is already imported, this does not require any additional dependencies.
If you don't want to use uuid, you can remove the check uuid::Uuid::parse_str(&user_id).is_err() and leave only !user_id.is_empty(), but this is less strict.

Converting wallet_address to lowercase:
wallet_address.to_lowercase() has been added for consistency, as the address is compared in lowercase in other parts of the function.

Existing configuration check:
If the configuration file exists, the code checks that user_id and wallet_address match the values from the orchestrator to prevent overwriting mismatched data.

@collinjackson collinjackson changed the title 0.0.1 feat: validating user id from orchestrator Jul 24, 2025
.save(config_path)
.map_err(|e| handle_cmd_error!(e, "Failed to save config."))?;

if !user_id.is_empty() && uuid::Uuid::parse_str(&user_id).is_err() {
Copy link
Collaborator

@collinjackson collinjackson Sep 5, 2025

Choose a reason for hiding this comment

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

If this is intended to be a nested if statement, it should be indented. I'm not sure this is important to explicitly check though as orchestrator should always return valid user ids

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