Skip to content

[FEAT] - improvement in the object-storage acl set option #42

@ximenesyuri

Description

@ximenesyuri

Is your feature request related to a problem? Please describe.
Following the same philosophy described in #41, when one executes a command mgc <context> <entity> <action> one expects to execute the given <action> for the corresponding <entities> in that <context>.

The <entity> kinds could be fully independent or they could be related through some relation. Suppose I have kinds entity_A and entity_B, and a relation R:entity_A->entity_B between them. In this case, while executing some <action> one has to explicitly states if it is compatible with the existing relation R, meaning that the existence of R is enough to conclude that, if mgc entity_A <action>, then mgc entity_B <action>.

Suppose now that R:entity_A->entity_B is a relation between two kinds and that the <action> acts only over entity_B. Via pullback one can define the same action over entity_A and, in that case, the <action> is naturally compatible with the relation R.

In the <context> of object-storage, the entities appear into two kinds: buckets and objects. Furthermore, there is a natural relation between R:objects->buckets them: objects belongs to buckets. So, for any given <action> in the context of object-storage, one has to ask if it is compatible with the belongs to relation.

The fact is that the action acl set is defined only for the entity buckets. So, unless explicit mention on the opposite, it pass to be defined in objects in a way that is compatible with the belongs to relation.

The conclusion is the following:

  • if the semantic system underlying the context object-storage was coherent, then while executing mgc object-storage acl set --public-read/--private --dst bucket one should expect to change the access control not only for the bucket, but also for any object belonging to it.

It seems that this is not the case:

  1. the command mgc object-storage buckets acl set --public-read/--private --dst bucket does not modify the state of the objects in the bucket, but only of the bucket.

In the current version 0.30.0 of mgc, if one wants to change the access control of an object one needs to execute mgc object-storage buckets acl set --public-read/--private --dst bucket/path/to/object. However:

  1. while this command corresponds to an <action> over the instance of an object, it is defined for the kind buckets`, which produces the same type of contradiction described in [FEAT] - improvement in the object-storage public-url option #41.

Describe the solution you'd like
To improve the points exposed above, I could suggest two approaches:

  1. to follow the typical construction of a semantic system by assuming that the command mgc object-storage acl set --public-read/--private --dst bucket is be able to modify the state not only of the bucket, but also of its objects.
  2. to maintain the atypical construction of the semantic system (meaning that mgc object-storage acl set --public-read/--private --dst bucket will still affect only the bucket) and, instead of creating the action act set over objects by pullbacks, define it explicitly (meaning that one should now pass to have the option mgc object-storage objects acl set --public-read/--private --dst bucket/path/to/object). In that case, the help message for the command mgc object-storage buckets acl set should mention that the action affects only the bucket, indicating to the user how to execute the corresponding action for the entity objects, if needed.

In my opinion, due its flexibility, the second option is the best solution.

OBS. As an additional improvement I could suggest to add the flag --recursive/-R to the option mgc object-storage buckets acl set. With that flag, the action would pass to all objects (i.e, the action in objects would be that obtained by pullback).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions