gitlab

package
v3.88.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 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{
		Api:             "api",
		ReadUser:        "read_user",
		ReadApi:         "read_api",
		ReadRepository:  "read_repository",
		WriteRepository: "write_repository",
		ReadRegistry:    "read_registry",
		WriteRegistry:   "write_registry",
		Sudo:            "sudo",
		AdminMode:       "admin_mode",
		CreateRunner:    "create_runner",
		ManageRunner:    "manage_runner",
		AiFeatures:      "ai_features",
		K8sProxy:        "k8s_proxy",
		ReadServicePing: "read_service_ping",
	}

	StringToPermission = map[string]Permission{
		"api":               Api,
		"read_user":         ReadUser,
		"read_api":          ReadApi,
		"read_repository":   ReadRepository,
		"write_repository":  WriteRepository,
		"read_registry":     ReadRegistry,
		"write_registry":    WriteRegistry,
		"sudo":              Sudo,
		"admin_mode":        AdminMode,
		"create_runner":     CreateRunner,
		"manage_runner":     ManageRunner,
		"ai_features":       AiFeatures,
		"k8s_proxy":         K8sProxy,
		"read_service_ping": ReadServicePing,
	}

	PermissionIDs = map[Permission]int{
		Api:             1,
		ReadUser:        2,
		ReadApi:         3,
		ReadRepository:  4,
		WriteRepository: 5,
		ReadRegistry:    6,
		WriteRegistry:   7,
		Sudo:            8,
		AdminMode:       9,
		CreateRunner:    10,
		ManageRunner:    11,
		AiFeatures:      12,
		K8sProxy:        13,
		ReadServicePing: 14,
	}

	IdToPermission = map[int]Permission{
		1:  Api,
		2:  ReadUser,
		3:  ReadApi,
		4:  ReadRepository,
		5:  WriteRepository,
		6:  ReadRegistry,
		7:  WriteRegistry,
		8:  Sudo,
		9:  AdminMode,
		10: CreateRunner,
		11: ManageRunner,
		12: AiFeatures,
		13: K8sProxy,
		14: ReadServicePing,
	}
)

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

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

Types

type AccessTokenJSON added in v3.80.5

type AccessTokenJSON struct {
	ID         int      `json:"id"`
	Name       string   `json:"name"`
	Revoked    bool     `json:"revoked"`
	CreatedAt  string   `json:"created_at"`
	Scopes     []string `json:"scopes"`
	LastUsedAt string   `json:"last_used_at"`
	ExpiresAt  string   `json:"expires_at"`
	UserID     int      `json:"user_id"`
}

type Analyzer added in v3.80.5

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze added in v3.80.5

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

func (Analyzer) Type added in v3.80.5

type ErrorJSON

type ErrorJSON struct {
	Error string `json:"error"`
	Scope string `json:"scope"`
}

type MetadataJSON

type MetadataJSON struct {
	Version    string `json:"version"`
	Enterprise bool   `json:"enterprise"`
}

type Permission added in v3.83.0

type Permission int
const (
	Invalid         Permission = iota
	Api             Permission = iota
	ReadUser        Permission = iota
	ReadApi         Permission = iota
	ReadRepository  Permission = iota
	WriteRepository Permission = iota
	ReadRegistry    Permission = iota
	WriteRegistry   Permission = iota
	Sudo            Permission = iota
	AdminMode       Permission = iota
	CreateRunner    Permission = iota
	ManageRunner    Permission = iota
	AiFeatures      Permission = iota
	K8sProxy        Permission = iota
	ReadServicePing Permission = iota
)

func PermissionFromID added in v3.83.0

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString added in v3.83.0

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID added in v3.83.0

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

ToID converts a Permission enum to its ID

func (Permission) ToString added in v3.83.0

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

ToString converts a Permission enum to its string representation

type ProjectsJSON

type ProjectsJSON struct {
	ID                int    `json:"id"`
	NameWithNamespace string `json:"name_with_namespace"`
	Permissions       struct {
		ProjectAccess struct {
			AccessLevel int `json:"access_level"`
		} `json:"project_access"`
	} `json:"permissions"`
}

type SecretInfo added in v3.80.5

type SecretInfo struct {
	AccessToken AccessTokenJSON
	Metadata    MetadataJSON
	Projects    []ProjectsJSON
}

func AnalyzePermissions

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

Jump to

Keyboard shortcuts

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