authz

package
v0.0.0-...-21df278 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthFailed              = "AUTH_FAILED"
	AuthNewPasswordRequired = "NEW_PASSWORD_REQUIRED"
	AuthSuccess             = "AUTH_SUCCESS"
	AuthInvalidRequest      = "INVALID_REQUEST"
	AuthInvalidNewPassword  = "INVALID_NEW_PASSWORD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Init(config []byte) error
	Login(ctx context.Context, orgData *am.Organization, details *LoginDetails) (map[string]string, error)
	Logout(ctx context.Context, orgData *am.Organization, userName string) error
	SetNewPassword(ctx context.Context, orgData *am.Organization, details *LoginDetails) (map[string]string, error)
	Refresh(ctx context.Context, details *TokenDetails) (map[string]string, error)
	Forgot(ctx context.Context, orgData *am.Organization, details *ResetDetails) error
	Reset(ctx context.Context, orgData *am.Organization, details *ResetDetails) error
}

Authenticator authenticates a user

type LoginDetails

type LoginDetails struct {
	OrgName     string `json:"org_name" validate:"required,gte=3,lte=128"`
	Username    string `json:"user_name" validate:"required,gte=3,lte=256"`
	Password    string `json:"password,omitempty" validate:"required,gte=8,lte=256"`
	NewPassword string `json:"new_password,omitempty" validate:"omitempty,gte=3,lte=256"`
}

type ResetDetails

type ResetDetails struct {
	OrgName          string `json:"org_name" validate:"required,gte=3,lte=128"`
	Username         string `json:"user_name" validate:"required,gte=3,lte=256"`
	Password         string `json:"password,omitempty" validate:"omitempty,gte=8,lte=256"`
	VerificationCode string `json:"verification_code,omitempty" validate:"omitempty,gte=3,lte=256"`
}

ResetDetails for when a user must reset their password.

type TokenDetails

type TokenDetails struct {
	AccessToken  string `json:"access_token" validate:"required,gte=1000,lte=2048"`
	RefreshToken string `json:"refresh_token" validate:"required,gte=1000,lte=2048"`
}

type UserDetails

type UserDetails struct {
	Details map[string]string `json:"details"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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