Skip to content

Commit

Permalink
simplify further
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Jun 11, 2021
1 parent afee2ef commit 5133cda
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 80 deletions.
8 changes: 4 additions & 4 deletions cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ message OpenInAppRequest {
// the storage provider to read and write.
// Service implementors MUST make sure that the access token only grants
// access to the requested resource.
// Service implementors should use a Reference with a root_id and an empty path to grant access, as
// root_ids MUST NOT change when a resource is renamed.
// Service implementors should use a ResourceId rather than a filepath to grant access, as
// ResourceIds MUST NOT change when a resource is renamed.
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 4;
Expand Down Expand Up @@ -134,8 +134,8 @@ message OpenFileInAppProviderRequest {
// the storage provider to read and write.
// Service implementors MUST make sure that the access token only grants
// access to the requested resource.
// Service implementors should use a Reference with a root_id and an empty path to grant access, as
// root_ids MUST NOT change when a resource is renamed.
// Service implementors should use a ResourceId rather than a filepath to grant access, as
// ResourceIds MUST NOT change when a resource is renamed.
// The access token MUST be short-lived.
// TODO(labkode): investigate token derivation techniques.
string access_token = 4;
Expand Down
2 changes: 1 addition & 1 deletion cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ service GatewayAPI {
// MUST return CODE_NOT_FOUND if the reference does not exist.
rpc Delete(cs3.storage.provider.v1beta1.DeleteRequest) returns (cs3.storage.provider.v1beta1.DeleteResponse);
// Returns the path reference for
// the provided resource reference.
// the provided resource id reference.
// MUST return CODE_NOT_FOUND if the reference does not exist
rpc GetPath(cs3.storage.provider.v1beta1.GetPathRequest) returns (cs3.storage.provider.v1beta1.GetPathResponse);
// Returns the quota available under the provided
Expand Down
4 changes: 2 additions & 2 deletions cs3/sharing/collaboration/v1beta1/collaboration_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ message ListSharesRequest {
enum Type {
TYPE_INVALID = 0;
TYPE_NO = 1;
TYPE_REFERENCE = 2;
TYPE_RESOURCE_ID = 2;
TYPE_OWNER = 3;
TYPE_CREATOR = 4;
}
// REQUIRED.
Type type = 2;
oneof term {
storage.provider.v1beta1.Reference ref = 3;
storage.provider.v1beta1.ResourceId resource_id = 3;
cs3.identity.user.v1beta1.UserId owner = 4;
cs3.identity.user.v1beta1.UserId creator = 5;
}
Expand Down
9 changes: 4 additions & 5 deletions cs3/sharing/collaboration/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import "cs3/types/v1beta1/types.proto";

// Shares are relationships between a resource owner
// (usually the authenticated user) who grants permissions to a recipient (grantee)
// on a specified resource (reference). UserShares represents both user and groups.
// on a specified resource (resource_id). UserShares represents both user and groups.
message Share {
// REQUIRED.
// Opaque unique identifier of the share.
ShareId id = 1;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 2;
// Unique identifier of the shared resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
// Permissions for the grantee to use
// the resource.
Expand Down Expand Up @@ -122,8 +122,7 @@ message ShareKey {
// REQUIRED.
cs3.identity.user.v1beta1.UserId owner = 2;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 3;
storage.provider.v1beta1.ResourceId resource_id = 3;
// REQUIRED.
storage.provider.v1beta1.Grantee grantee = 4;
}
Expand Down
5 changes: 2 additions & 3 deletions cs3/sharing/link/v1beta1/link_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,13 @@ message ListPublicSharesRequest {
// REQUIRED.
enum Type {
TYPE_INVALID = 0;
TYPE_REFERENCE = 1;
TYPE_RESOURCE_ID = 1;
TYPE_OWNER = 2;
TYPE_CREATOR = 3;
}
Type type = 2;
oneof term {
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 3;
storage.provider.v1beta1.ResourceId resource_id = 3;
cs3.identity.user.v1beta1.UserId owner = 4;
cs3.identity.user.v1beta1.UserId creator = 5;
}
Expand Down
6 changes: 3 additions & 3 deletions cs3/sharing/link/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import "cs3/types/v1beta1/types.proto";

// Public share are relationships between a resource owner
// (usually the authenticated user) who grants permissions to a recipient (grantee)
// on a specified resource (reference). UserShares represents both user and groups.
// on a specified resource (resource_id). UserShares represents both user and groups.
// TODO(labkode): do we need to have resource_type stored on the share?
// This is not needed if when getting the shares a stat operation is launched against the
// the storage provider.
Expand All @@ -61,8 +61,8 @@ message PublicShare {
// to the public share.
string token = 2;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 3;
// Unique identifier of the shared resource.
storage.provider.v1beta1.ResourceId resource_id = 3;
// REQUIRED.
// Permissions for the grantee to use
// the resource.
Expand Down
9 changes: 4 additions & 5 deletions cs3/sharing/ocm/v1beta1/ocm_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ message CreateOCMShareRequest {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 2;
// The unique identifier for the shared storage resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
// The share grant for the share.
ShareGrant grant = 3;
Expand Down Expand Up @@ -151,7 +151,7 @@ message ListOCMSharesRequest {
enum Type {
TYPE_INVALID = 0;
TYPE_NO = 1;
TYPE_REFERENCE = 2;
TYPE_RESOURCE_ID = 2;
TYPE_OWNER = 3;
TYPE_CREATOR = 4;
TYPE_OWNER_PROVIDER = 5;
Expand All @@ -160,8 +160,7 @@ message ListOCMSharesRequest {
// REQUIRED.
Type type = 2;
oneof term {
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 3;
storage.provider.v1beta1.ResourceId resource_id = 3;
cs3.identity.user.v1beta1.UserId owner = 4;
cs3.identity.user.v1beta1.UserId creator = 5;
}
Expand Down
9 changes: 4 additions & 5 deletions cs3/sharing/ocm/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import "cs3/types/v1beta1/types.proto";

// Shares are relationships between a resource owner
// (usually the authenticated user) who grants permissions to a recipient (grantee)
// on a specified resource (reference). UserShares represents both user and groups.
// on a specified resource (resource_id). UserShares represents both user and groups.
message Share {
// REQUIRED.
// Opaque unique identifier of the share.
ShareId id = 1;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 2;
// Unique identifier of the shared resource.
storage.provider.v1beta1.ResourceId resource_id = 2;
// REQUIRED.
// Name of the shared resource.
string name = 3;
Expand Down Expand Up @@ -134,8 +134,7 @@ message ShareKey {
// REQUIRED.
cs3.identity.user.v1beta1.UserId owner = 2;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
storage.provider.v1beta1.Reference ref = 3;
storage.provider.v1beta1.ResourceId resource_id = 3;
// REQUIRED.
storage.provider.v1beta1.Grantee grantee = 4;
}
Expand Down
11 changes: 6 additions & 5 deletions cs3/storage/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ service ProviderAPI {
// MUST return CODE_NOT_FOUND if the reference does not exist.
rpc Delete(DeleteRequest) returns (DeleteResponse);
// Returns the path reference for
// the provided resource reference.
// the provided resource id reference.
// MUST return CODE_NOT_FOUND if the reference does not exist
rpc GetPath(GetPathRequest) returns (GetPathResponse);
// Returns the quota available under the provided
Expand Down Expand Up @@ -169,8 +169,9 @@ message GetHomeResponse {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The reference to the home in a storage provider.
Reference ref = 3;
// The path to the home in a storage provider.
// For example /eos/user/h/hugo in the storage provider with root path /eos/user/.
string path = 3;
}

message AddGrantRequest {
Expand Down Expand Up @@ -235,8 +236,8 @@ message GetPathRequest {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// Unique identifier of the shared resource (path must be empty).
Reference ref = 2;
// The resource id of the resource.
ResourceId resource_id = 2;
}

message GetPathResponse {
Expand Down
39 changes: 26 additions & 13 deletions cs3/storage/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message ResourceInfo {
ResourceType type = 2;
// REQUIRED.
// Opaque unique identifier of the resource.
Reference id = 3;
ResourceId id = 3;
// REQUIRED.
// The data checksum for the file resource.
// For all other resources, the checksum is unset.
Expand All @@ -64,7 +64,9 @@ message ResourceInfo {
// For reference types this is NOT the mtime of the target.
cs3.types.v1beta1.Timestamp mtime = 7;
// REQUIRED.
// The path for the resource, relative to the reference used to make the request.
// The path for the resource:
// MUST start with `/` when the reference had no resource_id, indicating an absolute path.
// MUST start with `.` when the reference had a resource_id, indicating a relative path.
string path = 8;
// REQUIRED.
// The set of permissions for the resource effective for the authenticated user.
Expand Down Expand Up @@ -195,17 +197,28 @@ message ResourceChecksumPriority {
// In a URL the different components can be represented in a string using the following layout:
// <storage_id>!<node_id>:<path>
message Reference {
// OPTIONAL
ResourceId resource_id = 1;
// OPTIONAL.
// The logical id of a storage. Used by the storage registry to determine the responsible storage provider.
// When starting with `/` represents an absolute path. In this case the resource_id MUST be empty.
// When starting with `.` represents a path relative to the resource_id. The resource_id MUST be given.
// When path is empty the resource_id must be set. Used to look up the path for a resource_id.
string path = 2;
}

// A resource id uniquely identifies a
// resource in the storage provider namespace.
// A ResourceId MUST be unique in the storage provider.
message ResourceId {
// REQUIRED.
// The logical id of a storage. Used by the storage
// registry to determine the responsible storage provider.
string storage_id = 1;
// OPTIONAL.
// The logical node id used by a storage provider to uniquely identify a resource in a storage.
string node_id = 2;
// OPTIONAL.
// When starting with `/` the reference represents an absolute path. In this case the storage_id and the node_id must be empty.
// When not starting with `/` represents a path relative to the node_id.
// When node_id is empty the path is considered relative to the root of the storage.
string path = 3;
// REQUIRED.
// The internal id used by service implementor to
// uniquely identity the resource in the internal
// implementation of the service.
string opaque_id = 2;
}

// The representation of permissions attached to a resource.
Expand Down Expand Up @@ -367,8 +380,8 @@ message StorageSpace {
// OPTIONAL.
cs3.identity.user.v1beta1.User owner = 3;
// OPTIONAL.
// The root resource of the storage space.
Reference root = 4;
// The root resource id of the storage space.
ResourceId root = 4;
// OPTIONAL.
string name = 5;
// OPTIONAL.
Expand Down
Loading

0 comments on commit 5133cda

Please sign in to comment.