api

package module
v0.0.0-...-27252fe Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPolicies(ctx context.Context) ([]PolicyListItem, error)
	GetPolicy(ctx context.Context, name string) (*Policy, error)
	CreateException(ctx context.Context, request ExceptionRequest) (*ExceptionResponse, error)
}

type Details

type Details struct {
	Title string        `json:"title"`
	Items []DetailsItem `json:"items"`
}

type DetailsItem

type DetailsItem struct {
	Title string `json:"title"`
	Value string `json:"value"`
}

type Engine

type Engine struct {
	Name     string   `json:"name"`
	Version  string   `json:"version,omitempty"`
	Subjects []string `json:"subjects,omitempty"`
}

type ExceptionPolicy

type ExceptionPolicy struct {
	Name  string          `json:"name"`
	Rules []ExceptionRule `json:"rules"`
}

type ExceptionRequest

type ExceptionRequest struct {
	Resource Resource           `json:"resource"`
	Policies []*ExceptionPolicy `json:"policies"`
}

type ExceptionResponse

type ExceptionResponse struct {
	MinVersion string `json:"minVersion,omitempty"`
	Resource   string `json:"resource,omitempty"`
}

type ExceptionRule

type ExceptionRule struct {
	Name  string            `json:"name"`
	Props map[string]string `json:"props"`
}

type Policy

type Policy struct {
	Category    string        `json:"category"`
	Namespace   string        `json:"namespace,omitempty"`
	Name        string        `json:"name"`
	Title       string        `json:"title"`
	Description string        `json:"description"`
	Severity    string        `json:"severity,omitempty"`
	Engine      *Engine       `json:"engine,omitempty"`
	SourceCode  *SourceCode   `json:"code,omitempty"`
	References  []Reference   `json:"references,omitempty"`
	Details     []DetailsItem `json:"details,omitempty"`
	Additional  []Details     `json:"additional,omitempty"`
}

type PolicyListItem

type PolicyListItem struct {
	Category    string `json:"category"`
	Namespace   string `json:"namespace,omitempty"`
	Name        string `json:"name"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Severity    string `json:"severity,omitempty"`
}

type Reference

type Reference struct {
	URL string `json:"url"`
}

type Resource

type Resource struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
	Namespace  string `json:"namespace"`
}

type SourceCode

type SourceCode struct {
	ContentType string `json:"contentType"`
	Content     string `json:"content"`
}

Jump to

Keyboard shortcuts

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