Documentation ¶
Index ¶
- Constants
- func CheckBundleUrl(bundleUrl string) string
- func MakeHexaBundle(data []byte) (bytes.Buffer, error)
- type AWSBundleClient
- type AwsCredentials
- type BundleClient
- type Credentials
- type GCPBundleClient
- type GCPBundleClientOpt
- type GCSAPIErr
- type GCSAPIErrDetail
- type GCSAPIErrResp
- type GcpCredentials
- type GithubBundleClient
- type GithubBundleClientOptions
- type GithubCredentials
- type GithubHTTPClient
- type GithubPublishInfo
- type HTTPBundleClient
- type HTTPClient
- type OpaBundleClient
- type OpaDataResponse
- type OpaProvider
- func (o *OpaProvider) ConfigureClient(key []byte) (BundleClient, error)
- func (o *OpaProvider) DiscoverApplications(info policyprovider.IntegrationInfo) ([]policyprovider.ApplicationInfo, error)
- func (o *OpaProvider) GetPolicyInfo(integration policyprovider.IntegrationInfo, _ policyprovider.ApplicationInfo) ([]hexapolicy.PolicyInfo, error)
- func (o *OpaProvider) IsOAuthClient() bool
- func (o *OpaProvider) Name() string
- func (o *OpaProvider) SetPolicyInfo(integration policyprovider.IntegrationInfo, ...) (int, error)
Constants ¶
View Source
const BundleTypeAws string = "aws-s3"
View Source
const BundleTypeGcp string = "GCP_Storage"
View Source
const BundleTypeGithub string = "Github"
View Source
const BundleTypeHttp string = "HTTP"
View Source
const PolicyDataPath string = "/v1/data/policies"
View Source
const ProviderTypeOpa string = "opa"
Variables ¶
This section is empty.
Functions ¶
func CheckBundleUrl ¶ added in v0.6.13
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)
func (*AWSBundleClient) Type ¶ added in v0.6.4
func (a *AWSBundleClient) Type() string
type AwsCredentials ¶ added in v0.6.3
type AwsCredentials GcpCredentials
type BundleClient ¶
type Credentials ¶ added in v0.6.3
type Credentials struct { // ProjectID string `json:"project_id,omitempty"` BundleUrl string `json:"bundle_url"` CACert string `json:"ca_cert,omitempty"` Authorization string `json:"authorization,omitempty"` GCP *GcpCredentials `json:"gcp,omitempty"` AWS *AwsCredentials `json:"aws,omitempty"` GITHUB *GithubCredentials `json:"github,omitempty"` Client *clientcredentials.Config `json:"oauth_client,omitempty"` }
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)
func (*GCPBundleClient) Type ¶ added in v0.6.4
func (g *GCPBundleClient) Type() string
type GCPBundleClientOpt ¶
type GCPBundleClientOpt func(client *GCPBundleClient)
func WithGcpHTTPClient ¶ added in v0.6.13
func WithGcpHTTPClient(c HTTPClient) GCPBundleClientOpt
type GCSAPIErrDetail ¶
type GCSAPIErrResp ¶
type GCSAPIErrResp struct {
Error *GCSAPIErrDetail `json:"error,omitempty"`
}
type GcpCredentials ¶ added in v0.6.3
type GcpCredentials struct { BucketName string `json:"bucket_name,omitempty"` ObjectName string `json:"object_name,omitempty"` Key json.RawMessage `json:"key,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)
func (*GithubBundleClient) Type ¶ added in v0.6.4
func (g *GithubBundleClient) Type() string
type GithubBundleClientOptions ¶
type GithubBundleClientOptions struct {
HTTPClient GithubHTTPClient
}
type GithubCredentials ¶ added in v0.6.3
type GithubCredentials struct { Account string `json:"account,omitempty"` Repo string `json:"repo,omitempty"` BundlePath string `json:"bundlePath,omitempty"` Key json.RawMessage `json:"key,omitempty"` }
type GithubHTTPClient ¶
type GithubPublishInfo ¶
type HTTPBundleClient ¶
type HTTPBundleClient struct { BundleServerURL string Authorization *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)
func (*HTTPBundleClient) Type ¶ added in v0.6.4
func (b *HTTPBundleClient) Type() string
type HTTPClient ¶
type OpaBundleClient ¶ added in v0.6.3
type OpaBundleClient struct { OpaServerUrl string HttpClient HTTPClient }
OpaBundleClient is intended to use the OPA Policy API to directly update and retrieve Policy bundles from an OPA Policy Server instance. Note: typically OPA servers are configured to poll for updates at some configured common retrieval point. Usage of this bundle is mainly for local development purposes.
func (*OpaBundleClient) GetDataFromBundle ¶ added in v0.6.3
func (b *OpaBundleClient) GetDataFromBundle(_ string) ([]byte, error)
func (*OpaBundleClient) PostBundle ¶ added in v0.6.3
func (b *OpaBundleClient) PostBundle(bundle []byte) (int, error)
type OpaDataResponse ¶ added in v0.6.3
type OpaDataResponse struct {
Result []hexapolicy.PolicyInfo `json:"result"`
}
type OpaProvider ¶
type OpaProvider struct { BundleClientOverride BundleClient HttpClient *http.Client JwtHandler oauth2support.JwtClientHandler }
func (*OpaProvider) ConfigureClient ¶
func (o *OpaProvider) ConfigureClient(key []byte) (BundleClient, error)
func (*OpaProvider) DiscoverApplications ¶
func (o *OpaProvider) DiscoverApplications(info policyprovider.IntegrationInfo) ([]policyprovider.ApplicationInfo, error)
func (*OpaProvider) GetPolicyInfo ¶
func (o *OpaProvider) GetPolicyInfo(integration policyprovider.IntegrationInfo, _ policyprovider.ApplicationInfo) ([]hexapolicy.PolicyInfo, error)
func (*OpaProvider) IsOAuthClient ¶ added in v0.6.11
func (o *OpaProvider) IsOAuthClient() bool
func (*OpaProvider) Name ¶
func (o *OpaProvider) Name() string
func (*OpaProvider) SetPolicyInfo ¶
func (o *OpaProvider) SetPolicyInfo(integration policyprovider.IntegrationInfo, appInfo policyprovider.ApplicationInfo, policyInfos []hexapolicy.PolicyInfo) (int, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.