Skip to content

Commit

Permalink
merge: Merge pull request #84 from ArunaStorage/dev
Browse files Browse the repository at this point in the history
[feat] Update svc account handling from dev
  • Loading branch information
St4NNi authored Jun 30, 2023
2 parents 1e26057 + a01c809 commit 7fce8ce
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions aruna/api/storage/services/v1/service_account_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ option go_package = "github.com/ArunaStorage/go-api/aruna/api/storage/services/v
option java_multiple_files = true;
option java_package = "com.github.ArunaStorage.java_api.aruna.api.storage.services.v1";
option java_outer_classname = "ServiceAccountService";

import "aruna/api/storage/models/v1/auth.proto";

import "google/api/visibility.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";

Expand All @@ -20,7 +17,6 @@ import "google/protobuf/timestamp.proto";
// Service account users will always contain (bot) behind their name
service ServiceAccountService {

option (google.api.api_visibility).restriction = "UNFINISHED";
// CreateServiceAccount
//
// Creates a service account for a given project
Expand All @@ -45,10 +41,10 @@ service ServiceAccountService {
};
}

// EditServiceAccountPermission
// SetServiceAccountPermission
//
// Overwrites the project specific permissions for a service account
rpc EditServiceAccountPermission(EditServiceAccountPermissionRequest) returns (EditServiceAccountPermissionResponse){
rpc SetServiceAccountPermission(SetServiceAccountPermissionRequest) returns (SetServiceAccountPermissionResponse){
option (google.api.http) = {
put : "/v1/service_account/{svc_account_id}/permissions"
body : "*"
Expand Down Expand Up @@ -132,33 +128,36 @@ message CreateServiceAccountResponse {
}

message CreateServiceAccountTokenRequest {
// Empty if token should inherit account / project permissions
string svc_account_id = 1;
// Collection id
string collection_id = 2;
// Token name
string name = 3;
// Token expiry
google.protobuf.Timestamp expires_at = 4;
// Token permissions
storage.models.v1.Permission permission = 5;
// Identify the associated project (should always be provided)
string project_id = 2;
// Collection id, will be empty if permission should be on project level
string collection_id = 3;
// (optional) Token name
string name = 4;
// (optional) Token expiry
google.protobuf.Timestamp expires_at = 5;
// Token permissions, must be less than or equal user permissions
storage.models.v1.Permission permission = 6;
}

message CreateServiceAccountTokenResponse {
// This contains only the token description
storage.models.v1.Token token = 1;
// This is the actual secret token
// Attention, this can not be recreated and needs to be stored securely
// New tokens will always contain a new secret
// This is the actual secret API token
string token_secret = 2;
// S3 Access Key
string s3_access_key = 3;
// S3 Secret Key
string s3_secret_key = 4;
}

message EditServiceAccountPermissionRequest {
message SetServiceAccountPermissionRequest {
string svc_account_id = 1;
storage.models.v1.Permission new_permission = 2;
}

message EditServiceAccountPermissionResponse {
message SetServiceAccountPermissionResponse {
ServiceAccount service_account = 1;
}

Expand Down

0 comments on commit 7fce8ce

Please sign in to comment.