opsgenie

package
v3.83.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	PermissionStrings = map[Permission]string{
		ConfigurationAccess: "configuration_access",
		Read:                "read",
		Delete:              "delete",
		CreateAndUpdate:     "create_and_update",
	}

	StringToPermission = map[string]Permission{
		"configuration_access": ConfigurationAccess,
		"read":                 Read,
		"delete":               Delete,
		"create_and_update":    CreateAndUpdate,
	}

	PermissionIDs = map[Permission]int{
		ConfigurationAccess: 1,
		Read:                2,
		Delete:              3,
		CreateAndUpdate:     4,
	}

	IdToPermission = map[int]Permission{
		1: ConfigurationAccess,
		2: Read,
		3: Delete,
		4: CreateAndUpdate,
	}
)

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

func AnalyzeAndPrintPermissions(cfg *config.Config, key string)

func StatusContains

func StatusContains(status int, vals []int) bool

Types

type Analyzer added in v3.82.0

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze added in v3.82.0

func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error)

func (Analyzer) Type added in v3.82.0

type HttpStatusTest

type HttpStatusTest struct {
	Endpoint        string      `json:"endpoint"`
	Method          string      `json:"method"`
	Payload         interface{} `json:"payload"`
	ValidStatuses   []int       `json:"valid_status_code"`
	InvalidStatuses []int       `json:"invalid_status_code"`
}

func (*HttpStatusTest) RunTest

func (h *HttpStatusTest) RunTest(cfg *config.Config, headers map[string]string) (bool, error)

type Permission added in v3.82.0

type Permission int
const (
	Invalid             Permission = iota
	ConfigurationAccess Permission = iota
	Read                Permission = iota
	Delete              Permission = iota
	CreateAndUpdate     Permission = iota
)

func PermissionFromID added in v3.82.0

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString added in v3.82.0

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID added in v3.82.0

func (p Permission) ToID() (int, error)

ToID converts a Permission enum to its ID

func (Permission) ToString added in v3.82.0

func (p Permission) ToString() (string, error)

ToString converts a Permission enum to its string representation

type Scope

type Scope struct {
	Name     string         `json:"name"`
	HttpTest HttpStatusTest `json:"test"`
}

type SecretInfo added in v3.80.5

type SecretInfo struct {
	Users       []User
	Permissions []string
}

func AnalyzePermissions

func AnalyzePermissions(cfg *config.Config, key string) (*SecretInfo, error)

type User

type User struct {
	FullName string `json:"fullName"`
	Username string `json:"username"`
	Role     struct {
		Name string `json:"name"`
	} `json:"role"`
}

type UsersJSON

type UsersJSON struct {
	Users []User `json:"data"`
}

Jump to

Keyboard shortcuts

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