Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
- type AuthServiceClient
- type AuthServiceServer
- type GenerateAuthChallengeRequest
- func (*GenerateAuthChallengeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateAuthChallengeRequest) GetPubkey() []byte
- func (x *GenerateAuthChallengeRequest) GetRole() Role
- func (*GenerateAuthChallengeRequest) ProtoMessage()
- func (x *GenerateAuthChallengeRequest) ProtoReflect() protoreflect.Message
- func (x *GenerateAuthChallengeRequest) Reset()
- func (x *GenerateAuthChallengeRequest) String() string
- type GenerateAuthChallengeResponse
- func (*GenerateAuthChallengeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateAuthChallengeResponse) GetChallenge() string
- func (*GenerateAuthChallengeResponse) ProtoMessage()
- func (x *GenerateAuthChallengeResponse) ProtoReflect() protoreflect.Message
- func (x *GenerateAuthChallengeResponse) Reset()
- func (x *GenerateAuthChallengeResponse) String() string
- type GenerateAuthTokensRequest
- func (*GenerateAuthTokensRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateAuthTokensRequest) GetChallenge() string
- func (x *GenerateAuthTokensRequest) GetClientPubkey() []byte
- func (x *GenerateAuthTokensRequest) GetSignedChallenge() []byte
- func (*GenerateAuthTokensRequest) ProtoMessage()
- func (x *GenerateAuthTokensRequest) ProtoReflect() protoreflect.Message
- func (x *GenerateAuthTokensRequest) Reset()
- func (x *GenerateAuthTokensRequest) String() string
- type GenerateAuthTokensResponse
- func (*GenerateAuthTokensResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GenerateAuthTokensResponse) GetAccessToken() *Token
- func (x *GenerateAuthTokensResponse) GetRefreshToken() *Token
- func (*GenerateAuthTokensResponse) ProtoMessage()
- func (x *GenerateAuthTokensResponse) ProtoReflect() protoreflect.Message
- func (x *GenerateAuthTokensResponse) Reset()
- func (x *GenerateAuthTokensResponse) String() string
- type RefreshAccessTokenRequest
- func (*RefreshAccessTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshAccessTokenRequest) GetRefreshToken() string
- func (*RefreshAccessTokenRequest) ProtoMessage()
- func (x *RefreshAccessTokenRequest) ProtoReflect() protoreflect.Message
- func (x *RefreshAccessTokenRequest) Reset()
- func (x *RefreshAccessTokenRequest) String() string
- type RefreshAccessTokenResponse
- func (*RefreshAccessTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshAccessTokenResponse) GetAccessToken() *Token
- func (*RefreshAccessTokenResponse) ProtoMessage()
- func (x *RefreshAccessTokenResponse) ProtoReflect() protoreflect.Message
- func (x *RefreshAccessTokenResponse) Reset()
- func (x *RefreshAccessTokenResponse) String() string
- type Role
- type Token
- type UnimplementedAuthServiceServer
- func (UnimplementedAuthServiceServer) GenerateAuthChallenge(context.Context, *GenerateAuthChallengeRequest) (*GenerateAuthChallengeResponse, error)
- func (UnimplementedAuthServiceServer) GenerateAuthTokens(context.Context, *GenerateAuthTokensRequest) (*GenerateAuthTokensResponse, error)
- func (UnimplementedAuthServiceServer) RefreshAccessToken(context.Context, *RefreshAccessTokenRequest) (*RefreshAccessTokenResponse, error)
- type UnsafeAuthServiceServer
Constants ¶
const ( AuthService_GenerateAuthChallenge_FullMethodName = "/auth.AuthService/GenerateAuthChallenge" AuthService_GenerateAuthTokens_FullMethodName = "/auth.AuthService/GenerateAuthTokens" AuthService_RefreshAccessToken_FullMethodName = "/auth.AuthService/RefreshAccessToken" )
Variables ¶
var ( Role_name = map[int32]string{ 0: "RELAYER", 1: "SEARCHER", 2: "VALIDATOR", 3: "SHREDSTREAM_SUBSCRIBER", } Role_value = map[string]int32{ "RELAYER": 0, "SEARCHER": 1, "VALIDATOR": 2, "SHREDSTREAM_SUBSCRIBER": 3, } )
Enum value maps for Role.
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GenerateAuthChallenge", Handler: _AuthService_GenerateAuthChallenge_Handler, }, { MethodName: "GenerateAuthTokens", Handler: _AuthService_GenerateAuthTokens_Handler, }, { MethodName: "RefreshAccessToken", Handler: _AuthService_RefreshAccessToken_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService 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_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthServiceServer ¶
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
Types ¶
type AuthServiceClient ¶
type AuthServiceClient interface { // / Returns a challenge, client is expected to sign this challenge with an appropriate keypair in order to obtain access tokens. GenerateAuthChallenge(ctx context.Context, in *GenerateAuthChallengeRequest, opts ...grpc.CallOption) (*GenerateAuthChallengeResponse, error) // / Provides the client with the initial pair of auth tokens for API access. GenerateAuthTokens(ctx context.Context, in *GenerateAuthTokensRequest, opts ...grpc.CallOption) (*GenerateAuthTokensResponse, error) // / Call this method with a non-expired refresh token to obtain a new access token. RefreshAccessToken(ctx context.Context, in *RefreshAccessTokenRequest, opts ...grpc.CallOption) (*RefreshAccessTokenResponse, error) }
AuthServiceClient is the client API for AuthService 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.
/ This service is responsible for issuing auth tokens to clients for API access.
func NewAuthServiceClient ¶
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient
type AuthServiceServer ¶
type AuthServiceServer interface { // / Returns a challenge, client is expected to sign this challenge with an appropriate keypair in order to obtain access tokens. GenerateAuthChallenge(context.Context, *GenerateAuthChallengeRequest) (*GenerateAuthChallengeResponse, error) // / Provides the client with the initial pair of auth tokens for API access. GenerateAuthTokens(context.Context, *GenerateAuthTokensRequest) (*GenerateAuthTokensResponse, error) // / Call this method with a non-expired refresh token to obtain a new access token. RefreshAccessToken(context.Context, *RefreshAccessTokenRequest) (*RefreshAccessTokenResponse, error) // contains filtered or unexported methods }
AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility.
/ This service is responsible for issuing auth tokens to clients for API access.
type GenerateAuthChallengeRequest ¶
type GenerateAuthChallengeRequest struct { // / Role the client is attempting to generate tokens for. Role Role `protobuf:"varint,1,opt,name=role,proto3,enum=auth.Role" json:"role,omitempty"` // / Client's 32 byte pubkey. Pubkey []byte `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` // contains filtered or unexported fields }
func (*GenerateAuthChallengeRequest) Descriptor
deprecated
func (*GenerateAuthChallengeRequest) Descriptor() ([]byte, []int)
Deprecated: Use GenerateAuthChallengeRequest.ProtoReflect.Descriptor instead.
func (*GenerateAuthChallengeRequest) GetPubkey ¶
func (x *GenerateAuthChallengeRequest) GetPubkey() []byte
func (*GenerateAuthChallengeRequest) GetRole ¶
func (x *GenerateAuthChallengeRequest) GetRole() Role
func (*GenerateAuthChallengeRequest) ProtoMessage ¶
func (*GenerateAuthChallengeRequest) ProtoMessage()
func (*GenerateAuthChallengeRequest) ProtoReflect ¶
func (x *GenerateAuthChallengeRequest) ProtoReflect() protoreflect.Message
func (*GenerateAuthChallengeRequest) Reset ¶
func (x *GenerateAuthChallengeRequest) Reset()
func (*GenerateAuthChallengeRequest) String ¶
func (x *GenerateAuthChallengeRequest) String() string
type GenerateAuthChallengeResponse ¶
type GenerateAuthChallengeResponse struct { Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` // contains filtered or unexported fields }
func (*GenerateAuthChallengeResponse) Descriptor
deprecated
func (*GenerateAuthChallengeResponse) Descriptor() ([]byte, []int)
Deprecated: Use GenerateAuthChallengeResponse.ProtoReflect.Descriptor instead.
func (*GenerateAuthChallengeResponse) GetChallenge ¶
func (x *GenerateAuthChallengeResponse) GetChallenge() string
func (*GenerateAuthChallengeResponse) ProtoMessage ¶
func (*GenerateAuthChallengeResponse) ProtoMessage()
func (*GenerateAuthChallengeResponse) ProtoReflect ¶
func (x *GenerateAuthChallengeResponse) ProtoReflect() protoreflect.Message
func (*GenerateAuthChallengeResponse) Reset ¶
func (x *GenerateAuthChallengeResponse) Reset()
func (*GenerateAuthChallengeResponse) String ¶
func (x *GenerateAuthChallengeResponse) String() string
type GenerateAuthTokensRequest ¶
type GenerateAuthTokensRequest struct { // / The pre-signed challenge. Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` // / The signing keypair's corresponding 32 byte pubkey. ClientPubkey []byte `protobuf:"bytes,2,opt,name=client_pubkey,json=clientPubkey,proto3" json:"client_pubkey,omitempty"` // / The 64 byte signature of the challenge signed by the client's private key. The private key must correspond to // the pubkey passed in the [GenerateAuthChallenge] method. The client is expected to sign the challenge token // prepended with their pubkey. For example sign(pubkey, challenge). SignedChallenge []byte `protobuf:"bytes,3,opt,name=signed_challenge,json=signedChallenge,proto3" json:"signed_challenge,omitempty"` // contains filtered or unexported fields }
func (*GenerateAuthTokensRequest) Descriptor
deprecated
func (*GenerateAuthTokensRequest) Descriptor() ([]byte, []int)
Deprecated: Use GenerateAuthTokensRequest.ProtoReflect.Descriptor instead.
func (*GenerateAuthTokensRequest) GetChallenge ¶
func (x *GenerateAuthTokensRequest) GetChallenge() string
func (*GenerateAuthTokensRequest) GetClientPubkey ¶
func (x *GenerateAuthTokensRequest) GetClientPubkey() []byte
func (*GenerateAuthTokensRequest) GetSignedChallenge ¶
func (x *GenerateAuthTokensRequest) GetSignedChallenge() []byte
func (*GenerateAuthTokensRequest) ProtoMessage ¶
func (*GenerateAuthTokensRequest) ProtoMessage()
func (*GenerateAuthTokensRequest) ProtoReflect ¶
func (x *GenerateAuthTokensRequest) ProtoReflect() protoreflect.Message
func (*GenerateAuthTokensRequest) Reset ¶
func (x *GenerateAuthTokensRequest) Reset()
func (*GenerateAuthTokensRequest) String ¶
func (x *GenerateAuthTokensRequest) String() string
type GenerateAuthTokensResponse ¶
type GenerateAuthTokensResponse struct { // / The token granting access to resources. AccessToken *Token `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // / The token used to refresh the access_token. This has a longer TTL than the access_token. RefreshToken *Token `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func (*GenerateAuthTokensResponse) Descriptor
deprecated
func (*GenerateAuthTokensResponse) Descriptor() ([]byte, []int)
Deprecated: Use GenerateAuthTokensResponse.ProtoReflect.Descriptor instead.
func (*GenerateAuthTokensResponse) GetAccessToken ¶
func (x *GenerateAuthTokensResponse) GetAccessToken() *Token
func (*GenerateAuthTokensResponse) GetRefreshToken ¶
func (x *GenerateAuthTokensResponse) GetRefreshToken() *Token
func (*GenerateAuthTokensResponse) ProtoMessage ¶
func (*GenerateAuthTokensResponse) ProtoMessage()
func (*GenerateAuthTokensResponse) ProtoReflect ¶
func (x *GenerateAuthTokensResponse) ProtoReflect() protoreflect.Message
func (*GenerateAuthTokensResponse) Reset ¶
func (x *GenerateAuthTokensResponse) Reset()
func (*GenerateAuthTokensResponse) String ¶
func (x *GenerateAuthTokensResponse) String() string
type RefreshAccessTokenRequest ¶
type RefreshAccessTokenRequest struct { // / Non-expired refresh token obtained from the [GenerateAuthTokens] method. RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` // contains filtered or unexported fields }
func (*RefreshAccessTokenRequest) Descriptor
deprecated
func (*RefreshAccessTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RefreshAccessTokenRequest.ProtoReflect.Descriptor instead.
func (*RefreshAccessTokenRequest) GetRefreshToken ¶
func (x *RefreshAccessTokenRequest) GetRefreshToken() string
func (*RefreshAccessTokenRequest) ProtoMessage ¶
func (*RefreshAccessTokenRequest) ProtoMessage()
func (*RefreshAccessTokenRequest) ProtoReflect ¶
func (x *RefreshAccessTokenRequest) ProtoReflect() protoreflect.Message
func (*RefreshAccessTokenRequest) Reset ¶
func (x *RefreshAccessTokenRequest) Reset()
func (*RefreshAccessTokenRequest) String ¶
func (x *RefreshAccessTokenRequest) String() string
type RefreshAccessTokenResponse ¶
type RefreshAccessTokenResponse struct { // / Fresh access_token. AccessToken *Token `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // contains filtered or unexported fields }
func (*RefreshAccessTokenResponse) Descriptor
deprecated
func (*RefreshAccessTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use RefreshAccessTokenResponse.ProtoReflect.Descriptor instead.
func (*RefreshAccessTokenResponse) GetAccessToken ¶
func (x *RefreshAccessTokenResponse) GetAccessToken() *Token
func (*RefreshAccessTokenResponse) ProtoMessage ¶
func (*RefreshAccessTokenResponse) ProtoMessage()
func (*RefreshAccessTokenResponse) ProtoReflect ¶
func (x *RefreshAccessTokenResponse) ProtoReflect() protoreflect.Message
func (*RefreshAccessTokenResponse) Reset ¶
func (x *RefreshAccessTokenResponse) Reset()
func (*RefreshAccessTokenResponse) String ¶
func (x *RefreshAccessTokenResponse) String() string
type Role ¶
type Role int32
func (Role) Descriptor ¶
func (Role) Descriptor() protoreflect.EnumDescriptor
func (Role) EnumDescriptor
deprecated
func (Role) Number ¶
func (x Role) Number() protoreflect.EnumNumber
func (Role) Type ¶
func (Role) Type() protoreflect.EnumType
type Token ¶
type Token struct { // / The token. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // / When the token will expire. ExpiresAtUtc *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at_utc,json=expiresAtUtc,proto3" json:"expires_at_utc,omitempty"` // contains filtered or unexported fields }
func (*Token) Descriptor
deprecated
func (*Token) GetExpiresAtUtc ¶
func (x *Token) GetExpiresAtUtc() *timestamppb.Timestamp
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct{}
UnimplementedAuthServiceServer 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 (UnimplementedAuthServiceServer) GenerateAuthChallenge ¶
func (UnimplementedAuthServiceServer) GenerateAuthChallenge(context.Context, *GenerateAuthChallengeRequest) (*GenerateAuthChallengeResponse, error)
func (UnimplementedAuthServiceServer) GenerateAuthTokens ¶
func (UnimplementedAuthServiceServer) GenerateAuthTokens(context.Context, *GenerateAuthTokensRequest) (*GenerateAuthTokensResponse, error)
func (UnimplementedAuthServiceServer) RefreshAccessToken ¶
func (UnimplementedAuthServiceServer) RefreshAccessToken(context.Context, *RefreshAccessTokenRequest) (*RefreshAccessTokenResponse, error)
type UnsafeAuthServiceServer ¶
type UnsafeAuthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServiceServer will result in compilation errors.