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

[papi] Add proto for SCMService #19075

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
61 changes: 61 additions & 0 deletions components/public-api/gitpod/v1/scm.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,70 @@ syntax = "proto3";
package gitpod.v1;

import "google/protobuf/timestamp.proto";
import "gitpod/v1/pagination.proto";

option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";

service SCMService {
AlexTugarev marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

@svenefftinge svenefftinge Nov 15, 2023

Choose a reason for hiding this comment

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

thought: For all these methods we currently imply the authorizedUser. So there will be no way to call any of these methods in the context of a third user. I think. that is fine.

Copy link
Member

Choose a reason for hiding this comment

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

Also in case we later want to allow some of these methods to be called for other users, we can introduce a userId as an optional argument.

rpc GetSCMToken(GetSCMTokenRequest) returns (GetSCMTokenResponse) {}
rpc GuessTokenScopes(GuessTokenScopesRequest) returns (GuessTokenScopesResponse) {}
rpc SearchRepositories(SearchRepositoriesRequest) returns (SearchRepositoriesResponse) {}
rpc ListSuggestedRepositories(ListSuggestedRepositoriesRequest) returns (ListSuggestedRepositoriesResponse) {}
}

message GetSCMTokenRequest {
string host = 1;
}
message GetSCMTokenResponse {
SCMToken token = 1;
}

message GuessTokenScopesRequest {
string host = 1;
string repo_url = 2;
string git_command = 3;
}
message GuessTokenScopesResponse {
repeated string scopes = 1;
string message = 2;
}

message SearchRepositoriesRequest {
string search_string = 1;
int32 limit = 2;
}
message SearchRepositoriesResponse {
repeated SuggestedRepository repositories = 1;
}

message ListSuggestedRepositoriesRequest {
PaginationRequest pagination = 1;

string organization_id = 2;
}
message ListSuggestedRepositoriesResponse {
PaginationResponse pagination = 1;

repeated SuggestedRepository repositories = 2;
}

message SCMToken {
string username = 1;
string value = 2;
string id_token = 3;
string refresh_token = 4;
repeated string scopes = 5;
google.protobuf.Timestamp update_date = 6;
google.protobuf.Timestamp expiry_date = 7;
}

message SuggestedRepository {
string url = 1;
string repo_name = 2;
string configuration_id = 3;
string configuration_name = 4;
}

message Author {
string name = 1;
string avatar_url = 2;
Expand Down
Loading
Loading