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

Define a set of default permission tokens #4206

Open
mversic opened this issue Jan 17, 2024 · 7 comments · May be fixed by #5075
Open

Define a set of default permission tokens #4206

mversic opened this issue Jan 17, 2024 · 7 comments · May be fixed by #5075
Assignees
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested

Comments

@mversic
Copy link
Contributor

mversic commented Jan 17, 2024

Let's see what should be the default set of permissions and what should their names be. Currently we have (as listed in smart_contract/executor/src/default/tokens.rs):

    CanUnregisterAnyPeer,

    CanUnregisterDomain,
    CanSetKeyValueInDomain,
    CanRemoveKeyValueInDomain,
    CanRegisterAccountInDomain,
    CanRegisterAssetDefinitionInDomain,

    CanUnregisterAccount,
    CanMintUserPublicKeys,
    CanBurnUserPublicKeys,
    CanMintUserSignatureCheckConditions,
    CanSetKeyValueInUserAccount,
    CanRemoveKeyValueInUserAccount,

    CanUnregisterAssetDefinition,
    CanSetKeyValueInAssetDefinition,
    CanRemoveKeyValueInAssetDefinition,

    CanRegisterAssetWithDefinition,
    CanUnregisterAssetWithDefinition,
    CanUnregisterUserAsset,
    CanBurnAssetWithDefinition,
    CanMintAssetWithDefinition,
    CanMintUserAsset,
    CanBurnUserAsset,
    CanTransferAssetWithDefinition,
    CanTransferUserAsset,
    CanSetKeyValueInUserAsset,
    CanRemoveKeyValueInUserAsset,

    CanGrantPermissionToCreateParameters,
    CanRevokePermissionToCreateParameters,
    CanCreateParameters,
    CanGrantPermissionToSetParameters,
    CanRevokePermissionToSetParameters,
    CanSetParameters,

    CanUnregisterAnyRole,

    CanExecuteUserTrigger,
    CanUnregisterUserTrigger,
    CanMintUserTrigger,
    CanBurnUserTrigger,

    CanUpgradeExecutor,

So let me start by asking about registering entities. Should the registration of the following entities be allowed by default for every account:

  1. Peer
  2. Domain
  3. Role
  4. Trigger
@mversic mversic added iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested labels Jan 17, 2024
@Stukalov-A-M Stukalov-A-M self-assigned this Jan 29, 2024
@Mingela
Copy link
Contributor

Mingela commented Jan 31, 2024

I'd rather support an idea of nothing is allowed unless a permission is issued including querying of an entity

@Stukalov-A-M
Copy link
Contributor

Stukalov-A-M commented Feb 1, 2024

Summary after the meeting:

  1. Agreed to keep the current tokens
  2. Agreed to keep root permissions for the domain to the domain owner
  3. @Stukalov-A-M should analyze current expressions and if some expression doesn't have a token, add it.

@Mingela
Copy link
Contributor

Mingela commented Feb 1, 2024

so by default any user can create any entities?

@Stukalov-A-M
Copy link
Contributor

Stukalov-A-M commented Feb 1, 2024

so by default any user can create any entities?

Well, yes and no. Any user can register only those entities, that are defined in RegisterBox. For now these are:

    /// Register [`Peer`].
    Peer(Register<Peer>),
    /// Register [`Domain`].
    Domain(Register<Domain>),
    /// Register [`Account`].
    Account(Register<Account>),
    /// Register [`AssetDefinition`].
    AssetDefinition(Register<AssetDefinition>),
    /// Register [`Asset`].
    Asset(Register<Asset>),
    /// Register [`Role`].
    Role(Register<Role>),
    /// Register [`Trigger`].
    Trigger(Register<Trigger<TriggeringFilterBox>>)

But, after creation, the user becomes an owner of the created entity and its descendants and has all permissions to manipulate them.

@mversic
Copy link
Contributor Author

mversic commented Feb 2, 2024

    /// Register [`Peer`].
    Peer(Register<Peer>),
    /// Register [`Domain`].
    Domain(Register<Domain>),
    /// Register [`Account`].
    Account(Register<Account>),
    /// Register [`AssetDefinition`].
    AssetDefinition(Register<AssetDefinition>),
    /// Register [`Asset`].
    Asset(Register<Asset>),
    /// Register [`Role`].
    Role(Register<Role>),
    /// Register [`Trigger`].
    Trigger(Register<Trigger<TriggeringFilterBox>>)

what I see for now:

  • we need both CanRegisterAnyPeer/CanUnregisterAnyPeer
    although, I don't think it makes sense to keep it split into 2 permissions. I would rather merge them into 1 permission. We could name it CanAlterNetwork or something like that
  • we should introduce CanRegisterAnyDomain

@Mingela
Copy link
Contributor

Mingela commented Feb 2, 2024

I don't think peer registration should be allowed, that seems a privileged action

@mversic
Copy link
Contributor Author

mversic commented Feb 2, 2024

I don't think peer registration should be allowed, that seems a privileged action

well yes. That's why need to introduce CanRegisterAnyPeer or CanAlterNetwork as I suggested

@mversic mversic assigned mversic and unassigned Stukalov-A-M Sep 13, 2024
@mversic mversic linked a pull request Sep 13, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST question Further information is requested
Projects
Status: High Priority
Development

Successfully merging a pull request may close this issue.

4 participants