shopify

package
v3.82.8 Latest Latest
Warning

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

Go to latest
Published: Oct 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{
		Read:       "read",
		Write:      "write",
		FullAccess: "full_access",
	}

	StringToPermission = map[string]Permission{
		"read":        Read,
		"write":       Write,
		"full_access": FullAccess,
	}

	PermissionIDs = map[Permission]int{
		Read:       1,
		Write:      2,
		FullAccess: 3,
	}

	IdToPermission = map[int]Permission{
		1: Read,
		2: Write,
		3: FullAccess,
	}
)

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

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

Types

type AccessScopesJSON

type AccessScopesJSON struct {
	AccessScopes []struct {
		Handle string `json:"handle"`
	} `json:"access_scopes"`
}

func (AccessScopesJSON) String

func (a AccessScopesJSON) String() string

type Analyzer added in v3.82.2

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze added in v3.82.2

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

func (Analyzer) Type added in v3.82.2

type CategoryJSON

type CategoryJSON struct {
	Description string            `json:"description"`
	Scopes      map[string]string `json:"scopes"`
}

Category represents the structure of each category in the JSON

type OutputScopes

type OutputScopes struct {
	Description string
	Scopes      []string
}

func (OutputScopes) PrintScopes

func (o OutputScopes) PrintScopes() string

type Permission added in v3.82.2

type Permission int
const (
	Invalid    Permission = iota
	Read       Permission = iota
	Write      Permission = iota
	FullAccess Permission = iota
)

func PermissionFromID added in v3.82.2

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString added in v3.82.2

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID added in v3.82.2

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

ToID converts a Permission enum to its ID

func (Permission) ToString added in v3.82.2

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

ToString converts a Permission enum to its string representation

type ScopeDataJSON

type ScopeDataJSON struct {
	Categories map[string]CategoryJSON `json:"categories"`
}

Data represents the overall JSON structure

type SecretInfo added in v3.80.5

type SecretInfo struct {
	StatusCode int
	ShopInfo   ShopInfoJSON
	Scopes     map[string]OutputScopes
}

func AnalyzePermissions

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

type ShopInfoJSON

type ShopInfoJSON struct {
	Shop struct {
		Domain    string `json:"domain"`
		Name      string `json:"name"`
		Email     string `json:"email"`
		CreatedAt string `json:"created_at"`
	} `json:"shop"`
}

Jump to

Keyboard shortcuts

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