jsonnetsecure

package
v0.0.550 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonnetTestBinary added in v0.0.511

func JsonnetTestBinary(t testing.TB) string

func NewJsonnetCmd added in v0.0.511

func NewJsonnetCmd() *cobra.Command

Types

type DefaultProvider added in v0.0.511

type DefaultProvider struct {
	Subcommand string
}

DefaultProvider provides a secure VM by calling the currently running the current binary with the provided subcommand.

func (*DefaultProvider) JsonnetVM added in v0.0.511

func (p *DefaultProvider) JsonnetVM(ctx context.Context) (VM, error)

type ErrorImporter

type ErrorImporter struct{}

ErrorImporter errors when calling "import".

func (*ErrorImporter) Import

func (importer *ErrorImporter) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error)

Import fetches data from a map entry. All paths are treated as absolute keys.

type Option added in v0.0.511

type Option func(o *vmOptions)

func WithJsonnetBinary added in v0.0.511

func WithJsonnetBinary(jsonnetBinaryPath string) Option

func WithProcessArgs added in v0.0.511

func WithProcessArgs(args ...string) Option

func WithProcessIsolatedVM added in v0.0.511

func WithProcessIsolatedVM(ctx context.Context) Option

type ProcessVM added in v0.0.511

type ProcessVM struct {
	// contains filtered or unexported fields
}

func (*ProcessVM) EvaluateAnonymousSnippet added in v0.0.511

func (p *ProcessVM) EvaluateAnonymousSnippet(filename string, snippet string) (string, error)

func (*ProcessVM) ExtCode added in v0.0.511

func (p *ProcessVM) ExtCode(key string, val string)

func (*ProcessVM) ExtVar added in v0.0.511

func (p *ProcessVM) ExtVar(key string, val string)

func (*ProcessVM) TLACode added in v0.0.511

func (p *ProcessVM) TLACode(key string, val string)

func (*ProcessVM) TLAVar added in v0.0.511

func (p *ProcessVM) TLAVar(key string, val string)

type TestProvider added in v0.0.511

type TestProvider struct {
	// contains filtered or unexported fields
}

TestProvider provides a secure VM by running go build on github. com/ory/x/jsonnetsecure/cmd.

func NewTestProvider added in v0.0.511

func NewTestProvider(t *testing.T) *TestProvider

func (*TestProvider) JsonnetVM added in v0.0.511

func (t *TestProvider) JsonnetVM(ctx context.Context) (VM, error)

type VM added in v0.0.511

type VM interface {
	EvaluateAnonymousSnippet(filename string, snippet string) (json string, formattedErr error)
	ExtCode(key string, val string)
	ExtVar(key string, val string)
	TLACode(key string, val string)
	TLAVar(key string, val string)
}

func MakeSecureVM

func MakeSecureVM(opts ...Option) VM

func NewProcessVM added in v0.0.511

func NewProcessVM(opts *vmOptions) VM

type VMProvider added in v0.0.511

type VMProvider interface {
	// JsonnetVM creates a new secure process-isolated Jsonnet VM whose
	// execution is bound to the provided context, i.e.,
	// cancelling the context will terminate the VM process.
	JsonnetVM(context.Context) (VM, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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