Documentation
¶
Index ¶
- Variables
- func RegisterTokensServer(s grpc.ServiceRegistrar, srv TokensServer)
- type InvalidateRequest
- func (*InvalidateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *InvalidateRequest) GetCurrent() bool
- func (x *InvalidateRequest) GetID() *session.ID
- func (m *InvalidateRequest) GetKind() isInvalidateRequest_Kind
- func (*InvalidateRequest) ProtoMessage()
- func (x *InvalidateRequest) ProtoReflect() protoreflect.Message
- func (x *InvalidateRequest) Reset()
- func (x *InvalidateRequest) String() string
- type InvalidateRequest_Current
- type InvalidateRequest_ID
- type IssueRequest
- type IssueResponse
- func (*IssueResponse) Descriptor() ([]byte, []int)deprecated
- func (x *IssueResponse) GetIssued() *session.Session
- func (x *IssueResponse) GetToken() *Token
- func (*IssueResponse) ProtoMessage()
- func (x *IssueResponse) ProtoReflect() protoreflect.Message
- func (x *IssueResponse) Reset()
- func (x *IssueResponse) String() string
- type LoadRequest
- func (*LoadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoadRequest) GetID() *session.ID
- func (m *LoadRequest) GetKind() isLoadRequest_Kind
- func (x *LoadRequest) GetName() string
- func (*LoadRequest) ProtoMessage()
- func (x *LoadRequest) ProtoReflect() protoreflect.Message
- func (x *LoadRequest) Reset()
- func (x *LoadRequest) String() string
- type LoadRequest_ID
- type LoadRequest_Name
- type Token
- type TokensClient
- type TokensServer
- type Tokens_FindClient
- type Tokens_FindServer
- type UnimplementedTokensServer
- func (UnimplementedTokensServer) Current(context.Context, *emptypb.Empty) (*session.Session, error)
- func (UnimplementedTokensServer) Find(*session.Scope, Tokens_FindServer) error
- func (UnimplementedTokensServer) Invalidate(context.Context, *InvalidateRequest) (*emptypb.Empty, error)
- func (UnimplementedTokensServer) Issue(context.Context, *IssueRequest) (*IssueResponse, error)
- func (UnimplementedTokensServer) Load(context.Context, *LoadRequest) (*session.Session, error)
- func (UnimplementedTokensServer) Refresh(context.Context, *emptypb.Empty) (*IssueResponse, error)
- func (UnimplementedTokensServer) Validate(context.Context, *Token) (*session.Session, error)
- type UnsafeTokensServer
Constants ¶
This section is empty.
Variables ¶
var File_token_proto protoreflect.FileDescriptor
Functions ¶
func RegisterTokensServer ¶
func RegisterTokensServer(s grpc.ServiceRegistrar, srv TokensServer)
Types ¶
type InvalidateRequest ¶
type InvalidateRequest struct { // Types that are assignable to Kind: // *InvalidateRequest_ID // *InvalidateRequest_Current Kind isInvalidateRequest_Kind `protobuf_oneof:"Kind"` // contains filtered or unexported fields }
func (*InvalidateRequest) Descriptor
deprecated
func (*InvalidateRequest) Descriptor() ([]byte, []int)
Deprecated: Use InvalidateRequest.ProtoReflect.Descriptor instead.
func (*InvalidateRequest) GetCurrent ¶
func (x *InvalidateRequest) GetCurrent() bool
func (*InvalidateRequest) GetID ¶
func (x *InvalidateRequest) GetID() *session.ID
func (*InvalidateRequest) GetKind ¶
func (m *InvalidateRequest) GetKind() isInvalidateRequest_Kind
func (*InvalidateRequest) ProtoMessage ¶
func (*InvalidateRequest) ProtoMessage()
func (*InvalidateRequest) ProtoReflect ¶
func (x *InvalidateRequest) ProtoReflect() protoreflect.Message
func (*InvalidateRequest) Reset ¶
func (x *InvalidateRequest) Reset()
func (*InvalidateRequest) String ¶
func (x *InvalidateRequest) String() string
type InvalidateRequest_Current ¶
type InvalidateRequest_Current struct { // Invalidate the current session (i.e. log out). Current bool `protobuf:"varint,2,opt,name=current,proto3,oneof"` }
type InvalidateRequest_ID ¶
type IssueRequest ¶
type IssueRequest struct { // The template field describes a session to be issued. The template // must describe a subset of the caller's delegable capabilities // and on a sub-scope of the caller's current scope. Template *session.Session `protobuf:"bytes,1,opt,name=template,proto3" json:"template,omitempty"` // contains filtered or unexported fields }
func (*IssueRequest) Descriptor
deprecated
func (*IssueRequest) Descriptor() ([]byte, []int)
Deprecated: Use IssueRequest.ProtoReflect.Descriptor instead.
func (*IssueRequest) GetTemplate ¶
func (x *IssueRequest) GetTemplate() *session.Session
func (*IssueRequest) ProtoMessage ¶
func (*IssueRequest) ProtoMessage()
func (*IssueRequest) ProtoReflect ¶
func (x *IssueRequest) ProtoReflect() protoreflect.Message
func (*IssueRequest) Reset ¶
func (x *IssueRequest) Reset()
func (*IssueRequest) String ¶
func (x *IssueRequest) String() string
type IssueResponse ¶
type IssueResponse struct { Issued *session.Session `protobuf:"bytes,1,opt,name=issued,proto3" json:"issued,omitempty"` Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*IssueResponse) Descriptor
deprecated
func (*IssueResponse) Descriptor() ([]byte, []int)
Deprecated: Use IssueResponse.ProtoReflect.Descriptor instead.
func (*IssueResponse) GetIssued ¶
func (x *IssueResponse) GetIssued() *session.Session
func (*IssueResponse) GetToken ¶
func (x *IssueResponse) GetToken() *Token
func (*IssueResponse) ProtoMessage ¶
func (*IssueResponse) ProtoMessage()
func (*IssueResponse) ProtoReflect ¶
func (x *IssueResponse) ProtoReflect() protoreflect.Message
func (*IssueResponse) Reset ¶
func (x *IssueResponse) Reset()
func (*IssueResponse) String ¶
func (x *IssueResponse) String() string
type LoadRequest ¶
type LoadRequest struct { // Types that are assignable to Kind: // *LoadRequest_ID // *LoadRequest_Name Kind isLoadRequest_Kind `protobuf_oneof:"Kind"` // contains filtered or unexported fields }
func (*LoadRequest) Descriptor
deprecated
func (*LoadRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead.
func (*LoadRequest) GetID ¶
func (x *LoadRequest) GetID() *session.ID
func (*LoadRequest) GetKind ¶
func (m *LoadRequest) GetKind() isLoadRequest_Kind
func (*LoadRequest) GetName ¶
func (x *LoadRequest) GetName() string
func (*LoadRequest) ProtoMessage ¶
func (*LoadRequest) ProtoMessage()
func (*LoadRequest) ProtoReflect ¶
func (x *LoadRequest) ProtoReflect() protoreflect.Message
func (*LoadRequest) Reset ¶
func (x *LoadRequest) Reset()
func (*LoadRequest) String ¶
func (x *LoadRequest) String() string
type LoadRequest_ID ¶
type LoadRequest_Name ¶
type LoadRequest_Name struct { // Load a named session owned by the requesting principal. Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"` }
type Token ¶
type Token struct { // A signed JWT claim. Jwt string `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"` // contains filtered or unexported fields }
A token is an encoded access token.
func (*Token) Descriptor
deprecated
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type TokensClient ¶
type TokensClient interface { // Current returns the Session associated with the current request. // This can be used to determine the current principal and scope // of access. Current(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*session.Session, error) // Issue creates an encoded token described by the session template. Issue(ctx context.Context, in *IssueRequest, opts ...grpc.CallOption) (*IssueResponse, error) // Find returns all valid sessions that are accessible by the // principal associated with the current request, using the provided // Scope as a filter. Find(ctx context.Context, in *session.Scope, opts ...grpc.CallOption) (Tokens_FindClient, error) // Load retrieves the given session. Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*session.Session, error) // Invalidate destroys an active token. Invalidate(ctx context.Context, in *InvalidateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Refresh invalidates the access token associated with the current // request and returns a refreshed token and session. Refresh(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*IssueResponse, error) // Validate returns the currently-valid session associated with the token. Validate(ctx context.Context, in *Token, opts ...grpc.CallOption) (*session.Session, error) }
TokensClient is the client API for Tokens 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 NewTokensClient ¶
func NewTokensClient(cc grpc.ClientConnInterface) TokensClient
type TokensServer ¶
type TokensServer interface { // Current returns the Session associated with the current request. // This can be used to determine the current principal and scope // of access. Current(context.Context, *emptypb.Empty) (*session.Session, error) // Issue creates an encoded token described by the session template. Issue(context.Context, *IssueRequest) (*IssueResponse, error) // Find returns all valid sessions that are accessible by the // principal associated with the current request, using the provided // Scope as a filter. Find(*session.Scope, Tokens_FindServer) error // Load retrieves the given session. Load(context.Context, *LoadRequest) (*session.Session, error) // Invalidate destroys an active token. Invalidate(context.Context, *InvalidateRequest) (*emptypb.Empty, error) // Refresh invalidates the access token associated with the current // request and returns a refreshed token and session. Refresh(context.Context, *emptypb.Empty) (*IssueResponse, error) // Validate returns the currently-valid session associated with the token. Validate(context.Context, *Token) (*session.Session, error) // contains filtered or unexported methods }
TokensServer is the server API for Tokens service. All implementations must embed UnimplementedTokensServer for forward compatibility
type Tokens_FindClient ¶
type Tokens_FindClient interface { Recv() (*session.Session, error) grpc.ClientStream }
type Tokens_FindServer ¶
type Tokens_FindServer interface { Send(*session.Session) error grpc.ServerStream }
type UnimplementedTokensServer ¶
type UnimplementedTokensServer struct { }
UnimplementedTokensServer must be embedded to have forward compatible implementations.
func (UnimplementedTokensServer) Find ¶
func (UnimplementedTokensServer) Find(*session.Scope, Tokens_FindServer) error
func (UnimplementedTokensServer) Invalidate ¶
func (UnimplementedTokensServer) Invalidate(context.Context, *InvalidateRequest) (*emptypb.Empty, error)
func (UnimplementedTokensServer) Issue ¶
func (UnimplementedTokensServer) Issue(context.Context, *IssueRequest) (*IssueResponse, error)
func (UnimplementedTokensServer) Load ¶
func (UnimplementedTokensServer) Load(context.Context, *LoadRequest) (*session.Session, error)
func (UnimplementedTokensServer) Refresh ¶
func (UnimplementedTokensServer) Refresh(context.Context, *emptypb.Empty) (*IssueResponse, error)
type UnsafeTokensServer ¶
type UnsafeTokensServer interface {
// contains filtered or unexported methods
}
UnsafeTokensServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokensServer will result in compilation errors.