openpolicyagent

package
v0.0.0-...-2e899d5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSBundleClient

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

func NewAWSBundleClient

func NewAWSBundleClient(bucketName, objectName string, key []byte, opts awscommon.AWSClientOptions) (*AWSBundleClient, error)

func (*AWSBundleClient) GetDataFromBundle

func (a *AWSBundleClient) GetDataFromBundle(path string) ([]byte, error)

func (*AWSBundleClient) PostBundle

func (a *AWSBundleClient) PostBundle(bundle []byte) (int, error)

type Action

type Action struct {
	ActionUri string `json:"action_uri"`
}

type BundleClient

type BundleClient interface {
	GetDataFromBundle(path string) ([]byte, error)
	PostBundle(bundle []byte) (int, error)
}

type GCPBundleClient

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

func NewGCPBundleClient

func NewGCPBundleClient(bucketName, objectName string, key []byte, opts ...GCPBundleClientOpt) (*GCPBundleClient, error)

func (*GCPBundleClient) GetDataFromBundle

func (g *GCPBundleClient) GetDataFromBundle(path string) ([]byte, error)

func (*GCPBundleClient) PostBundle

func (g *GCPBundleClient) PostBundle(bundle []byte) (int, error)

type GCPBundleClientOpt

type GCPBundleClientOpt func(client *GCPBundleClient)

func WithHTTPClient

func WithHTTPClient(c HTTPClient) GCPBundleClientOpt

type GCSAPIErr

type GCSAPIErr struct {
	Message  string `json:"message,omitempty"`
	Location string `json:"location,omitempty"`
}

type GCSAPIErrDetail

type GCSAPIErrDetail struct {
	Code    int         `json:"code,omitempty"`
	Message string      `json:"message,omitempty"`
	Errors  []GCSAPIErr `json:"errors,omitempty"`
}

type GCSAPIErrResp

type GCSAPIErrResp struct {
	Error *GCSAPIErrDetail `json:"error,omitempty"`
}

type GithubBundleClient

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

func NewGithubBundleClient

func NewGithubBundleClient(account, repo, bundlePath string, key []byte, opts GithubBundleClientOptions) (*GithubBundleClient, error)

func (*GithubBundleClient) GetDataFromBundle

func (g *GithubBundleClient) GetDataFromBundle(path string) ([]byte, error)

func (*GithubBundleClient) PostBundle

func (g *GithubBundleClient) PostBundle(bundle []byte) (int, error)

type GithubBundleClientOptions

type GithubBundleClientOptions struct {
	HTTPClient GithubHTTPClient
}

type GithubHTTPClient

type GithubHTTPClient interface {
	Get(url string) (resp *http.Response, err error)
	Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
	Do(request *http.Request) (resp *http.Response, err error)
}

type GithubPublishInfo

type GithubPublishInfo struct {
	Message string `json:"message"`
	Content string `json:"content"`
	Sha     string `json:"sha,omitempty"`
}

type HTTPBundleClient

type HTTPBundleClient struct {
	BundleServerURL string
	HttpClient      HTTPClient
}

func (*HTTPBundleClient) GetDataFromBundle

func (b *HTTPBundleClient) GetDataFromBundle(path string) ([]byte, error)

func (*HTTPBundleClient) PostBundle

func (b *HTTPBundleClient) PostBundle(bundle []byte) (int, error)

type HTTPClient

type HTTPClient interface {
	Get(url string) (resp *http.Response, err error)
	Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
}

type Meta

type Meta struct {
	Version string `json:"version"`
}

type Object

type Object struct {
	ResourceID string `json:"resource_id"`
}

type OpaProvider

type OpaProvider struct {
	BundleClientOverride BundleClient
	ResourcesDirectory   string
}

func (*OpaProvider) ConfigureClient

func (o *OpaProvider) ConfigureClient(key []byte) (BundleClient, error)

func (*OpaProvider) DiscoverApplications

func (o *OpaProvider) DiscoverApplications(info orchestrator.IntegrationInfo) ([]orchestrator.ApplicationInfo, error)

func (*OpaProvider) GetPolicyInfo

func (o *OpaProvider) GetPolicyInfo(integration orchestrator.IntegrationInfo, appInfo orchestrator.ApplicationInfo) ([]hexapolicy.PolicyInfo, error)

func (*OpaProvider) MakeDefaultBundle

func (o *OpaProvider) MakeDefaultBundle(data []byte) (bytes.Buffer, error)

func (*OpaProvider) Name

func (o *OpaProvider) Name() string

func (*OpaProvider) SetPolicyInfo

func (o *OpaProvider) SetPolicyInfo(integration orchestrator.IntegrationInfo, appInfo orchestrator.ApplicationInfo, policyInfos []hexapolicy.PolicyInfo) (int, error)

type Policies

type Policies struct {
	Policies []Policy `json:"policies"`
}

type Policy

type Policy struct {
	Meta    Meta     `json:"meta"`
	Actions []Action `json:"actions"`
	Subject Subject  `json:"subject"`
	Object  Object   `json:"object"`
}

type Subject

type Subject struct {
	Members []string `json:"members"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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