sourcegraph

package
v3.83.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: AGPL-3.0 Imports: 9 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{
		UserRead:      "user:read",
		SiteAdminFull: "site_admin:full",
	}

	StringToPermission = map[string]Permission{
		"user:read":       UserRead,
		"site_admin:full": SiteAdminFull,
	}

	PermissionIDs = map[Permission]int{
		UserRead:      0,
		SiteAdminFull: 1,
	}

	IdToPermission = map[int]Permission{
		0: UserRead,
		1: SiteAdminFull,
	}
)

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

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

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 GraphQLError

type GraphQLError struct {
	Message string   `json:"message"`
	Path    []string `json:"path"`
}

type GraphQLResponse

type GraphQLResponse struct {
	Errors []GraphQLError `json:"errors"`
	Data   interface{}    `json:"data"`
}

type Permission added in v3.82.0

type Permission int
const (
	NoAccess      Permission = iota
	UserRead      Permission = iota
	SiteAdminFull 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 SecretInfo added in v3.80.5

type SecretInfo struct {
	User        UserInfoJSON
	IsSiteAdmin bool
}

func AnalyzePermissions

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

type UserInfoJSON

type UserInfoJSON struct {
	Data struct {
		CurrentUser struct {
			Username  string `json:"username"`
			Email     string `json:"email"`
			SiteAdmin bool   `json:"siteAdmin"`
			CreatedAt string `json:"createdAt"`
		} `json:"currentUser"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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