github.com/cs3org/reva/v2@v2.27.7/pkg/storage/registry/spaces/Readme.md (about)

     1  # Spaces Registry
     2  
     3  The spaces registry recognizes individual spaces instead of storage providers.
     4  While it is configured with a list of storage providers, it will query them for all storage spaces and use the space ids to resolve id based lookups.
     5  Furthermore, path based lookups will take into account a path template to present a human readable file tree.
     6  
     7  ## Configuration
     8  
     9  The spaces registry takes two configuration options:
    10  
    11  1.  `home_template` is used to build a path for the users home. It uses a template that can access the current user in the context, e.g. `/users/{{.Id.OpaqueId}}`
    12  2.  `rules` is a map of path patterns to config rules
    13  
    14  ### Patterns
    15  
    16  A pattern can be a simple path like `/users` or a regex like `/users/[0-9]`. It can also contain a template `/users/{{.CurrentUser.Id.OpaqueId}}/Shares`.
    17  The pattern is used when matching the path for path based requests.
    18  
    19  ### Rules
    20  
    21  A rule has several properties:
    22  
    23  *   `address` The ip address of the CS3 storage provider
    24  *   `path_template` Will be renamed to space\_path or space\_mount\_point. If set this must be a valid go template.
    25  *   `allowed_user_agents` FIXME this seems to be used to route requests based on user agent
    26  
    27  It also carries filters that are sent with a ListStorageSpaces call to a storage provider
    28  
    29  *   `space_type` only list spaces of this type
    30  *   `space_owner_self` only list spaces where the user is owner (eg. for the users home)
    31  *   `space_id` only list a specific space
    32  
    33  ## How to deal with name collisions
    34  
    35  1.  The registry manages path segments that are aliases for storage space ids
    36  2.  every user can have their own paths (because every user can have multiple incoming project / share spaces with the same display name, eg two incoming shares for 'Documents' or two different Project spaces with the same Name. To distinguish spaces with the same display name in the webdav api they need to be assigned a unique path = space id alias)
    37  3.  aliases are uniqe per user
    38  4.  a space has three identifiers:
    39  
    40  *   a unique space id, used to allow clients to always distinguish spaces
    41  *   a display name, that is assigned by the owner or managers, eg. project names or 'Phils Home' for personal spaces. They are not unique
    42  *   an alias that is human readable and unique per user. It is used when listing paths on the CS3 global names as well as oc10 `/webdav` and `/dav/files/{username}` endpoints
    43  
    44  5.  on the ocis `/dav/spaces/{spaceid}/` endpoint the alias is actually not used because navigation happens by `{spaceid}`
    45  6.  Every user has their own list of path to spaceid mappings, like one config file per user.
    46  
    47  ## consequences for storage providers
    48  
    49  1.  when creating a spaces the storage provider does not know anything about aliases
    50  2.  when listing the root of a storage provider with a path based reference it will present a list of storageids, not aliases (that is what the registry is for)