v1

package
v0.1.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package v1 contains the v1 GRPC client and server definitions for implementing OIDC interactions for the Platform.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SecurityTokenService_Exchange_FullMethodName             = "/chainguard.platform.oidc.SecurityTokenService/Exchange"
	SecurityTokenService_ExchangeRefreshToken_FullMethodName = "/chainguard.platform.oidc.SecurityTokenService/ExchangeRefreshToken"
)

Variables

View Source
var File_oidc_platform_proto protoreflect.FileDescriptor
View Source
var SecurityTokenService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "chainguard.platform.oidc.SecurityTokenService",
	HandlerType: (*SecurityTokenServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Exchange",
			Handler:    _SecurityTokenService_Exchange_Handler,
		},
		{
			MethodName: "ExchangeRefreshToken",
			Handler:    _SecurityTokenService_ExchangeRefreshToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "oidc.platform.proto",
}

SecurityTokenService_ServiceDesc is the grpc.ServiceDesc for SecurityTokenService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSecurityTokenServiceHandler

func RegisterSecurityTokenServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSecurityTokenServiceHandler registers the http handlers for service SecurityTokenService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSecurityTokenServiceHandlerClient

func RegisterSecurityTokenServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SecurityTokenServiceClient) error

RegisterSecurityTokenServiceHandlerClient registers the http handlers for service SecurityTokenService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SecurityTokenServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SecurityTokenServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SecurityTokenServiceClient" to call the correct interceptors.

func RegisterSecurityTokenServiceHandlerFromEndpoint

func RegisterSecurityTokenServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSecurityTokenServiceHandlerFromEndpoint is same as RegisterSecurityTokenServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSecurityTokenServiceHandlerServer

func RegisterSecurityTokenServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SecurityTokenServiceServer) error

RegisterSecurityTokenServiceHandlerServer registers the http handlers for service SecurityTokenService to "mux". UnaryRPC :call SecurityTokenServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSecurityTokenServiceHandlerFromEndpoint instead.

func RegisterSecurityTokenServiceServer

func RegisterSecurityTokenServiceServer(s grpc.ServiceRegistrar, srv SecurityTokenServiceServer)

Types

type ClientOption

type ClientOption func(*options)

func WithUserAgent

func WithUserAgent(agent string) ClientOption

type Clients

type Clients interface {
	STS() SecurityTokenServiceClient

	Close() error
}

func NewClients

func NewClients(ctx context.Context, addr string, token string, opts ...ClientOption) (Clients, error)

func NewClientsFromConnection

func NewClientsFromConnection(conn *grpc.ClientConn) Clients

type ExchangeRefreshTokenRequest added in v0.1.11

type ExchangeRefreshTokenRequest struct {
	Aud   []string `protobuf:"bytes,1,rep,name=aud,proto3" json:"aud,omitempty"`
	Scope string   `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"`
	// List of capabilities to request for the token.
	Cap []string `protobuf:"bytes,3,rep,name=cap,proto3" json:"cap,omitempty"`
	// contains filtered or unexported fields
}

func (*ExchangeRefreshTokenRequest) Descriptor deprecated added in v0.1.11

func (*ExchangeRefreshTokenRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExchangeRefreshTokenRequest.ProtoReflect.Descriptor instead.

func (*ExchangeRefreshTokenRequest) GetAud added in v0.1.11

func (x *ExchangeRefreshTokenRequest) GetAud() []string

func (*ExchangeRefreshTokenRequest) GetCap added in v0.1.11

func (x *ExchangeRefreshTokenRequest) GetCap() []string

func (*ExchangeRefreshTokenRequest) GetScope added in v0.1.11

func (x *ExchangeRefreshTokenRequest) GetScope() string

func (*ExchangeRefreshTokenRequest) ProtoMessage added in v0.1.11

func (*ExchangeRefreshTokenRequest) ProtoMessage()

func (*ExchangeRefreshTokenRequest) ProtoReflect added in v0.1.11

func (*ExchangeRefreshTokenRequest) Reset added in v0.1.11

func (x *ExchangeRefreshTokenRequest) Reset()

func (*ExchangeRefreshTokenRequest) String added in v0.1.11

func (x *ExchangeRefreshTokenRequest) String() string

type ExchangeRequest

type ExchangeRequest struct {
	Aud      []string `protobuf:"bytes,1,rep,name=aud,proto3" json:"aud,omitempty"`
	Scope    string   `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"`
	Cluster  string   `protobuf:"bytes,3,opt,name=cluster,proto3" json:"cluster,omitempty"`
	Identity string   `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"`
	// List of capabilities to request for the token.
	Cap []string `protobuf:"bytes,5,rep,name=cap,proto3" json:"cap,omitempty"`
	// Whether or not to include the upstream token in the response
	IncludeUpstreamToken bool `protobuf:"varint,6,opt,name=include_upstream_token,json=includeUpstreamToken,proto3" json:"include_upstream_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ExchangeRequest) Descriptor deprecated

func (*ExchangeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExchangeRequest.ProtoReflect.Descriptor instead.

func (*ExchangeRequest) GetAud

func (x *ExchangeRequest) GetAud() []string

func (*ExchangeRequest) GetCap

func (x *ExchangeRequest) GetCap() []string

func (*ExchangeRequest) GetCluster

func (x *ExchangeRequest) GetCluster() string

func (*ExchangeRequest) GetIdentity

func (x *ExchangeRequest) GetIdentity() string

func (*ExchangeRequest) GetIncludeUpstreamToken

func (x *ExchangeRequest) GetIncludeUpstreamToken() bool

func (*ExchangeRequest) GetScope

func (x *ExchangeRequest) GetScope() string

func (*ExchangeRequest) ProtoMessage

func (*ExchangeRequest) ProtoMessage()

func (*ExchangeRequest) ProtoReflect

func (x *ExchangeRequest) ProtoReflect() protoreflect.Message

func (*ExchangeRequest) Reset

func (x *ExchangeRequest) Reset()

func (*ExchangeRequest) String

func (x *ExchangeRequest) String() string

type RawToken

type RawToken struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*RawToken) Descriptor deprecated

func (*RawToken) Descriptor() ([]byte, []int)

Deprecated: Use RawToken.ProtoReflect.Descriptor instead.

func (*RawToken) GetToken

func (x *RawToken) GetToken() string

func (*RawToken) ProtoMessage

func (*RawToken) ProtoMessage()

func (*RawToken) ProtoReflect

func (x *RawToken) ProtoReflect() protoreflect.Message

func (*RawToken) Reset

func (x *RawToken) Reset()

func (*RawToken) String

func (x *RawToken) String() string

type SecurityTokenServiceClient

type SecurityTokenServiceClient interface {
	Exchange(ctx context.Context, in *ExchangeRequest, opts ...grpc.CallOption) (*RawToken, error)
	ExchangeRefreshToken(ctx context.Context, in *ExchangeRefreshTokenRequest, opts ...grpc.CallOption) (*TokenPair, error)
}

SecurityTokenServiceClient is the client API for SecurityTokenService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type SecurityTokenServiceServer

type SecurityTokenServiceServer interface {
	Exchange(context.Context, *ExchangeRequest) (*RawToken, error)
	ExchangeRefreshToken(context.Context, *ExchangeRefreshTokenRequest) (*TokenPair, error)
	// contains filtered or unexported methods
}

SecurityTokenServiceServer is the server API for SecurityTokenService service. All implementations must embed UnimplementedSecurityTokenServiceServer for forward compatibility

type TokenPair added in v0.1.11

type TokenPair struct {
	Token        *RawToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	RefreshToken *RawToken `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

ExchangeRefreshToken returns a pair of token, in order to allow refresh token to also be rotated.

func (*TokenPair) Descriptor deprecated added in v0.1.11

func (*TokenPair) Descriptor() ([]byte, []int)

Deprecated: Use TokenPair.ProtoReflect.Descriptor instead.

func (*TokenPair) GetRefreshToken added in v0.1.11

func (x *TokenPair) GetRefreshToken() *RawToken

func (*TokenPair) GetToken added in v0.1.11

func (x *TokenPair) GetToken() *RawToken

func (*TokenPair) ProtoMessage added in v0.1.11

func (*TokenPair) ProtoMessage()

func (*TokenPair) ProtoReflect added in v0.1.11

func (x *TokenPair) ProtoReflect() protoreflect.Message

func (*TokenPair) Reset added in v0.1.11

func (x *TokenPair) Reset()

func (*TokenPair) String added in v0.1.11

func (x *TokenPair) String() string

type UnimplementedSecurityTokenServiceServer

type UnimplementedSecurityTokenServiceServer struct {
}

UnimplementedSecurityTokenServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSecurityTokenServiceServer) Exchange

func (UnimplementedSecurityTokenServiceServer) ExchangeRefreshToken added in v0.1.11

type UnsafeSecurityTokenServiceServer

type UnsafeSecurityTokenServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeSecurityTokenServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SecurityTokenServiceServer will result in compilation errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL