model

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatementEffectAllow = "allow"
	StatementEffectDeny  = "deny"
)

Variables

View Source
var (
	ErrInvalidStatementSrcFormat = errors.New("invalid statements src format")
)
View Source
var (
	ErrValidationError = errors.New("validation error")
)

Functions

func HashPassword added in v0.63.0

func HashPassword(password string) ([]byte, error)

HashPassword generates a hashed password from a plaintext string

func ValidateActionName

func ValidateActionName(name string) error

func ValidateArn

func ValidateArn(name string) error

func ValidateAuthEntityID

func ValidateAuthEntityID(name string) error

func ValidateStatementEffect

func ValidateStatementEffect(effect string) error

Types

type Credential

type Credential struct {
	AccessKeyID                   string    `db:"access_key_id"`
	SecretAccessKey               string    `db:"-" json:"-"`
	SecretAccessKeyEncryptedBytes []byte    `db:"secret_access_key" json:"-"`
	IssuedDate                    time.Time `db:"issued_date"`
	UserID                        int64     `db:"user_id"`
}

type CredentialKeys

type CredentialKeys struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

For JSON serialization:

type Group

type Group struct {
	ID          int       `db:"id"`
	CreatedAt   time.Time `db:"created_at"`
	DisplayName string    `db:"display_name" json:"display_name"`
}

type PaginationParams

type PaginationParams struct {
	Prefix string
	After  string
	Amount int
}

type Paginator

type Paginator struct {
	Amount        int
	NextPageToken string
}

Paginator describes the parameters of a slice of data from a database.

type Policy

type Policy struct {
	ID          int        `db:"id"`
	CreatedAt   time.Time  `db:"created_at"`
	DisplayName string     `db:"display_name" json:"display_name"`
	Statement   Statements `db:"statement"`
}

type Statement

type Statement struct {
	Effect   string   `json:"Effect"`
	Action   []string `json:"Action"`
	Resource string   `json:"Resource"`
}

type Statements

type Statements []Statement

func (*Statements) Scan

func (s *Statements) Scan(src interface{}) error

func (Statements) Value

func (s Statements) Value() (driver.Value, error)

type SuperuserConfiguration

type SuperuserConfiguration struct {
	User
	AccessKeyID     string
	SecretAccessKey string
}

SuperuserConfiguration requests a particular configuration for a superuser.

type User

type User struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	Username  string    `db:"display_name" json:"display_name"`
	// FriendlyName, if set, is a shorter name for the user than
	// Username.  Unlike Username it does not identify the user (it
	// might not be unique); use it in the user's GUI rather than in
	// backend code.
	FriendlyName      *string `db:"friendly_name" json:"friendly_name"`
	Email             *string `db:"email" json:"email"`
	EncryptedPassword []byte  `db:"encrypted_password" json:"encrypted_password"`
	Source            string  `db:"source" json:"source"`
}

func (*User) Authenticate added in v0.62.0

func (u *User) Authenticate(password string) error

Authenticate a user from a password Returns nil on success, or an error on failure.

func (*User) UpdatePassword added in v0.62.0

func (u *User) UpdatePassword(password string) error

Jump to

Keyboard shortcuts

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