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

There're no well-known attributes #172

Closed
im-kulikov opened this issue Oct 19, 2020 · 10 comments · Fixed by nspcc-dev/neofs-api#77 or #181
Closed

There're no well-known attributes #172

im-kulikov opened this issue Oct 19, 2020 · 10 comments · Fixed by nspcc-dev/neofs-api#77 or #181
Labels
discussion Open discussion of some problem enhancement Improving existing functionality

Comments

@im-kulikov
Copy link
Contributor

Object and Container contains user-specific attributes ([]*Attribute is KeyValue) but there're no well-known attributes.

For example:

  • CreatedAt - human-readable creation date/time (out of the box)
  • Name - human-readable object/container name

@realloc, @alexvanin what are you think about adding constants for these attributes and the possibility to set them out of the box?

@im-kulikov im-kulikov added the enhancement Improving existing functionality label Oct 19, 2020
@realloc
Copy link

realloc commented Oct 19, 2020

Let's add Name attribute to the well-known list in -api and -spec repos and then we can reflect that in api-go.

The CreatedAt attribute may be tricky. if it has Epoch, then IR can't set it because the whole structure is formed by owner and should not be changed. Owner can't predict for sure the Epoch of container being added into Container smart contract storage. We could get that information indirectly from the height of the block having container creation TX, but I'm not sure where to put it. Maybe in response meta headers, but that's strange.

If CreatedAt will have the unverified user defined date-time in some common format, then It's ok, but we need to name it somehow differently.

@im-kulikov im-kulikov pinned this issue Oct 19, 2020
@im-kulikov
Copy link
Contributor Author

im-kulikov commented Oct 19, 2020

In the closest future, I would like to see (SDK):

  • Object.GetName() string
  • Object.GetCreatedAt() time.Time
  • Container.GetName() string
  • Container.GetCreatedAt() time.Time

For example:
(Object/Container) -> Attributes -> Constant -> Result


PS: Using Epochs / BlockDate / TxDate seems like a bad idea for me

@alexvanin
Copy link
Contributor

Don't mind to have those attributes. There is a good point that CreatedAt should be renamed to emphasize that this is unverified value. Maybe something like LocallyCreatedAt? Or LocalCreationTime.

@im-kulikov
Copy link
Contributor Author

... CreatedAt should be renamed ... LocallyCreatedAt? Or LocalCreationTime

Naming is not as critical to me as the fact of having

@realloc
Copy link

realloc commented Oct 21, 2020

Need to make sure neofs-api-go follows changes from nspcc-dev/neofs-api#77.

@im-kulikov im-kulikov reopened this Oct 22, 2020
@im-kulikov
Copy link
Contributor Author

Object:

  • Filename
  • Timestamp

Container:

  • Name
  • Timestamp

@realloc
Copy link

realloc commented Oct 22, 2020

Object:

  • Filename
  • Timestamp
  • Name

What did you mean?

@im-kulikov
Copy link
Contributor Author

im-kulikov commented Oct 22, 2020

Object:

  • Filename
  • Timestamp
  • Name

What did you mean?

For object we have two useful well-known attributes : filename and timestamp

This is notice for @alexvanin to add these attributes into sdk

Name isn’t useful attribute for object, that’s why I don’t add it into notice

For the container, we have next useful attributes: name and timestamp

cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
@realloc
Copy link

realloc commented Oct 22, 2020

Name isn’t useful attribute for object, that’s why I don’t add it into notice

Actually it's useful and has the same semantics and meaning as Name for Container. Filename should be used in cases like mirroring X-Filename http header to an object.

@im-kulikov
Copy link
Contributor Author

im-kulikov commented Oct 22, 2020

Name isn’t useful attribute for object, that’s why I don’t add it into notice

Actually it's useful and has the same semantics and meaning as Name for Container. Filename should be used in cases like mirroring X-Filename http header to an object.

not quite.. for example, I can't find any useful usages for it in any of our services.

Filename, should be set by service and then, can be used to display for users, same as Timestamp

In this case, I don't see any useful usages for Name. As @alexvanin explained, this attribute can be used as human-readable replacement of the sha-hash.

And it can't be used the same way as Name for the container.

cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-api-go that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit that referenced this issue Oct 22, 2020
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Open discussion of some problem enhancement Improving existing functionality
Projects
None yet
3 participants