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
- Variables
- func RegisterAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthClient) error
- func RegisterAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServer) error
- func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
- type AuthClient
- type AuthServer
- type RegistrationRequest
- func (*RegistrationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegistrationRequest) GetClusterDescription() string
- func (x *RegistrationRequest) GetClusterId() string
- func (x *RegistrationRequest) GetClusterName() string
- func (x *RegistrationRequest) GetCode() string
- func (x *RegistrationRequest) GetEnforcerOptions() *v1.Cluster_EnforcerOptions
- func (x *RegistrationRequest) GetIdentityId() string
- func (*RegistrationRequest) ProtoMessage()
- func (x *RegistrationRequest) ProtoReflect() protoreflect.Message
- func (x *RegistrationRequest) Reset()
- func (x *RegistrationRequest) String() string
- type Session
- func (x *Session) CloudEventsExtension(key string) (string, bool)
- func (x *Session) CloudEventsSubject() string
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetGroup() string
- func (x *Session) GetIdentity() string
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type UnimplementedAuthServer
- type UnsafeAuthServer
- type WhoAmI
- func (*WhoAmI) Descriptor() ([]byte, []int)deprecated
- func (x *WhoAmI) GetAudience() []string
- func (x *WhoAmI) GetCapabilities() []*WhoAmI_Capability
- func (x *WhoAmI) GetEmail() string
- func (x *WhoAmI) GetExpiry() *timestamppb.Timestamp
- func (x *WhoAmI) GetIssuedAt() *timestamppb.Timestamp
- func (x *WhoAmI) GetIssuer() string
- func (x *WhoAmI) GetSubject() string
- func (*WhoAmI) ProtoMessage()
- func (x *WhoAmI) ProtoReflect() protoreflect.Message
- func (x *WhoAmI) Reset()
- func (x *WhoAmI) String() string
- type WhoAmI_Capability
- func (*WhoAmI_Capability) Descriptor() ([]byte, []int)deprecated
- func (x *WhoAmI_Capability) GetGroup() *v11.Group
- func (x *WhoAmI_Capability) GetRole() *v11.Role
- func (*WhoAmI_Capability) ProtoMessage()
- func (x *WhoAmI_Capability) ProtoReflect() protoreflect.Message
- func (x *WhoAmI_Capability) Reset()
- func (x *WhoAmI_Capability) String() string
Constants ¶
const ( Auth_Validate_FullMethodName = "/chainguard.platform.auth.Auth/Validate" Auth_Register_FullMethodName = "/chainguard.platform.auth.Auth/Register" )
Variables ¶
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)
var File_auth_platform_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthHandler ¶
RegisterAuthHandler registers the http handlers for service Auth to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthHandlerClient ¶
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 ¶
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 ¶
CloudEventsExtension implements chainguard.dev/sdk/events/Extendable.CloudEventsExtension
func (*Session) CloudEventsSubject ¶
CloudEventsSubject implements chainguard.dev/sdk/events/Eventable.CloudEventsSubject.
func (*Session) Descriptor
deprecated
func (*Session) GetIdentity ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type UnimplementedAuthServer ¶
type UnimplementedAuthServer struct { }
UnimplementedAuthServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServer) Register ¶
func (UnimplementedAuthServer) Register(context.Context, *RegistrationRequest) (*Session, error)
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) GetAudience ¶
func (*WhoAmI) GetCapabilities ¶
func (x *WhoAmI) GetCapabilities() []*WhoAmI_Capability
func (*WhoAmI) GetExpiry ¶
func (x *WhoAmI) GetExpiry() *timestamppb.Timestamp
func (*WhoAmI) GetIssuedAt ¶
func (x *WhoAmI) GetIssuedAt() *timestamppb.Timestamp
func (*WhoAmI) GetSubject ¶
func (*WhoAmI) ProtoMessage ¶
func (*WhoAmI) ProtoMessage()
func (*WhoAmI) ProtoReflect ¶
func (x *WhoAmI) ProtoReflect() protoreflect.Message
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