Documentation ¶
Overview ¶
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 GetHeadlessSessionRequest
- func (*GetHeadlessSessionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetHeadlessSessionRequest) GetCode() string
- func (*GetHeadlessSessionRequest) ProtoMessage()
- func (x *GetHeadlessSessionRequest) ProtoReflect() protoreflect.Message
- func (x *GetHeadlessSessionRequest) Reset()
- func (x *GetHeadlessSessionRequest) String() string
- type HeadlessSession
- func (*HeadlessSession) Descriptor() ([]byte, []int)deprecated
- func (x *HeadlessSession) GetEcdhPublicKey() []byte
- func (x *HeadlessSession) GetEncryptedIdtoken() []byte
- func (*HeadlessSession) ProtoMessage()
- func (x *HeadlessSession) ProtoReflect() protoreflect.Message
- func (x *HeadlessSession) Reset()
- func (x *HeadlessSession) String() string
- type RegistrationRequest
- func (*RegistrationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegistrationRequest) GetCode() string
- 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
- func (UnimplementedAuthServer) GetHeadlessSession(context.Context, *GetHeadlessSessionRequest) (*HeadlessSession, error)
- func (UnimplementedAuthServer) Register(context.Context, *RegistrationRequest) (*Session, error)
- func (UnimplementedAuthServer) Validate(context.Context, *emptypb.Empty) (*WhoAmI, error)
- 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() *v1.Group
- func (x *WhoAmI_Capability) GetRole() *v1.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" Auth_GetHeadlessSession_FullMethodName = "/chainguard.platform.auth.Auth/GetHeadlessSession" )
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, }, { MethodName: "GetHeadlessSession", Handler: _Auth_GetHeadlessSession_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. This client ignores the HTTP middlewares.
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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
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) GetHeadlessSession(ctx context.Context, in *GetHeadlessSessionRequest, opts ...grpc.CallOption) (*HeadlessSession, 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) GetHeadlessSession(context.Context, *GetHeadlessSessionRequest) (*HeadlessSession, error) // contains filtered or unexported methods }
AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility.
type GetHeadlessSessionRequest ¶ added in v0.1.25
type GetHeadlessSessionRequest struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*GetHeadlessSessionRequest) Descriptor
deprecated
added in
v0.1.25
func (*GetHeadlessSessionRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetHeadlessSessionRequest.ProtoReflect.Descriptor instead.
func (*GetHeadlessSessionRequest) GetCode ¶ added in v0.1.25
func (x *GetHeadlessSessionRequest) GetCode() string
func (*GetHeadlessSessionRequest) ProtoMessage ¶ added in v0.1.25
func (*GetHeadlessSessionRequest) ProtoMessage()
func (*GetHeadlessSessionRequest) ProtoReflect ¶ added in v0.1.25
func (x *GetHeadlessSessionRequest) ProtoReflect() protoreflect.Message
func (*GetHeadlessSessionRequest) Reset ¶ added in v0.1.25
func (x *GetHeadlessSessionRequest) Reset()
func (*GetHeadlessSessionRequest) String ¶ added in v0.1.25
func (x *GetHeadlessSessionRequest) String() string
type HeadlessSession ¶ added in v0.1.25
type HeadlessSession struct { // When establishing a headless session, the client must first provide // their ECDH public key. The server will then generate an ephemeral // ECHD keypair and use the client's public key to establish a symmetric // key. // // This symmetric key will be used to encrypt the idtoken and stored the // encrypted idtoken in the database for a short period, as well as // returning it to the client. // // After the idtoken is encrypted, the server will discard both the shared // symmetric key and the ephemeral ECDH private key. The server ECDH will // be sent back to the client. // // The client, with their private key, can use this public key to // establish the same symmetric key, which can be used to decrypt // the idtoken. // // echd_public_key is the client's ECDH public key. EcdhPublicKey []byte `protobuf:"bytes,1,opt,name=ecdh_public_key,json=ecdhPublicKey,proto3" json:"ecdh_public_key,omitempty"` // encrypted_idtoken is the encrypted idtoken. EncryptedIdtoken []byte `protobuf:"bytes,2,opt,name=encrypted_idtoken,json=encryptedIdtoken,proto3" json:"encrypted_idtoken,omitempty"` // contains filtered or unexported fields }
func (*HeadlessSession) Descriptor
deprecated
added in
v0.1.25
func (*HeadlessSession) Descriptor() ([]byte, []int)
Deprecated: Use HeadlessSession.ProtoReflect.Descriptor instead.
func (*HeadlessSession) GetEcdhPublicKey ¶ added in v0.1.25
func (x *HeadlessSession) GetEcdhPublicKey() []byte
func (*HeadlessSession) GetEncryptedIdtoken ¶ added in v0.1.25
func (x *HeadlessSession) GetEncryptedIdtoken() []byte
func (*HeadlessSession) ProtoMessage ¶ added in v0.1.25
func (*HeadlessSession) ProtoMessage()
func (*HeadlessSession) ProtoReflect ¶ added in v0.1.25
func (x *HeadlessSession) ProtoReflect() protoreflect.Message
func (*HeadlessSession) Reset ¶ added in v0.1.25
func (x *HeadlessSession) Reset()
func (*HeadlessSession) String ¶ added in v0.1.25
func (x *HeadlessSession) String() string
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"` // 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"` // contains filtered or unexported fields }
func (*RegistrationRequest) Descriptor
deprecated
func (*RegistrationRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegistrationRequest.ProtoReflect.Descriptor instead.
func (*RegistrationRequest) GetCode ¶
func (x *RegistrationRequest) GetCode() string
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.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAuthServer) GetHeadlessSession ¶ added in v0.1.25
func (UnimplementedAuthServer) GetHeadlessSession(context.Context, *GetHeadlessSessionRequest) (*HeadlessSession, error)
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 *v1.Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` // role of the bound identity. Role *v1.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() *v1.Group
func (*WhoAmI_Capability) GetRole ¶
func (x *WhoAmI_Capability) GetRole() *v1.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