databricks

package
v3.95.9 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 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{
		CanManage: "CAN_MANAGE",
		CanUse:    "CAN_USE",
	}

	StringToPermission = map[string]Permission{
		"CAN_MANAGE": CanManage,
		"CAN_USE":    CanUse,
	}

	PermissionIDs = map[Permission]int{
		CanManage: 1,
		CanUse:    2,
	}

	IdToPermission = map[int]Permission{
		1: CanManage,
		2: CanUse,
	}
)

Functions

func AnalyzeAndPrintPermissions

func AnalyzeAndPrintPermissions(cfg *config.Config, domain, token string)

Types

type Analyzer

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze

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

func (Analyzer) Type

func (a Analyzer) Type() analyzers.AnalyzerType

type ClustersResponse

type ClustersResponse struct {
	Clusters []struct {
		ID        string `json:"cluster_id"`
		Name      string `json:"cluster_name"`
		CreatedBy string `json:"creator_user_name"`
	} `json:"clusters"`
}

type CurrentUserInfo

type CurrentUserInfo struct {
	ID       string `json:"id"`
	UserName string `json:"userName"`
	Emails   []struct {
		Display string `json:"display"`
		Value   string `json:"value"`
		Primary bool   `json:"primary"`
	} `json:"emails"`
}

type DataBricksResource

type DataBricksResource struct {
	ID       string
	Name     string
	Type     string
	Metadata map[string]string
}

type GitCreds

type GitCreds struct {
	Credentials []struct {
		ID       string `json:"credentials_id"`
		UserName string `json:"git_username"`
		Provider string `json:"git_provider"`
	} `json:"credentials"`
}

type GroupsResponse

type GroupsResponse struct {
	Resources []struct {
		ID   string `json:"id"`
		Name string `json:"displayName"`
	} `json:"Resources"`
}

type JobsResponse

type JobsResponse struct {
	Jobs []struct {
		ID          string `json:"job_id"`
		Name        string `json:"name"`
		Description string `json:"description"`
	} `json:"jobs"`
}

type Permission

type Permission int
const (
	Invalid   Permission = iota
	CanManage Permission = iota
	CanUse    Permission = iota
)

func PermissionFromID

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID

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

ToID converts a Permission enum to its ID

func (Permission) ToString

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

ToString converts a Permission enum to its string representation

type Permissions

type Permissions struct {
	PermissionLevels []struct {
		Description     string `json:"description"`
		PermissionLevel string `json:"permission_level"`
	} `json:"permission_levels"`
}

type ReposResponse

type ReposResponse struct {
	Repositories []struct {
		ID       string `json:"id"`
		Path     string `json:"path"`
		Provider string `json:"provider"`
		URL      string `json:"url"`
	} `json:"repos"`
}

type ResourceType

type ResourceType string
const (
	CurrentUser      ResourceType = "User"
	TokensInfo       ResourceType = "Token"
	TokenPermissions ResourceType = "Token Permission"
	Repositories     ResourceType = "Repository"
	GitCredentials   ResourceType = "Git Credential"
	Jobs             ResourceType = "Job"
	Clusters         ResourceType = "Cluster"
	Groups           ResourceType = "Group"
	Users            ResourceType = "Member"
)

func (ResourceType) String

func (r ResourceType) String() string

type SecretInfo

type SecretInfo struct {
	UserInfo              User
	TokenPermissionLevels []string
	Tokens                []Token
	Resources             []DataBricksResource
}

func AnalyzePermissions

func AnalyzePermissions(ctx context.Context, cfg *config.Config, domain, token string) (*SecretInfo, error)

type Token

type Token struct {
	ID          string
	Name        string
	ExpiryTime  string
	CreatedBy   string
	LastUsedDay string
}

type Tokens

type Tokens struct {
	TokensInfo []struct {
		ID          string `json:"token_id"`
		Name        string `json:"comment"`
		ExpiryTime  int    `json:"expiry_time"`
		LastUsedDay int    `json:"last_used_day"`
		CreatedBy   string `json:"created_by_username"`
	} `json:"token_infos"`
}

type User

type User struct {
	ID           string
	UserName     string
	PrimaryEmail string
}

type UsersResponse

type UsersResponse struct {
	Resources []struct {
		ID       string `json:"id"`
		UserName string `json:"userName"`
		Active   bool   `json:"active"`
	} `json:"Resources"`
}

Jump to

Keyboard shortcuts

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