Documentation ¶
Index ¶
Constants ¶
View Source
const ( FINEGRAINED = "fineGrained" WRITE = "write" READ = "read" )
Variables ¶
This section is empty.
Functions ¶
func AnalyzeAndPrintPermissions ¶ added in v3.80.5
AnalyzePermissions prints the permissions of a HuggingFace API key
Types ¶
type Analyzer ¶ added in v3.80.5
func (Analyzer) Type ¶ added in v3.80.5
func (Analyzer) Type() analyzerpb.AnalyzerType
type HFTokenJSON ¶
type HFTokenJSON struct { Username string `json:"name"` Name string `json:"fullname"` Orgs []struct { Name string `json:"name"` Role string `json:"roleInOrg"` IsEnterprise bool `json:"isEnterprise"` } `json:"orgs"` Auth struct { AccessToken struct { Name string `json:"displayName"` Type string `json:"role"` CreatedAt string `json:"createdAt"` FineGrained struct { Global []string `json:"global"` Scoped []struct { Entity struct { Type string `json:"type"` Name string `json:"name"` ID string `json:"_id"` } `json:"entity"` Permissions []string `json:"permissions"` } `json:"scoped"` } `json:"fineGrained"` } } `json:"auth"` }
HFTokenJSON is the struct for the HF /whoami-v2 API JSON response
type Model ¶
type Model struct { Name string `json:"id"` ID string `json:"_id"` Private bool `json:"private"` Permissions Permissions }
type Permissions ¶
type SecretInfo ¶ added in v3.80.5
type SecretInfo struct { Token HFTokenJSON Models []Model }
func AnalyzePermissions ¶
func AnalyzePermissions(cfg *config.Config, key string) (*SecretInfo, error)
Click to show internal directories.
Click to hide internal directories.