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: 21 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package v1 contains the v1 GRPC client and server definitions for implementing Auth interactions for the Console.

Index

Constants

View Source
const (
	Auth_Validate_FullMethodName = "/chainguard.platform.auth.Auth/Validate"
	Auth_Register_FullMethodName = "/chainguard.platform.auth.Auth/Register"
)

Variables

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "chainguard.platform.auth.Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Validate",
			Handler:    _Auth_Validate_Handler,
		},
		{
			MethodName: "Register",
			Handler:    _Auth_Register_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth.platform.proto",
}

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

View Source
var File_auth_platform_proto protoreflect.FileDescriptor

Functions

func RegisterAuthHandler

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

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

func RegisterAuthHandlerClient

func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthClient) error

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

func RegisterAuthHandlerFromEndpoint

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

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

func RegisterAuthHandlerServer

func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServer) error

RegisterAuthHandlerServer registers the http handlers for service Auth to "mux". UnaryRPC :call AuthServer 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 RegisterAuthHandlerFromEndpoint instead.

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	Validate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*WhoAmI, error)
	Register(ctx context.Context, in *RegistrationRequest, opts ...grpc.CallOption) (*Session, error)
}

AuthClient is the client API for Auth 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.

func NewAuthClient

func NewAuthClient(cc grpc.ClientConnInterface) AuthClient

type AuthServer

type AuthServer interface {
	Validate(context.Context, *emptypb.Empty) (*WhoAmI, error)
	Register(context.Context, *RegistrationRequest) (*Session, error)
	// contains filtered or unexported methods
}

AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility

type RegistrationRequest

type RegistrationRequest struct {

	// code is an optional encoded invite code, which allows us to register
	// the caller's identity as a member of a particular group as a particular
	// role.
	// +optional
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// cluster_id is an optional cluster id, which simultaneously registers
	// a Cluster with the Identity.  This path must specify an invite code, so
	// we know where in the IAM hierarchy to link the cluster.
	ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	// identity_id is an optional identity id. If the user already exists, this
	// by-passes identity registration and continues on to cluster registration
	// (if applicable)
	IdentityId string `protobuf:"bytes,3,opt,name=identity_id,json=identityId,proto3" json:"identity_id,omitempty"`
	// cluster_name is an optional name to give the cluster when one is
	// registered as part of the registration flow.
	ClusterName string `protobuf:"bytes,4,opt,name=cluster_name,json=clusterName,proto3" json:"cluster_name,omitempty"`
	// cluster_description is an optional description to give the cluster
	// when one is registered as part of the registration flow.
	ClusterDescription string `protobuf:"bytes,5,opt,name=cluster_description,json=clusterDescription,proto3" json:"cluster_description,omitempty"`
	// enforcer_options defines the enforcer options.
	EnforcerOptions *v1.Cluster_EnforcerOptions `protobuf:"bytes,6,opt,name=enforcer_options,json=enforcerOptions,proto3" json:"enforcer_options,omitempty"`
	// contains filtered or unexported fields
}

func (*RegistrationRequest) Descriptor deprecated

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

Deprecated: Use RegistrationRequest.ProtoReflect.Descriptor instead.

func (*RegistrationRequest) GetClusterDescription

func (x *RegistrationRequest) GetClusterDescription() string

func (*RegistrationRequest) GetClusterId

func (x *RegistrationRequest) GetClusterId() string

func (*RegistrationRequest) GetClusterName

func (x *RegistrationRequest) GetClusterName() string

func (*RegistrationRequest) GetCode

func (x *RegistrationRequest) GetCode() string

func (*RegistrationRequest) GetEnforcerOptions

func (x *RegistrationRequest) GetEnforcerOptions() *v1.Cluster_EnforcerOptions

func (*RegistrationRequest) GetIdentityId

func (x *RegistrationRequest) GetIdentityId() string

func (*RegistrationRequest) ProtoMessage

func (*RegistrationRequest) ProtoMessage()

func (*RegistrationRequest) ProtoReflect

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

func (*RegistrationRequest) Reset

func (x *RegistrationRequest) Reset()

func (*RegistrationRequest) String

func (x *RegistrationRequest) String() string

type Session

type Session struct {

	// identity, the Chainguard identity id.
	Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
	// group, the group this identity has joined by invitation, when an invite
	// code was supplied.
	Group string `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) CloudEventsExtension

func (x *Session) CloudEventsExtension(key string) (string, bool)

CloudEventsExtension implements chainguard.dev/sdk/events/Extendable.CloudEventsExtension

func (*Session) CloudEventsSubject

func (x *Session) CloudEventsSubject() string

CloudEventsSubject implements chainguard.dev/sdk/events/Eventable.CloudEventsSubject.

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetGroup

func (x *Session) GetGroup() string

func (*Session) GetIdentity

func (x *Session) GetIdentity() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) Register

func (UnimplementedAuthServer) Validate

type UnsafeAuthServer

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

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

type WhoAmI

type WhoAmI struct {

	// Issuer is the issuer of the token.
	Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
	// The subject of the token.
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// Audience is who the token is intended for.
	Audience []string `protobuf:"bytes,3,rep,name=audience,proto3" json:"audience,omitempty"`
	// When the token expires.
	Expiry *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// With the token was issued.
	IssuedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=issued_at,json=issuedAt,proto3" json:"issued_at,omitempty"`
	// The capabilities referenced in the token.
	Capabilities []*WhoAmI_Capability `protobuf:"bytes,101,rep,name=capabilities,proto3" json:"capabilities,omitempty"`
	// The upstream email for this token.
	Email string `protobuf:"bytes,102,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*WhoAmI) Descriptor deprecated

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

Deprecated: Use WhoAmI.ProtoReflect.Descriptor instead.

func (*WhoAmI) GetAudience

func (x *WhoAmI) GetAudience() []string

func (*WhoAmI) GetCapabilities

func (x *WhoAmI) GetCapabilities() []*WhoAmI_Capability

func (*WhoAmI) GetEmail

func (x *WhoAmI) GetEmail() string

func (*WhoAmI) GetExpiry

func (x *WhoAmI) GetExpiry() *timestamppb.Timestamp

func (*WhoAmI) GetIssuedAt

func (x *WhoAmI) GetIssuedAt() *timestamppb.Timestamp

func (*WhoAmI) GetIssuer

func (x *WhoAmI) GetIssuer() string

func (*WhoAmI) GetSubject

func (x *WhoAmI) GetSubject() string

func (*WhoAmI) ProtoMessage

func (*WhoAmI) ProtoMessage()

func (*WhoAmI) ProtoReflect

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

func (*WhoAmI) Reset

func (x *WhoAmI) Reset()

func (*WhoAmI) String

func (x *WhoAmI) String() string

type WhoAmI_Capability

type WhoAmI_Capability struct {

	// group of the bound role.
	Group *v11.Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// role of the bound identity.
	Role *v11.Role `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"`
	// contains filtered or unexported fields
}

--- Upstream fields ---

func (*WhoAmI_Capability) Descriptor deprecated

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

Deprecated: Use WhoAmI_Capability.ProtoReflect.Descriptor instead.

func (*WhoAmI_Capability) GetGroup

func (x *WhoAmI_Capability) GetGroup() *v11.Group

func (*WhoAmI_Capability) GetRole

func (x *WhoAmI_Capability) GetRole() *v11.Role

func (*WhoAmI_Capability) ProtoMessage

func (*WhoAmI_Capability) ProtoMessage()

func (*WhoAmI_Capability) ProtoReflect

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

func (*WhoAmI_Capability) Reset

func (x *WhoAmI_Capability) Reset()

func (*WhoAmI_Capability) String

func (x *WhoAmI_Capability) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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