pb

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Auth_GetChallenge_FullMethodName        = "/pb.Auth/GetChallenge"
	Auth_AuthenticateAccount_FullMethodName = "/pb.Auth/AuthenticateAccount"
	Auth_VerifyAccessToken_FullMethodName   = "/pb.Auth/VerifyAccessToken"
	Auth_RefreshAccessToken_FullMethodName  = "/pb.Auth/RefreshAccessToken"
	Auth_RevokeRefreshTokens_FullMethodName = "/pb.Auth/RevokeRefreshTokens"
)

Variables

View Source
var (
	AccessTokenPayload_Role_name = map[int32]string{
		0: "UNKNOWN",
		1: "GAMER",
		2: "ADMIN",
	}
	AccessTokenPayload_Role_value = map[string]int32{
		"UNKNOWN": 0,
		"GAMER":   1,
		"ADMIN":   2,
	}
)

Enum value maps for AccessTokenPayload_Role.

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetChallenge",
			Handler:    _Auth_GetChallenge_Handler,
		},
		{
			MethodName: "AuthenticateAccount",
			Handler:    _Auth_AuthenticateAccount_Handler,
		},
		{
			MethodName: "VerifyAccessToken",
			Handler:    _Auth_VerifyAccessToken_Handler,
		},
		{
			MethodName: "RefreshAccessToken",
			Handler:    _Auth_RefreshAccessToken_Handler,
		},
		{
			MethodName: "RevokeRefreshTokens",
			Handler:    _Auth_RevokeRefreshTokens_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service_auth.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_access_token_payload_proto protoreflect.FileDescriptor
View Source
var File_account_proto protoreflect.FileDescriptor
View Source
var File_rpc_authenticate_account_proto protoreflect.FileDescriptor
View Source
var File_rpc_get_challenge_proto protoreflect.FileDescriptor
View Source
var File_rpc_refresh_access_token_proto protoreflect.FileDescriptor
View Source
var File_rpc_revoke_refresh_tokens_proto protoreflect.FileDescriptor
View Source
var File_rpc_verify_access_token_proto protoreflect.FileDescriptor
View Source
var File_service_auth_proto protoreflect.FileDescriptor
View Source
var File_session_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 AccessTokenPayload

type AccessTokenPayload struct {
	Id            string                  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	WalletAddress string                  `protobuf:"bytes,2,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	Role          AccessTokenPayload_Role `protobuf:"varint,3,opt,name=role,proto3,enum=pb.AccessTokenPayload_Role" json:"role,omitempty"`
	IssuedAt      *timestamppb.Timestamp  `protobuf:"bytes,4,opt,name=issued_at,json=issuedAt,proto3" json:"issued_at,omitempty"`
	ExpiresAt     *timestamppb.Timestamp  `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

func (*AccessTokenPayload) Descriptor deprecated

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

Deprecated: Use AccessTokenPayload.ProtoReflect.Descriptor instead.

func (*AccessTokenPayload) GetExpiresAt

func (x *AccessTokenPayload) GetExpiresAt() *timestamppb.Timestamp

func (*AccessTokenPayload) GetId

func (x *AccessTokenPayload) GetId() string

func (*AccessTokenPayload) GetIssuedAt

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

func (*AccessTokenPayload) GetRole

func (*AccessTokenPayload) GetWalletAddress

func (x *AccessTokenPayload) GetWalletAddress() string

func (*AccessTokenPayload) ProtoMessage

func (*AccessTokenPayload) ProtoMessage()

func (*AccessTokenPayload) ProtoReflect

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

func (*AccessTokenPayload) Reset

func (x *AccessTokenPayload) Reset()

func (*AccessTokenPayload) String

func (x *AccessTokenPayload) String() string

type AccessTokenPayload_Role

type AccessTokenPayload_Role int32
const (
	AccessTokenPayload_UNKNOWN AccessTokenPayload_Role = 0
	AccessTokenPayload_GAMER   AccessTokenPayload_Role = 1
	AccessTokenPayload_ADMIN   AccessTokenPayload_Role = 2
)

func (AccessTokenPayload_Role) Descriptor

func (AccessTokenPayload_Role) Enum

func (AccessTokenPayload_Role) EnumDescriptor deprecated

func (AccessTokenPayload_Role) EnumDescriptor() ([]byte, []int)

Deprecated: Use AccessTokenPayload_Role.Descriptor instead.

func (AccessTokenPayload_Role) Number

func (AccessTokenPayload_Role) String

func (x AccessTokenPayload_Role) String() string

func (AccessTokenPayload_Role) Type

type Account

type Account struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Owner     string                 `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetCreatedAt

func (x *Account) GetCreatedAt() *timestamppb.Timestamp

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetOwner

func (x *Account) GetOwner() string

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type AuthClient

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

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

type AuthenticateAccountRequest

type AuthenticateAccountRequest struct {
	WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	Challenge     string `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"`
	Signature     string `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateAccountRequest) Descriptor deprecated

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

Deprecated: Use AuthenticateAccountRequest.ProtoReflect.Descriptor instead.

func (*AuthenticateAccountRequest) GetChallenge

func (x *AuthenticateAccountRequest) GetChallenge() string

func (*AuthenticateAccountRequest) GetSignature

func (x *AuthenticateAccountRequest) GetSignature() string

func (*AuthenticateAccountRequest) GetWalletAddress

func (x *AuthenticateAccountRequest) GetWalletAddress() string

func (*AuthenticateAccountRequest) ProtoMessage

func (*AuthenticateAccountRequest) ProtoMessage()

func (*AuthenticateAccountRequest) ProtoReflect

func (*AuthenticateAccountRequest) Reset

func (x *AuthenticateAccountRequest) Reset()

func (*AuthenticateAccountRequest) String

func (x *AuthenticateAccountRequest) String() string

type AuthenticateAccountResponse

type AuthenticateAccountResponse struct {
	Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthenticateAccountResponse) Descriptor deprecated

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

Deprecated: Use AuthenticateAccountResponse.ProtoReflect.Descriptor instead.

func (*AuthenticateAccountResponse) GetAccount

func (x *AuthenticateAccountResponse) GetAccount() *Account

func (*AuthenticateAccountResponse) GetSession

func (x *AuthenticateAccountResponse) GetSession() *Session

func (*AuthenticateAccountResponse) ProtoMessage

func (*AuthenticateAccountResponse) ProtoMessage()

func (*AuthenticateAccountResponse) ProtoReflect

func (*AuthenticateAccountResponse) Reset

func (x *AuthenticateAccountResponse) Reset()

func (*AuthenticateAccountResponse) String

func (x *AuthenticateAccountResponse) String() string

type GetChallengeRequest

type GetChallengeRequest struct {
	WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	// contains filtered or unexported fields
}

func (*GetChallengeRequest) Descriptor deprecated

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

Deprecated: Use GetChallengeRequest.ProtoReflect.Descriptor instead.

func (*GetChallengeRequest) GetWalletAddress

func (x *GetChallengeRequest) GetWalletAddress() string

func (*GetChallengeRequest) ProtoMessage

func (*GetChallengeRequest) ProtoMessage()

func (*GetChallengeRequest) ProtoReflect

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

func (*GetChallengeRequest) Reset

func (x *GetChallengeRequest) Reset()

func (*GetChallengeRequest) String

func (x *GetChallengeRequest) String() string

type GetChallengeResponse

type GetChallengeResponse struct {
	Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"`
	// contains filtered or unexported fields
}

func (*GetChallengeResponse) Descriptor deprecated

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

Deprecated: Use GetChallengeResponse.ProtoReflect.Descriptor instead.

func (*GetChallengeResponse) GetChallenge

func (x *GetChallengeResponse) GetChallenge() string

func (*GetChallengeResponse) ProtoMessage

func (*GetChallengeResponse) ProtoMessage()

func (*GetChallengeResponse) ProtoReflect

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

func (*GetChallengeResponse) Reset

func (x *GetChallengeResponse) Reset()

func (*GetChallengeResponse) String

func (x *GetChallengeResponse) String() string

type RefreshAccessTokenRequest

type RefreshAccessTokenRequest struct {
	WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshAccessTokenRequest) Descriptor deprecated

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

Deprecated: Use RefreshAccessTokenRequest.ProtoReflect.Descriptor instead.

func (*RefreshAccessTokenRequest) GetWalletAddress

func (x *RefreshAccessTokenRequest) GetWalletAddress() string

func (*RefreshAccessTokenRequest) ProtoMessage

func (*RefreshAccessTokenRequest) ProtoMessage()

func (*RefreshAccessTokenRequest) ProtoReflect

func (*RefreshAccessTokenRequest) Reset

func (x *RefreshAccessTokenRequest) Reset()

func (*RefreshAccessTokenRequest) String

func (x *RefreshAccessTokenRequest) String() string

type RefreshAccessTokenResponse

type RefreshAccessTokenResponse struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshAccessTokenResponse) Descriptor deprecated

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

Deprecated: Use RefreshAccessTokenResponse.ProtoReflect.Descriptor instead.

func (*RefreshAccessTokenResponse) GetSession

func (x *RefreshAccessTokenResponse) GetSession() *Session

func (*RefreshAccessTokenResponse) ProtoMessage

func (*RefreshAccessTokenResponse) ProtoMessage()

func (*RefreshAccessTokenResponse) ProtoReflect

func (*RefreshAccessTokenResponse) Reset

func (x *RefreshAccessTokenResponse) Reset()

func (*RefreshAccessTokenResponse) String

func (x *RefreshAccessTokenResponse) String() string

type RevokeRefreshTokensRequest

type RevokeRefreshTokensRequest struct {
	WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	// contains filtered or unexported fields
}

func (*RevokeRefreshTokensRequest) Descriptor deprecated

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

Deprecated: Use RevokeRefreshTokensRequest.ProtoReflect.Descriptor instead.

func (*RevokeRefreshTokensRequest) GetWalletAddress

func (x *RevokeRefreshTokensRequest) GetWalletAddress() string

func (*RevokeRefreshTokensRequest) ProtoMessage

func (*RevokeRefreshTokensRequest) ProtoMessage()

func (*RevokeRefreshTokensRequest) ProtoReflect

func (*RevokeRefreshTokensRequest) Reset

func (x *RevokeRefreshTokensRequest) Reset()

func (*RevokeRefreshTokensRequest) String

func (x *RevokeRefreshTokensRequest) String() string

type RevokeRefreshTokensResponse

type RevokeRefreshTokensResponse struct {
	NumSessionsRevoked int64 `protobuf:"varint,1,opt,name=num_sessions_revoked,json=numSessionsRevoked,proto3" json:"num_sessions_revoked,omitempty"`
	// contains filtered or unexported fields
}

func (*RevokeRefreshTokensResponse) Descriptor deprecated

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

Deprecated: Use RevokeRefreshTokensResponse.ProtoReflect.Descriptor instead.

func (*RevokeRefreshTokensResponse) GetNumSessionsRevoked

func (x *RevokeRefreshTokensResponse) GetNumSessionsRevoked() int64

func (*RevokeRefreshTokensResponse) ProtoMessage

func (*RevokeRefreshTokensResponse) ProtoMessage()

func (*RevokeRefreshTokensResponse) ProtoReflect

func (*RevokeRefreshTokensResponse) Reset

func (x *RevokeRefreshTokensResponse) Reset()

func (*RevokeRefreshTokensResponse) String

func (x *RevokeRefreshTokensResponse) String() string

type Session

type Session struct {
	SessionId             string                 `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	AccessToken           string                 `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	RefreshToken          string                 `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	AccessTokenExpiresAt  *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"`
	RefreshTokenExpiresAt *timestamppb.Timestamp `` /* 128-byte string literal not displayed */
	TokenType             string                 `protobuf:"bytes,6,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetAccessToken

func (x *Session) GetAccessToken() string

func (*Session) GetAccessTokenExpiresAt

func (x *Session) GetAccessTokenExpiresAt() *timestamppb.Timestamp

func (*Session) GetRefreshToken

func (x *Session) GetRefreshToken() string

func (*Session) GetRefreshTokenExpiresAt

func (x *Session) GetRefreshTokenExpiresAt() *timestamppb.Timestamp

func (*Session) GetSessionId

func (x *Session) GetSessionId() string

func (*Session) GetTokenType

func (x *Session) GetTokenType() 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) GetChallenge

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 VerifyAccessTokenRequest

type VerifyAccessTokenRequest struct {
	WalletAddress string `protobuf:"bytes,1,opt,name=wallet_address,json=walletAddress,proto3" json:"wallet_address,omitempty"`
	// contains filtered or unexported fields
}

func (*VerifyAccessTokenRequest) Descriptor deprecated

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

Deprecated: Use VerifyAccessTokenRequest.ProtoReflect.Descriptor instead.

func (*VerifyAccessTokenRequest) GetWalletAddress

func (x *VerifyAccessTokenRequest) GetWalletAddress() string

func (*VerifyAccessTokenRequest) ProtoMessage

func (*VerifyAccessTokenRequest) ProtoMessage()

func (*VerifyAccessTokenRequest) ProtoReflect

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

func (*VerifyAccessTokenRequest) Reset

func (x *VerifyAccessTokenRequest) Reset()

func (*VerifyAccessTokenRequest) String

func (x *VerifyAccessTokenRequest) String() string

type VerifyAccessTokenResponse

type VerifyAccessTokenResponse struct {
	Payload *AccessTokenPayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*VerifyAccessTokenResponse) Descriptor deprecated

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

Deprecated: Use VerifyAccessTokenResponse.ProtoReflect.Descriptor instead.

func (*VerifyAccessTokenResponse) GetPayload

func (*VerifyAccessTokenResponse) ProtoMessage

func (*VerifyAccessTokenResponse) ProtoMessage()

func (*VerifyAccessTokenResponse) ProtoReflect

func (*VerifyAccessTokenResponse) Reset

func (x *VerifyAccessTokenResponse) Reset()

func (*VerifyAccessTokenResponse) String

func (x *VerifyAccessTokenResponse) String() string

Jump to

Keyboard shortcuts

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