auth

package
v0.0.0-...-4df811a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ATTEMPTS int = 12

Variables

View Source
var (
	ErrorUnauthorized        = errors.New("Unauthorized")
	ErrorServiceNotAvailable = errors.New("connection refused")
	ErrorDeviceNotRegistered = errors.New("device not registered")
)

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	Name() string
	Start() (string, error)
	WaitForExternalLogin() error
	CheckAccount(account map[string]string) (bool, error)
	Finish(
		pkey []byte,
		device string,
		deviceUID string,
	) (models.User, string, error)
}

func GetAuthService

func GetAuthService(
	serviceName string,
	apiUrl string,
) (AuthService, error)

GetAuthService function returns the instance of an AuthService implementor based on `serviceName`

func GitHubAuth

func GitHubAuth(ctx context.Context, apiUrl string) AuthService

GitHubAuth function returns an instance of GitHubAuth service

func GitlabAuth

func GitlabAuth(ctx context.Context, apiUrl string) AuthService

GitlabAuth function returns an instance of GitLabAuth service

type PublicKey

type PublicKey struct {
	Typ       string
	KeyID     string
	PublicKey string
}

Jump to

Keyboard shortcuts

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