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

[cli] Validate alias #15307

Merged
merged 4 commits into from
Dec 12, 2023
Merged

Conversation

stefan-mysten
Copy link
Contributor

Description

Introduce a validation step when creating or updating an alias. The alias must start with a letter and can contain only letters, digits, hyphens (-), or underscores (_).

Test Plan

Updated existing tests.


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Added a validation step when creating or updating an alias of an address in the Sui CLI. The alias must start with a letter and can contain only letters, digits, hyphens (-), or underscores (_).

@stefan-mysten stefan-mysten requested review from amnn and removed request for patrickkuo and joyqvq December 11, 2023 23:14
Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 11:27pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 11, 2023 11:27pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2023 11:27pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2023 11:27pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2023 11:27pm

Copy link

vercel bot commented Dec 11, 2023

@stefan-mysten is attempting to deploy a commit to the Sui Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@@ -82,18 +82,7 @@ pub trait AccountKeystore: Send + Sync {
bail!("The provided alias {old_alias} does not exist");
}
let new_alias_name = match new_alias {
Some(x) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This whole logic is moved into its own function below.

Copy link
Contributor

@rvantonder rvantonder left a comment

Choose a reason for hiding this comment

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

LGTM!

@stefan-mysten stefan-mysten merged commit e4505fb into MystenLabs:main Dec 12, 2023
38 of 39 checks passed
@stefan-mysten stefan-mysten deleted the cli_alias_check_regex branch December 12, 2023 17:19
gdanezis pushed a commit that referenced this pull request Dec 15, 2023
## Description 

Introduce a validation step when creating or updating an alias. The
alias must start with a letter and can contain only letters, digits,
hyphens (-), or underscores (_).

## Test Plan 

Updated existing tests.

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
Added a validation step for alias naming when creating or updating the alias of an address
in the Sui CLI. The alias must start with a letter and can contain only
letters, digits, hyphens (-), or underscores (_).
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