utils

package
v0.0.0-...-2d9921c Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandToken

func RandToken(l int) []byte

Types

type AdminUserConfig

type AdminUserConfig struct {
	Email      string
	PrivateKey []byte
	AdminEmail string
}

type FlexInt

type FlexInt int

A FlexInt is an int that can be unmarshalled from a JSON field that has either a number or a string value. E.g. if the json field contains an string "42", the FlexInt value will be "42".

func (*FlexInt) UnmarshalJSON

func (fi *FlexInt) UnmarshalJSON(b []byte) error

type RoleValue

type RoleValue struct {
	Value string `json:"value"`
}

type Roles

type Roles struct {
	SessionDuration FlexInt     `json:"SessionDuration"`
	Roles           []RoleValue `json:"IAM_role"`
}

type User

type User struct {
	Email string `json:"email"`
}

type UserRoles

type UserRoles struct {
	User  User  `json:"user"`
	Roles Roles `json:"roles"`
}

func GetUserRoles

func GetUserRoles(accessToken string, conf *oauth2.Config, config *AdminUserConfig) (*UserRoles, error)

Jump to

Keyboard shortcuts

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