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

feat(core): identity aliases #1094

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Conversation

petarjuki7
Copy link
Member

Introduce aliases for user identities and context id's

Test plan

TBD

Documentation update

Will need docs and e2e test updates.

crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/alias.rs Outdated Show resolved Hide resolved
crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/component.rs Outdated Show resolved Hide resolved
crates/store/src/types/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/component.rs Outdated Show resolved Hide resolved
crates/store/src/key/component.rs Outdated Show resolved Hide resolved
crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/primitives/src/alias.rs Outdated Show resolved Hide resolved
crates/store/src/key/alias.rs Show resolved Hide resolved
Comment on lines 55 to 56
.ok_or(InvalidAlias(
"alias exceeds maximum length of 50 characters",
Copy link
Member

Choose a reason for hiding this comment

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

why not make this into an enum variant?


#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
pub struct IdentityAlias(Key<(Kind, Scope, Alias)>);
Copy link
Member

Choose a reason for hiding this comment

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

this shouldn't be named IdentityAlias since it may represent context, identity or application

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 agree, my logic was "Identity" in the sense it could be context identity, application identity, identity...
Do you have any suggestions?
HashAlias? NameAlias?

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub struct IdentityAlias(Key<(Kind, Scope, Alias)>);
pub struct Alias(Key<(Kind, Scope, Name)>);

crates/store/src/key/alias.rs Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Feb 7, 2025

E2E tests report

Scenario: kv-store

Protocol/Step 0. app install (AllMembers) 1. ctx create 2. call (set, Inviter) 3. call (get, Inviter) 4. ctx invite-join 5. call (get, AllMembers)
near
icp

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.

3 participants