Skip to content
Merged
Changes from all 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
43 changes: 40 additions & 3 deletions odpf/optimus/core/v1beta1/runtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ service RuntimeService {
body: "*"
};
}

// UpdateSecret updates secret at project level
rpc UpdateSecret(UpdateSecretRequest) returns (UpdateSecretResponse) {
option (google.api.http) = {
put: "/v1beta1/project/{project_name}/secret/{secret_name}"
body: "*"
};
}

// ListSecrets shows the secrets registered for a project
rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) {
option (google.api.http) = {
get: "/v1beta1/project/{project_name}/secret"
};
}

// ListProjects returns list of registered projects and configurations
rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -559,11 +575,32 @@ message RegisterSecretRequest {
string project_name = 1;
string secret_name = 2;
string value = 3; // base64 encoded secret value
string namespace_name = 4;
}

message RegisterSecretResponse {
bool success = 1;
string message = 2;
message RegisterSecretResponse {}

message UpdateSecretRequest {
string project_name = 1;
string secret_name = 2;
string value = 3; // base64 encoded secret value
string namespace_name = 4;
}

message UpdateSecretResponse {}

message ListSecretsRequest {
string project_name = 1;
}

message ListSecretsResponse {
message Secret {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we extract this message at root level so we don't need to create again for Get call? We can add a value field as well but return it empty for List call? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of now we don't have a GET call, we can extract this message when we have the GET and add required fields.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will require us to refractor the code again to use a different proto message right? Why not have it designed like that from the start?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have any GET call planned to expose cleartext secrets over api.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, get on a secret isn't planned, and the expectation from read is to return the plaintext secret, so the message will change again. So, we can keep it under SecretList

string name = 1;
string digest = 2;
string namespace = 3;
google.protobuf.Timestamp updated_at = 4;
}
repeated Secret secrets = 1;
}

message ListProjectsRequest {}
Expand Down