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

Rework Lock API metadata and add missing argument to Unlock #162

Merged
merged 8 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cs3/storage/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,9 @@ message UnlockRequest {
// REQUIRED.
// The reference the lock is associated to.
Reference ref = 2;
// REQUIRED.
// The lock metadata.
Lock lock = 3;
}

message UnlockResponse {
Expand Down
31 changes: 12 additions & 19 deletions cs3/storage/provider/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ message ResourceInfo {
// OPTIONAL.
// Arbitrary metadata attached to a resource.
ArbitraryMetadata arbitrary_metadata = 14;
// OPTIONAL.
// Lock on this resource.
Lock lock = 15;
}

// CanonicalMetadata contains extra metadata
Expand Down Expand Up @@ -135,29 +138,19 @@ enum LockType {
// of this metadata according to their constraints, a reference
// implementation is given here. The lock SHOULD be stored
// as an extended attribute on the referenced filesystem entry.
// It MUST NOT be accessible via the Stat/SetArbitraryMetadata APIs,
// and it SHOULD contain a base64-encoded JSON with the following format:
// {
// "type" : "<LOCK_TYPE>",
// "h" : "<holder>",
// "md" : "<metadata>",
// "mtime" : "<Unix timestamp>"
// }
// It MUST NOT be accessible via the Stat/SetArbitraryMetadata APIs.
glpatcern marked this conversation as resolved.
Show resolved Hide resolved
butonic marked this conversation as resolved.
Show resolved Hide resolved
message Lock {
// The type of lock.
LockType type = 1;
// The entity holding the lock.
oneof holder {
// A userid if the lock is held by a user.
cs3.identity.user.v1beta1.UserId user = 2;
// An application name if the lock is held by an app.
string app_name = 3;
}
// Some arbitrary metadata associated with the lock.
// The entities holding the lock.
// REQUIRED. At least one userid of the users participating in the lock.
repeated cs3.identity.user.v1beta1.UserId users = 2;
// An application name if the lock is held by an app.
string app_name = 3;
// OPTIONAL. Some arbitrary metadata associated with the lock.
string metadata = 4;
// The last modification time of the lock.
// The value is Unix Epoch timestamp in seconds.
cs3.types.v1beta1.Timestamp mtime = 5;
// OPTIONAL. The time when the lock will expire.
butonic marked this conversation as resolved.
Show resolved Hide resolved
cs3.types.v1beta1.Timestamp expiration = 5;
}

// The available types of resources.
Expand Down