authenticate

package
v0.0.0-...-cb7f019 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublicKeyCipherNumber = 12
	SecretKeyCipherNumber = 5
	PublicDescriptor      = "pk"
	SecretDescriptor      = "sk"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Region            string `env:"AWS_REGION" envDefault:"ap-southeast-2"`
	CognitoUserPoolId string `env:"COGNITO_USERPOOLID"`
	CognitoClientId   string `env:"COGNITO_CLIENTID"`
}

func NewEnvConfig

func NewEnvConfig() *AWSConfig

type User

type User struct {
	Id                   string
	Token                string
	BareToken            string
	IsPublic             bool
	IsAuthenticated      bool
	UserAttributes       map[string]string
	AuthenticationResult *cognito.AuthenticationResultType
	Config               *AWSConfig
}

func NewUser

func NewUser(token string, config *AWSConfig) (*User, error)

func NewUserWithEnv

func NewUserWithEnv(token string) (*User, error)

func (*User) Authenticate

func (u *User) Authenticate() error

func (*User) DecodeToken

func (u *User) DecodeToken() (string, error)

bareToken does not include it's descriptor.

Jump to

Keyboard shortcuts

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