Help us shape the future of Go! Take the 2026 Go Developer Survey

auth

package
v0.0.56 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLoginTimeout = errors.New("timed out")

Functions

func GenerateLoginOTP added in v0.0.36

func GenerateLoginOTP(logger logger.Logger, baseUrl string) (string, error)

Types

type LoginResult

type LoginResult struct {
	APIKey  string
	UserId  string
	Expires time.Time
}

func PollForLoginCompletion added in v0.0.36

func PollForLoginCompletion(logger logger.Logger, baseUrl string, otp string) (*LoginResult, error)

type OTPCompleteResponse added in v0.0.36

type OTPCompleteResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    *struct {
		APIKey  string `json:"apiKey"`
		UserId  string `json:"userId"`
		Expires int64  `json:"expires"`
	} `json:"data,omitempty"`
}

type OTPStartResponse added in v0.0.36

type OTPStartResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    struct {
		OTP string `json:"otp"`
	} `json:"data"`
}

type User added in v0.0.36

type User struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	OrgId     string `json:"orgId"`
	OrgName   string `json:"name"`
}

func GetUser added in v0.0.36

func GetUser(logger logger.Logger, baseUrl string, apiKey string) (*User, error)

type UserResponse added in v0.0.36

type UserResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    *User  `json:"data"`
}

Jump to

Keyboard shortcuts

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