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

eacl: Improvements and test coverage #605

Merged
merged 22 commits into from
Aug 9, 2024
Merged

eacl: Improvements and test coverage #605

merged 22 commits into from
Aug 9, 2024

Commits on Aug 9, 2024

  1. eacl: Rename *Unknown enum constants to *Unspecified ones

    To get closer to the protocol. `Unknown` constants are deprecated.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    97ef222 View commit details
    Browse the repository at this point in the history
  2. eacl: Improve docs of enum types

    Also drop mention of to-be-deprecated elements.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    3d98dce View commit details
    Browse the repository at this point in the history
  3. eacl: Rework consistent string mapping of enumerations

    Enum types provide `EncodeToString`/`DecodeString` interface
    representing stable stringers. Since the string representation is not
    declared by the NeoFS protocol, applications are allowed to use this
    functionality only for internal conversions (e.g. parsing command line
    input). In addition, enumeration types are simple integers. Thus,
    implementing this functionality as type methods is quite redundant. At
    the same time, exporting consistent in-box mapping can simplify
    development of some apps.
    
    `XToString` / `XFromString` function are provided now. Being global
    functions they emphasize that if the app is satisfied with the lib
    strings - it can take and use them, otherwise reimplement them by
    analogy. Methods are deprecated for the sake of new functions.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    2 Configuration menu
    Copy the full SHA
    61ccde9 View commit details
    Browse the repository at this point in the history
  4. eacl: Do not lose enum value during conversion

    Continues 71381ff.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    e77ae4b View commit details
    Browse the repository at this point in the history
  5. eacl: Deprecate EqualTables function

    The function is unused. For example, `waiter.ContainerSetEACLWaiter`
    compares binary representations which is correct. Overall, NeoFS
    protocol does not declare comparison operation b/w two eACLs. In
    particular, the eACL does not change when targets are shuffled. Thus, to
    avoid introducing a synthetic property, the func will be removed soon.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    cff0c92 View commit details
    Browse the repository at this point in the history
  6. eacl: Deprecate protocol conversion for all types except Table

    All other types are components and are not transported autonomously
    outside the eACL. Thus, for the sake of minimal support, these functions
    will be removed soon.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    b82aa5a View commit details
    Browse the repository at this point in the history
  7. eacl: Provide Filter type constructors

    Refs #483.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    34d6c32 View commit details
    Browse the repository at this point in the history
  8. eacl: Improve docs of Filter typedef and methods

    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    dd0d3dc View commit details
    Browse the repository at this point in the history
  9. eacl: Declare object filter constants without package import

    This allows to be less tied to packages that are about to be abolished.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    07263ab View commit details
    Browse the repository at this point in the history
  10. eacl: Provide Target type constructors

    This also emphasizes that role and public keys are mutually exclusive.
    Additional helpers for ECDSA encoding are provided too.
    
    Refs #483.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    ae556cd View commit details
    Browse the repository at this point in the history
  11. eacl: Improve Target typedef docs

    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    f47b7fe View commit details
    Browse the repository at this point in the history
  12. eacl: Provide setter for Record filters

    And improve docs a bit.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    8316731 View commit details
    Browse the repository at this point in the history
  13. eacl: Provide Record type constructor

    Additionally, provide helpers for object filtering: with them, creating
    a rule will be more efficient in terms of reallocations. Due to this,
    all `Add*Filter*` methods are marked deprecated.
    
    Refs #483.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    758b5dd View commit details
    Browse the repository at this point in the history
  14. eacl: Improve docs of Record typedef and methods

    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    b18b7f6 View commit details
    Browse the repository at this point in the history
  15. eacl: Provide setter of Table records

    `AddRecord` was inefficient in terms of allocations, so it is deprecated
    now.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    104b479 View commit details
    Browse the repository at this point in the history
  16. eacl: Provide Table type constructors

    Refs #483.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    815b7d4 View commit details
    Browse the repository at this point in the history
  17. eacl/test: Add more randomizers and randomness to existing ones

    Also test the functions.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    e490cd9 View commit details
    Browse the repository at this point in the history
  18. eacl: Split unit tests for exported and unexported functionality

    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    6a2d9ea View commit details
    Browse the repository at this point in the history
  19. eacl: Do not declare stateless methods on a pointer receiver

    This allows to use instance by value as interface implementation.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    8e8ebc7 View commit details
    Browse the repository at this point in the history
  20. eacl: Provide setter of raw binary-encoded subjects

    For symmetry with `RawSubjects` and testing.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    3e90f1e View commit details
    Browse the repository at this point in the history
  21. eacl: Improve testing and increase coverage

    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    06cf060 View commit details
    Browse the repository at this point in the history
  22. eacl: Skip currently failing unit tests

    Caused by #606 which should make them PASS.
    
    Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
    cthulhu-rider committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    402b83c View commit details
    Browse the repository at this point in the history