Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/public-api/go/experimental/v1/v1connect/oidc.connect.go
2501 views
1
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
6
//
7
// Source: gitpod/experimental/v1/oidc.proto
8
9
package v1connect
10
11
import (
12
context "context"
13
errors "errors"
14
connect_go "github.com/bufbuild/connect-go"
15
v1 "github.com/gitpod-io/gitpod/components/public-api/go/experimental/v1"
16
http "net/http"
17
strings "strings"
18
)
19
20
// This is a compile-time assertion to ensure that this generated file and the connect package are
21
// compatible. If you get a compiler error that this constant is not defined, this code was
22
// generated with a version of connect newer than the one compiled into your binary. You can fix the
23
// problem by either regenerating this code with an older version of connect or updating the connect
24
// version compiled into your binary.
25
const _ = connect_go.IsAtLeastVersion0_1_0
26
27
const (
28
// OIDCServiceName is the fully-qualified name of the OIDCService service.
29
OIDCServiceName = "gitpod.experimental.v1.OIDCService"
30
)
31
32
// OIDCServiceClient is a client for the gitpod.experimental.v1.OIDCService service.
33
type OIDCServiceClient interface {
34
// Creates a new OIDC client configuration.
35
CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error)
36
// Retrieves an OIDC client configuration by ID.
37
GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error)
38
// Lists OIDC client configurations.
39
ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error)
40
// Updates modifiable properties of an existing OIDC client configuration.
41
UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error)
42
// Removes an OIDC client configuration by ID.
43
DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error)
44
// Activates an OIDC client configuration by ID.
45
SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error)
46
}
47
48
// NewOIDCServiceClient constructs a client for the gitpod.experimental.v1.OIDCService service. By
49
// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses,
50
// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
51
// connect.WithGRPC() or connect.WithGRPCWeb() options.
52
//
53
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
54
// http://api.acme.com or https://acme.com/grpc).
55
func NewOIDCServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) OIDCServiceClient {
56
baseURL = strings.TrimRight(baseURL, "/")
57
return &oIDCServiceClient{
58
createClientConfig: connect_go.NewClient[v1.CreateClientConfigRequest, v1.CreateClientConfigResponse](
59
httpClient,
60
baseURL+"/gitpod.experimental.v1.OIDCService/CreateClientConfig",
61
opts...,
62
),
63
getClientConfig: connect_go.NewClient[v1.GetClientConfigRequest, v1.GetClientConfigResponse](
64
httpClient,
65
baseURL+"/gitpod.experimental.v1.OIDCService/GetClientConfig",
66
opts...,
67
),
68
listClientConfigs: connect_go.NewClient[v1.ListClientConfigsRequest, v1.ListClientConfigsResponse](
69
httpClient,
70
baseURL+"/gitpod.experimental.v1.OIDCService/ListClientConfigs",
71
opts...,
72
),
73
updateClientConfig: connect_go.NewClient[v1.UpdateClientConfigRequest, v1.UpdateClientConfigResponse](
74
httpClient,
75
baseURL+"/gitpod.experimental.v1.OIDCService/UpdateClientConfig",
76
opts...,
77
),
78
deleteClientConfig: connect_go.NewClient[v1.DeleteClientConfigRequest, v1.DeleteClientConfigResponse](
79
httpClient,
80
baseURL+"/gitpod.experimental.v1.OIDCService/DeleteClientConfig",
81
opts...,
82
),
83
setClientConfigActivation: connect_go.NewClient[v1.SetClientConfigActivationRequest, v1.SetClientConfigActivationResponse](
84
httpClient,
85
baseURL+"/gitpod.experimental.v1.OIDCService/SetClientConfigActivation",
86
opts...,
87
),
88
}
89
}
90
91
// oIDCServiceClient implements OIDCServiceClient.
92
type oIDCServiceClient struct {
93
createClientConfig *connect_go.Client[v1.CreateClientConfigRequest, v1.CreateClientConfigResponse]
94
getClientConfig *connect_go.Client[v1.GetClientConfigRequest, v1.GetClientConfigResponse]
95
listClientConfigs *connect_go.Client[v1.ListClientConfigsRequest, v1.ListClientConfigsResponse]
96
updateClientConfig *connect_go.Client[v1.UpdateClientConfigRequest, v1.UpdateClientConfigResponse]
97
deleteClientConfig *connect_go.Client[v1.DeleteClientConfigRequest, v1.DeleteClientConfigResponse]
98
setClientConfigActivation *connect_go.Client[v1.SetClientConfigActivationRequest, v1.SetClientConfigActivationResponse]
99
}
100
101
// CreateClientConfig calls gitpod.experimental.v1.OIDCService.CreateClientConfig.
102
func (c *oIDCServiceClient) CreateClientConfig(ctx context.Context, req *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error) {
103
return c.createClientConfig.CallUnary(ctx, req)
104
}
105
106
// GetClientConfig calls gitpod.experimental.v1.OIDCService.GetClientConfig.
107
func (c *oIDCServiceClient) GetClientConfig(ctx context.Context, req *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error) {
108
return c.getClientConfig.CallUnary(ctx, req)
109
}
110
111
// ListClientConfigs calls gitpod.experimental.v1.OIDCService.ListClientConfigs.
112
func (c *oIDCServiceClient) ListClientConfigs(ctx context.Context, req *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error) {
113
return c.listClientConfigs.CallUnary(ctx, req)
114
}
115
116
// UpdateClientConfig calls gitpod.experimental.v1.OIDCService.UpdateClientConfig.
117
func (c *oIDCServiceClient) UpdateClientConfig(ctx context.Context, req *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error) {
118
return c.updateClientConfig.CallUnary(ctx, req)
119
}
120
121
// DeleteClientConfig calls gitpod.experimental.v1.OIDCService.DeleteClientConfig.
122
func (c *oIDCServiceClient) DeleteClientConfig(ctx context.Context, req *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error) {
123
return c.deleteClientConfig.CallUnary(ctx, req)
124
}
125
126
// SetClientConfigActivation calls gitpod.experimental.v1.OIDCService.SetClientConfigActivation.
127
func (c *oIDCServiceClient) SetClientConfigActivation(ctx context.Context, req *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error) {
128
return c.setClientConfigActivation.CallUnary(ctx, req)
129
}
130
131
// OIDCServiceHandler is an implementation of the gitpod.experimental.v1.OIDCService service.
132
type OIDCServiceHandler interface {
133
// Creates a new OIDC client configuration.
134
CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error)
135
// Retrieves an OIDC client configuration by ID.
136
GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error)
137
// Lists OIDC client configurations.
138
ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error)
139
// Updates modifiable properties of an existing OIDC client configuration.
140
UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error)
141
// Removes an OIDC client configuration by ID.
142
DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error)
143
// Activates an OIDC client configuration by ID.
144
SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error)
145
}
146
147
// NewOIDCServiceHandler builds an HTTP handler from the service implementation. It returns the path
148
// on which to mount the handler and the handler itself.
149
//
150
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
151
// and JSON codecs. They also support gzip compression.
152
func NewOIDCServiceHandler(svc OIDCServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
153
mux := http.NewServeMux()
154
mux.Handle("/gitpod.experimental.v1.OIDCService/CreateClientConfig", connect_go.NewUnaryHandler(
155
"/gitpod.experimental.v1.OIDCService/CreateClientConfig",
156
svc.CreateClientConfig,
157
opts...,
158
))
159
mux.Handle("/gitpod.experimental.v1.OIDCService/GetClientConfig", connect_go.NewUnaryHandler(
160
"/gitpod.experimental.v1.OIDCService/GetClientConfig",
161
svc.GetClientConfig,
162
opts...,
163
))
164
mux.Handle("/gitpod.experimental.v1.OIDCService/ListClientConfigs", connect_go.NewUnaryHandler(
165
"/gitpod.experimental.v1.OIDCService/ListClientConfigs",
166
svc.ListClientConfigs,
167
opts...,
168
))
169
mux.Handle("/gitpod.experimental.v1.OIDCService/UpdateClientConfig", connect_go.NewUnaryHandler(
170
"/gitpod.experimental.v1.OIDCService/UpdateClientConfig",
171
svc.UpdateClientConfig,
172
opts...,
173
))
174
mux.Handle("/gitpod.experimental.v1.OIDCService/DeleteClientConfig", connect_go.NewUnaryHandler(
175
"/gitpod.experimental.v1.OIDCService/DeleteClientConfig",
176
svc.DeleteClientConfig,
177
opts...,
178
))
179
mux.Handle("/gitpod.experimental.v1.OIDCService/SetClientConfigActivation", connect_go.NewUnaryHandler(
180
"/gitpod.experimental.v1.OIDCService/SetClientConfigActivation",
181
svc.SetClientConfigActivation,
182
opts...,
183
))
184
return "/gitpod.experimental.v1.OIDCService/", mux
185
}
186
187
// UnimplementedOIDCServiceHandler returns CodeUnimplemented from all methods.
188
type UnimplementedOIDCServiceHandler struct{}
189
190
func (UnimplementedOIDCServiceHandler) CreateClientConfig(context.Context, *connect_go.Request[v1.CreateClientConfigRequest]) (*connect_go.Response[v1.CreateClientConfigResponse], error) {
191
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.CreateClientConfig is not implemented"))
192
}
193
194
func (UnimplementedOIDCServiceHandler) GetClientConfig(context.Context, *connect_go.Request[v1.GetClientConfigRequest]) (*connect_go.Response[v1.GetClientConfigResponse], error) {
195
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.GetClientConfig is not implemented"))
196
}
197
198
func (UnimplementedOIDCServiceHandler) ListClientConfigs(context.Context, *connect_go.Request[v1.ListClientConfigsRequest]) (*connect_go.Response[v1.ListClientConfigsResponse], error) {
199
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.ListClientConfigs is not implemented"))
200
}
201
202
func (UnimplementedOIDCServiceHandler) UpdateClientConfig(context.Context, *connect_go.Request[v1.UpdateClientConfigRequest]) (*connect_go.Response[v1.UpdateClientConfigResponse], error) {
203
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.UpdateClientConfig is not implemented"))
204
}
205
206
func (UnimplementedOIDCServiceHandler) DeleteClientConfig(context.Context, *connect_go.Request[v1.DeleteClientConfigRequest]) (*connect_go.Response[v1.DeleteClientConfigResponse], error) {
207
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.DeleteClientConfig is not implemented"))
208
}
209
210
func (UnimplementedOIDCServiceHandler) SetClientConfigActivation(context.Context, *connect_go.Request[v1.SetClientConfigActivationRequest]) (*connect_go.Response[v1.SetClientConfigActivationResponse], error) {
211
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.OIDCService.SetClientConfigActivation is not implemented"))
212
}
213
214