Skip to content

Commit

Permalink
[public-api] define error details (#19102)
Browse files Browse the repository at this point in the history
+ ensure consistent formatting
  • Loading branch information
akosyakov authored Nov 21, 2023
1 parent 3ff9173 commit 0a5d89c
Show file tree
Hide file tree
Showing 35 changed files with 2,407 additions and 857 deletions.
3 changes: 3 additions & 0 deletions components/public-api/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ install_dependencies

lint

# Format all proto files
buf format -w

# Run breaking change detector
buf breaking --against "https://github.com/gitpod-io/gitpod.git#branch=main,subdir=components/public-api"

Expand Down
7 changes: 4 additions & 3 deletions components/public-api/gitpod/experimental/v1/dummy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ service HelloService {
rpc SayHello(SayHelloRequest) returns (SayHelloResponse);
// Server streaming RPCs where the client sends a request to the server and
// gets a stream to read a sequence of messages back.
rpc LotsOfReplies(LotsOfRepliesRequest)
returns (stream LotsOfRepliesResponse);
rpc LotsOfReplies(LotsOfRepliesRequest) returns (stream LotsOfRepliesResponse);
}

message SayHelloRequest {}
message SayHelloResponse { string reply = 1; }
message SayHelloResponse {
string reply = 1;
}

message LotsOfRepliesRequest {
int32 previous_count = 1;
Expand Down
60 changes: 30 additions & 30 deletions components/public-api/gitpod/experimental/v1/editor_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@ package gitpod.experimental.v1;
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1";

service EditorService {
rpc ListEditorOptions(ListEditorOptionsRequest) returns (ListEditorOptionsResponse) {}
rpc ListEditorOptions(ListEditorOptionsRequest) returns (ListEditorOptionsResponse) {}
}

message ListEditorOptionsRequest {}

message ListEditorOptionsResponse {
repeated EditorOption result = 1;
repeated EditorOption result = 1;
}

message EditorOption {
// The unique identifier for an editor.
string id = 1;

// Human readable title text of the editor (plain text only).
string title = 2;

// The type of the editor, currently browser or desktop.
enum Type {
TYPE_UNSPECIFIED = 0;
TYPE_BROWSER = 1;
TYPE_DESKTOP = 2;
}
Type type = 3;

// The logo for the editor
string logo = 4;

// Text of an optional label next to the editor option like “Insiders” (plain
// text only).
string label = 5;

message Kind {
// The semantic version of the editor.
string version = 1;
}

Kind stable = 6;
Kind latest = 7;
// The unique identifier for an editor.
string id = 1;

// Human readable title text of the editor (plain text only).
string title = 2;

// The type of the editor, currently browser or desktop.
enum Type {
TYPE_UNSPECIFIED = 0;
TYPE_BROWSER = 1;
TYPE_DESKTOP = 2;
}
Type type = 3;

// The logo for the editor
string logo = 4;

// Text of an optional label next to the editor option like “Insiders” (plain
// text only).
string label = 5;

message Kind {
// The semantic version of the editor.
string version = 1;
}

Kind stable = 6;
Kind latest = 7;
}
24 changes: 12 additions & 12 deletions components/public-api/gitpod/experimental/v1/ide_client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ syntax = "proto3";

package gitpod.experimental.v1;

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

import "gitpod/experimental/v1/workspaces.proto";

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

service IDEClientService {
// SendHeartbeat sends a clientheartbeat signal for a running workspace.
rpc SendHeartbeat(SendHeartbeatRequest) returns (SendHeartbeatResponse) {}
// SendHeartbeat sends a clientheartbeat signal for a running workspace.
rpc SendHeartbeat(SendHeartbeatRequest) returns (SendHeartbeatResponse) {}

// SendDidClose sends a client close signal for a running workspace.
rpc SendDidClose(SendDidCloseRequest) returns (SendDidCloseResponse) {}
// SendDidClose sends a client close signal for a running workspace.
rpc SendDidClose(SendDidCloseRequest) returns (SendDidCloseResponse) {}

// UpdateGitStatus updates the status of a repository in a workspace.
rpc UpdateGitStatus(UpdateGitStatusRequest) returns (UpdateGitStatusResponse) {}
// UpdateGitStatus updates the status of a repository in a workspace.
rpc UpdateGitStatus(UpdateGitStatusRequest) returns (UpdateGitStatusResponse) {}
}

message SendHeartbeatRequest {
string workspace_id = 1;
string workspace_id = 1;
}
message SendHeartbeatResponse {}

message SendDidCloseRequest {
string workspace_id = 1;
string workspace_id = 1;
}
message SendDidCloseResponse {}

message UpdateGitStatusRequest {
string workspace_id = 1;
GitStatus status = 2;
string workspace_id = 1;
GitStatus status = 2;
}
message UpdateGitStatusResponse {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/experi

service IdentityProviderService {
// GetIDToken produces a new OIDC ID token (https://openid.net/specs/openid-connect-core-1_0.html#ImplicitIDToken)
rpc GetIDToken(GetIDTokenRequest) returns (GetIDTokenResponse) {};
rpc GetIDToken(GetIDTokenRequest) returns (GetIDTokenResponse) {}
}

message GetIDTokenRequest {
string workspace_id = 1;
repeated string audience = 2;
string workspace_id = 1;
repeated string audience = 2;
}

message GetIDTokenResponse {
string token = 1;
string token = 1;
}
19 changes: 8 additions & 11 deletions components/public-api/gitpod/experimental/v1/oidc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ syntax = "proto3";

package gitpod.experimental.v1;

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

import "google/protobuf/timestamp.proto";

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

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

// Configuration of an OpenID client.
//
Expand Down Expand Up @@ -131,25 +129,24 @@ message UserInfoKeys {
// The status of an OIDC client configuration.
message OIDCClientConfigStatus {}


service OIDCService {
// Creates a new OIDC client configuration.
rpc CreateClientConfig(CreateClientConfigRequest) returns (CreateClientConfigResponse) {};
rpc CreateClientConfig(CreateClientConfigRequest) returns (CreateClientConfigResponse) {}

// Retrieves an OIDC client configuration by ID.
rpc GetClientConfig(GetClientConfigRequest) returns (GetClientConfigResponse) {};
rpc GetClientConfig(GetClientConfigRequest) returns (GetClientConfigResponse) {}

// Lists OIDC client configurations.
rpc ListClientConfigs(ListClientConfigsRequest) returns (ListClientConfigsResponse) {};
rpc ListClientConfigs(ListClientConfigsRequest) returns (ListClientConfigsResponse) {}

// Updates modifiable properties of an existing OIDC client configuration.
rpc UpdateClientConfig(UpdateClientConfigRequest) returns (UpdateClientConfigResponse) {};
rpc UpdateClientConfig(UpdateClientConfigRequest) returns (UpdateClientConfigResponse) {}

// Removes an OIDC client configuration by ID.
rpc DeleteClientConfig(DeleteClientConfigRequest) returns (DeleteClientConfigResponse) {};
rpc DeleteClientConfig(DeleteClientConfigRequest) returns (DeleteClientConfigResponse) {}

// Activates an OIDC client configuration by ID.
rpc SetClientConfigActivation(SetClientConfigActivationRequest) returns (SetClientConfigActivationResponse) {};
rpc SetClientConfigActivation(SetClientConfigActivationRequest) returns (SetClientConfigActivationResponse) {}
}

message CreateClientConfigRequest {
Expand Down
14 changes: 7 additions & 7 deletions components/public-api/gitpod/experimental/v1/pagination.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ package gitpod.experimental.v1;
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1";

message Pagination {
// Page size is the maximum number of results to retrieve per page.
// Defaults to 25. Maximum 100.
int32 page_size = 1;
// Page size is the maximum number of results to retrieve per page.
// Defaults to 25. Maximum 100.
int32 page_size = 1;

// Page is the page number of results to retrieve.
// The first page starts at 1.
// Defaults to 1.
int32 page = 2;
// Page is the page number of results to retrieve.
// The first page starts at 1.
// Defaults to 1.
int32 page = 2;
}
Loading

0 comments on commit 0a5d89c

Please sign in to comment.