structs

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEntry

type AuditEntry struct {
	ID          int    `json:"id"`
	Issuer      string `json:"issuer"`
	Username    string `json:"user"`
	Message     int64  `json:"message"`
	Success     bool   `json:"result"`
	ValidatedOn string `json:"date"`
}

AuditEntry represents an Audit entry in the database

type AuditQueryParameter

type AuditQueryParameter struct {
	BaseQuery        string
	Before           time.Time
	After            time.Time
	SourceDateFormat string
	TargetDateFormat string
}

AuditQueryParameter contains parameters for querying audit entries

func NewAuditQueryParameter

func NewAuditQueryParameter() AuditQueryParameter

NewAuditQueryParameter returns an AuditQueryParameter struct with some standard settings for source- and target format

type ColorSetting

type ColorSetting struct {
	Red   uint8 `json:"red"`
	Green uint8 `json:"green"`
	Blue  uint8 `json:"blue"`
	Alpha uint8 `json:"alpha"`
}

func ColorSettingFromString

func ColorSettingFromString(setting string) ColorSetting

func (ColorSetting) ToString

func (setting ColorSetting) ToString() string

type Issuer

type Issuer struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Contact     string `json:"contact"`
	Key         string `json:"-"`
	Enabled     bool   `json:"enabled"`
	TokenLength uint8  `json:"token_length"`
}

Issuer is a struct

func (Issuer) IsSafe added in v0.2.6

func (issuer Issuer) IsSafe() bool

type IssuerCreation added in v0.2.4

type IssuerCreation struct {
	Issuer Issuer `json:"issuer"`
	Token  Token  `json:"token"`
}

type Message

type Message struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

Message is a struct used by the router

type OidcConfig added in v0.2.4

type OidcConfig struct {
	ID           uint8  `json:"id"`
	Enabled      bool   `json:"enabled"`
	ClientID     string `json:"client-id"`
	ClientSecret string `json:"client-secret"`
	DiscoveryURL string `json:"discovery-url"`
}

OidcConfig is a struct containing the current oidc configuration

func (OidcConfig) IsSafe added in v0.2.6

func (oidcConfig OidcConfig) IsSafe() bool

type QrCodeConfig

type QrCodeConfig struct {
	BgColor ColorSetting `json:"qrcode-bgcolor"`
	FgColor ColorSetting `json:"qrcode-fgcolor"`
}

func StandardQrCodeConfig

func StandardQrCodeConfig() QrCodeConfig

StandardQrCodeConfig returns a standard qrcode configuration

type ServerConfig

type ServerConfig struct {
	RouterPort    uint16 `json:"http_port"`
	DenyLimit     uint8  `json:"deny_limit"`
	RootToken     string `json:"-"`
	VerifyTokens  bool   `json:"verify_tokens"`
	SchemaVersion uint8  `json:"schema-version"`
}

ServerConfig is a struct that holds a server configuration

func StandardServerConfig

func StandardServerConfig() ServerConfig

StandardServerConfig returns a standard server configuration

type Token

type Token struct {
	ID          string `json:"-"`
	ObjectRefID string `json:"-"`
	Token       string `json:"access-token"`
	Description string `json:"description"`
}

Token is a struct that can be used to define access to a resource

func NewAccessToken

func NewAccessToken(args ...string) Token

NewAccessToken generates a new access token that has full access on the given object

type TokenEntry added in v0.2.4

type TokenEntry struct {
	Id             string `json:"id"`
	Description    string `json:"description"`
	CreatedOn      string `json:"created_on"`
	LastAccessTime string `json:"last_access_time"`
}

TokenEntry is used when returning registered tokens

type User

type User struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Email   string `json:"email"`
	Issuer  Issuer `json:"issuer"`
	Key     string `json:"-"`
	Enabled bool   `json:"enabled"`
}

User is a struct that holds Username, Issuer and the Base32 encoded Secret Key

func (User) IsSafe added in v0.2.6

func (user User) IsSafe() bool

Jump to

Keyboard shortcuts

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