auth

package
v2.33.17 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(conf Config)

func GetBaseURL

func GetBaseURL() (string, error)

func IsTokenValid added in v2.9.0

func IsTokenValid(token string, tokenExpireDurationDiff time.Duration) bool

IsTokenValid checks if the token is still valid

Types

type Challenge

type Challenge struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

type Config

type Config struct {
	WithDatadogTracing    bool   // used when you trace your application with Datadog
	WithOpenCensusTracing bool   // default and used when you trace your application with Open Census
	ServiceName           string // needed when using lambda and Datadog for tracing
	Stage                 string
}

type SignInResponse

type SignInResponse struct {
	Data struct {
		Tokens    Tokens    `json:"tokens"`
		Challenge Challenge `json:"challenge"`
	} `json:"data"`
}

type Tokens

type Tokens struct {
	AccessToken   string `json:"accessToken"`
	IdentityToken string `json:"identityToken"`
	RefreshToken  string `json:"refreshToken"`
}

func SignIn

func SignIn(ctx context.Context, username, password string) (Tokens, error)

SignIn will sign in the user and if needed complete the change password challenge

func SignInRefreshToken added in v2.21.0

func SignInRefreshToken(ctx context.Context, refreshToken string) (Tokens, error)

Directories

Path Synopsis
Package secretsmanagerauth provides a package for authenticating with credentials stored in Secrets Manager.
Package secretsmanagerauth provides a package for authenticating with credentials stored in Secrets Manager.

Jump to

Keyboard shortcuts

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