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/identityprovider.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/identityprovider.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
// IdentityProviderServiceName is the fully-qualified name of the IdentityProviderService service.
29
IdentityProviderServiceName = "gitpod.experimental.v1.IdentityProviderService"
30
)
31
32
// IdentityProviderServiceClient is a client for the gitpod.experimental.v1.IdentityProviderService
33
// service.
34
type IdentityProviderServiceClient interface {
35
// GetIDToken produces a new OIDC ID token (https://openid.net/specs/openid-connect-core-1_0.html#ImplicitIDToken)
36
GetIDToken(context.Context, *connect_go.Request[v1.GetIDTokenRequest]) (*connect_go.Response[v1.GetIDTokenResponse], error)
37
}
38
39
// NewIdentityProviderServiceClient constructs a client for the
40
// gitpod.experimental.v1.IdentityProviderService service. By default, it uses the Connect protocol
41
// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To
42
// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()
43
// options.
44
//
45
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
46
// http://api.acme.com or https://acme.com/grpc).
47
func NewIdentityProviderServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) IdentityProviderServiceClient {
48
baseURL = strings.TrimRight(baseURL, "/")
49
return &identityProviderServiceClient{
50
getIDToken: connect_go.NewClient[v1.GetIDTokenRequest, v1.GetIDTokenResponse](
51
httpClient,
52
baseURL+"/gitpod.experimental.v1.IdentityProviderService/GetIDToken",
53
opts...,
54
),
55
}
56
}
57
58
// identityProviderServiceClient implements IdentityProviderServiceClient.
59
type identityProviderServiceClient struct {
60
getIDToken *connect_go.Client[v1.GetIDTokenRequest, v1.GetIDTokenResponse]
61
}
62
63
// GetIDToken calls gitpod.experimental.v1.IdentityProviderService.GetIDToken.
64
func (c *identityProviderServiceClient) GetIDToken(ctx context.Context, req *connect_go.Request[v1.GetIDTokenRequest]) (*connect_go.Response[v1.GetIDTokenResponse], error) {
65
return c.getIDToken.CallUnary(ctx, req)
66
}
67
68
// IdentityProviderServiceHandler is an implementation of the
69
// gitpod.experimental.v1.IdentityProviderService service.
70
type IdentityProviderServiceHandler interface {
71
// GetIDToken produces a new OIDC ID token (https://openid.net/specs/openid-connect-core-1_0.html#ImplicitIDToken)
72
GetIDToken(context.Context, *connect_go.Request[v1.GetIDTokenRequest]) (*connect_go.Response[v1.GetIDTokenResponse], error)
73
}
74
75
// NewIdentityProviderServiceHandler builds an HTTP handler from the service implementation. It
76
// returns the path on which to mount the handler and the handler itself.
77
//
78
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
79
// and JSON codecs. They also support gzip compression.
80
func NewIdentityProviderServiceHandler(svc IdentityProviderServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) {
81
mux := http.NewServeMux()
82
mux.Handle("/gitpod.experimental.v1.IdentityProviderService/GetIDToken", connect_go.NewUnaryHandler(
83
"/gitpod.experimental.v1.IdentityProviderService/GetIDToken",
84
svc.GetIDToken,
85
opts...,
86
))
87
return "/gitpod.experimental.v1.IdentityProviderService/", mux
88
}
89
90
// UnimplementedIdentityProviderServiceHandler returns CodeUnimplemented from all methods.
91
type UnimplementedIdentityProviderServiceHandler struct{}
92
93
func (UnimplementedIdentityProviderServiceHandler) GetIDToken(context.Context, *connect_go.Request[v1.GetIDTokenRequest]) (*connect_go.Response[v1.GetIDTokenResponse], error) {
94
return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.experimental.v1.IdentityProviderService.GetIDToken is not implemented"))
95
}
96
97