types

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEvent

type AuditEvent struct {
	EventData AuditEventData `json:"eventData"`
}

type AuditEventData

type AuditEventData struct {
	Version             string                 `json:"version"`
	UserIdentity        AuditEventUserIdentity `json:"userIdentity"`
	UserAgent           string                 `json:"userAgent"`
	EventSource         string                 `json:"eventSource"`
	EventName           string                 `json:"eventName"`
	EventTime           time.Time              `json:"eventTime"`
	UID                 string                 `json:"UID"`
	RequestParameters   map[string]interface{} `json:"requestParameters"`
	ResponseElements    map[string]interface{} `json:"responseElements"`
	ErrorCode           string                 `json:"errorCode"`
	ErrorMessage        string                 `json:"errorMessage"`
	SourceIPAddress     string                 `json:"sourceIPAddress"`
	RecipientAccountId  string                 `json:"recipientAccountId"`
	AdditionalEventData map[string]interface{} `json:"additionalEventData"`
}

type AuditEventUserIdentity

type AuditEventUserIdentity struct {
	Type        string `json:"type"`
	PrincipalId string `json:"principalId"`
	Details     *User  `json:"details"`
}

type AuditLog

type AuditLog struct {
	Time        string                 `json:"time"`
	User        AuditUser              `json:"user"`
	Action      string                 `json:"action"`
	Method      string                 `json:"method"`
	Path        string                 `json:"path"`
	ExpireTime  int64                  `json:"expire_time,omitempty"`
	QueryParams map[string][]string    `json:"query_params,omitempty"`
	Resource    map[string]interface{} `json:"resource,omitempty"`
	Body        interface{}            `json:"body,omitempty"`
}

AuditLog : Audit log object

type AuditUser

type AuditUser struct {
	ID        string `json:"id"`
	Username  string `json:"username"`
	Name      string `json:"name"`
	Email     string `json:"email"`
	SourceIP  string `json:"source_ip,omitempty"`
	UserAgent string `json:"user_agent,omitempty"`
}

AuditUser : User object used in audit logs

type BadRequest

type BadRequest baseError

BadRequest : User submitted a bad request

func (*BadRequest) Error

func (e *BadRequest) Error() string

type FieldValidation

type FieldValidation func(input *ValidationInput, ch chan ValidationOutput)

type FilterField

type FilterField struct {
	Field    string      `json:"field"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

FilterField: Filter field object

type Forbidden

type Forbidden baseError

Forbidden : User does not have permission

func (*Forbidden) Error

func (e *Forbidden) Error() string

type Group

type Group struct {
	ID string `json:"group_id"`
	Permissions
}

Group : Group object

type History

type History struct {
	Time string `json:"time"`
	Data Record `json:"data"`
}

History : History object

type NotFound

type NotFound baseError

NotFound : Item does not exist

func (*NotFound) Error

func (e *NotFound) Error() string

type Permissions

type Permissions struct {
	PermittedEndpoints     []PermittedEndpoint `json:"permitted_endpoints"`
	ReadFilters            []FilterField       `json:"read_filters"`
	CreateFilters          []FilterField       `json:"create_filters"`
	UpdateFilters          []FilterField       `json:"update_filters"`
	DeleteFilters          []FilterField       `json:"delete_filters"`
	ExcludeFields          []string            `json:"exclude_fields"`
	UpdateFieldsPermitted  []string            `json:"update_fields_permitted"`
	UpdateFieldsRestricted []string            `json:"update_fields_restricted"`
}

Permissions: Permissions struct

type PermittedEndpoint

type PermittedEndpoint struct {
	Endpoint string `json:"endpoint"`
	Method   string `json:"method"`
}

PermittedEndpoint : An endpoint

type Record

type Record map[string]interface{}

Record : Data record

type Request

type Request struct {
	User        RequestUser
	Method      string
	Path        string
	Body        interface{}
	SourceIP    string
	UserAgent   string
	PathParams  map[string]string
	QueryParams map[string][]string
}

Request : simple request

type RequestUser

type RequestUser struct {
	ID   string
	Data *UserData
}

RequestUser : User object

type ScanType

type ScanType interface {
	Record | AuditLog
}

type Unauthorized

type Unauthorized baseError

Unauthorized : User is not authenticated

func (*Unauthorized) Error

func (e *Unauthorized) Error() string

type User

type User struct {
	ID       string   `json:"id"`
	Username string   `json:"username"`
	Name     string   `json:"name"`
	Email    string   `json:"email"`
	Groups   []string `json:"groups"`
	Permissions
}

User : User object

type UserData

type UserData struct {
	Username     string   `json:"username"`
	Name         string   `json:"name"`
	Email        string   `json:"email"`
	Entitlements []string `json:"entitlements"`
}

UserData : User data object

type ValidationInput

type ValidationInput struct {
	Key          string
	Value        interface{}
	Item         map[string]interface{}
	ExistingItem map[string]interface{}
}

type ValidationOutput

type ValidationOutput struct {
	Input   *ValidationInput
	Result  bool
	Message string
	Error   error
}

Jump to

Keyboard shortcuts

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