auth

package
v0.0.0-...-522cb6f Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthService_Login_FullMethodName           = "/dictybase.auth.AuthService/Login"
	AuthService_Relogin_FullMethodName         = "/dictybase.auth.AuthService/Relogin"
	AuthService_GetRefreshToken_FullMethodName = "/dictybase.auth.AuthService/GetRefreshToken"
	AuthService_Logout_FullMethodName          = "/dictybase.auth.AuthService/Logout"
)

Variables

View Source
var AuthService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dictybase.auth.AuthService",
	HandlerType: (*AuthServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _AuthService_Login_Handler,
		},
		{
			MethodName: "Relogin",
			Handler:    _AuthService_Relogin_Handler,
		},
		{
			MethodName: "GetRefreshToken",
			Handler:    _AuthService_GetRefreshToken_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _AuthService_Logout_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dictybase/auth/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)

View Source
var File_dictybase_auth_auth_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)

Types

type Auth

type Auth struct {

	// JSON Web Token (JWT)
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Refresh token
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// Identity of user
	Identity *identity.Identity `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
	// User API data
	User *user.User `protobuf:"bytes,4,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

Definition of an individual auth response

func (*Auth) Descriptor deprecated

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

Deprecated: Use Auth.ProtoReflect.Descriptor instead.

func (*Auth) GetIdentity

func (x *Auth) GetIdentity() *identity.Identity

func (*Auth) GetRefreshToken

func (x *Auth) GetRefreshToken() string

func (*Auth) GetToken

func (x *Auth) GetToken() string

func (*Auth) GetUser

func (x *Auth) GetUser() *user.User

func (*Auth) ProtoMessage

func (*Auth) ProtoMessage()

func (*Auth) ProtoReflect

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

func (*Auth) Reset

func (x *Auth) Reset()

func (*Auth) String

func (x *Auth) String() string

func (*Auth) Validate

func (this *Auth) Validate() error

type AuthServiceClient

type AuthServiceClient interface {
	// Logs user into authserver
	Login(ctx context.Context, in *NewLogin, opts ...grpc.CallOption) (*Auth, error)
	// Logs user into authserver
	Relogin(ctx context.Context, in *NewRelogin, opts ...grpc.CallOption) (*Auth, error)
	// Retrieves new refresh token and JWT
	GetRefreshToken(ctx context.Context, in *NewToken, opts ...grpc.CallOption) (*Token, error)
	// Logs user out of authserver
	Logout(ctx context.Context, in *NewRefreshToken, opts ...grpc.CallOption) (*emptypb.Empty, 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.

type AuthServiceServer

type AuthServiceServer interface {
	// Logs user into authserver
	Login(context.Context, *NewLogin) (*Auth, error)
	// Logs user into authserver
	Relogin(context.Context, *NewRelogin) (*Auth, error)
	// Retrieves new refresh token and JWT
	GetRefreshToken(context.Context, *NewToken) (*Token, error)
	// Logs user out of authserver
	Logout(context.Context, *NewRefreshToken) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility

type NewLogin

type NewLogin struct {

	// Client ID received during application registration from every provider
	ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// Scope of the application
	Scopes string `protobuf:"bytes,2,opt,name=scopes,proto3" json:"scopes,omitempty"`
	// An unguessable random string. It is used to protect against cross-site request
	// forgery attacks. It is passed to the provider during first login.
	State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
	// The URL in the application where users will be sent after authorization,
	// generally provided during the registration of the application.
	RedirectUrl string `protobuf:"bytes,4,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"`
	// The code that is received as response from the first login
	Code string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"`
	// Third party oAuth provider
	Provider string `protobuf:"bytes,6,opt,name=provider,proto3" json:"provider,omitempty"`
	// contains filtered or unexported fields
}

func (*NewLogin) Descriptor deprecated

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

Deprecated: Use NewLogin.ProtoReflect.Descriptor instead.

func (*NewLogin) GetClientId

func (x *NewLogin) GetClientId() string

func (*NewLogin) GetCode

func (x *NewLogin) GetCode() string

func (*NewLogin) GetProvider

func (x *NewLogin) GetProvider() string

func (*NewLogin) GetRedirectUrl

func (x *NewLogin) GetRedirectUrl() string

func (*NewLogin) GetScopes

func (x *NewLogin) GetScopes() string

func (*NewLogin) GetState

func (x *NewLogin) GetState() string

func (*NewLogin) ProtoMessage

func (*NewLogin) ProtoMessage()

func (*NewLogin) ProtoReflect

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

func (*NewLogin) Reset

func (x *NewLogin) Reset()

func (*NewLogin) String

func (x *NewLogin) String() string

func (*NewLogin) Validate

func (this *NewLogin) Validate() error

type NewRefreshToken

type NewRefreshToken struct {

	// Refresh token (unique ID)
	RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*NewRefreshToken) Descriptor deprecated

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

Deprecated: Use NewRefreshToken.ProtoReflect.Descriptor instead.

func (*NewRefreshToken) GetRefreshToken

func (x *NewRefreshToken) GetRefreshToken() string

func (*NewRefreshToken) ProtoMessage

func (*NewRefreshToken) ProtoMessage()

func (*NewRefreshToken) ProtoReflect

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

func (*NewRefreshToken) Reset

func (x *NewRefreshToken) Reset()

func (*NewRefreshToken) String

func (x *NewRefreshToken) String() string

func (*NewRefreshToken) Validate

func (this *NewRefreshToken) Validate() error

type NewRelogin

type NewRelogin struct {

	// Refresh token
	RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*NewRelogin) Descriptor deprecated

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

Deprecated: Use NewRelogin.ProtoReflect.Descriptor instead.

func (*NewRelogin) GetRefreshToken

func (x *NewRelogin) GetRefreshToken() string

func (*NewRelogin) ProtoMessage

func (*NewRelogin) ProtoMessage()

func (*NewRelogin) ProtoReflect

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

func (*NewRelogin) Reset

func (x *NewRelogin) Reset()

func (*NewRelogin) String

func (x *NewRelogin) String() string

func (*NewRelogin) Validate

func (this *NewRelogin) Validate() error

type NewToken

type NewToken struct {

	// JSON Web Token (JWT)
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Refresh token (unique ID)
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*NewToken) Descriptor deprecated

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

Deprecated: Use NewToken.ProtoReflect.Descriptor instead.

func (*NewToken) GetRefreshToken

func (x *NewToken) GetRefreshToken() string

func (*NewToken) GetToken

func (x *NewToken) GetToken() string

func (*NewToken) ProtoMessage

func (*NewToken) ProtoMessage()

func (*NewToken) ProtoReflect

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

func (*NewToken) Reset

func (x *NewToken) Reset()

func (*NewToken) String

func (x *NewToken) String() string

func (*NewToken) Validate

func (this *NewToken) Validate() error

type Token

type Token struct {

	// JSON Web Token (JWT)
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Refresh token (unique ID)
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetRefreshToken

func (x *Token) GetRefreshToken() string

func (*Token) GetToken

func (x *Token) GetToken() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

func (*Token) Validate

func (this *Token) Validate() error

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServiceServer) GetRefreshToken

func (UnimplementedAuthServiceServer) Login

func (UnimplementedAuthServiceServer) Logout

func (UnimplementedAuthServiceServer) Relogin

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.

Jump to

Keyboard shortcuts

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