Documentation ¶
Index ¶
- type CliClient
- func (c *CliClient) AddFlags(flags map[string]interface{})
- func (c *CliClient) CreateToken() (*CreateTokenResponse, error)
- func (c *CliClient) GetVersionMessage(cliVersion string, timeout int) (*VersionMessage, error)
- func (c *CliClient) PublishPolicies(policiesConfiguration files.UnknownStruct, token string) (*PublishFailedResponse, error)
- func (c *CliClient) ReportCliError(reportCliErrorRequest ReportCliErrorRequest, uri string) (StatusCode int, Error error)
- func (c *CliClient) RequestEvaluationPrerunData(tokenId string, isCi bool) (*EvaluationPrerunDataResponse, error)
- func (c *CliClient) SendEvaluationResult(request *EvaluationResultRequest) (*SendEvaluationResultsResponse, error)
- func (c *CliClient) SendValidateYamlResult(request *ValidatedYamlResult)
- type Configuration
- type CreateTokenResponse
- type EvaluationPrerunDataResponse
- type EvaluationRequest
- type EvaluationResponse
- type EvaluationResult
- type EvaluationResultRequest
- type FailedRule
- type FailureLocation
- type FileData
- type HTTPClient
- type Match
- type Metadata
- type NetworkValidator
- type PublishFailedResponse
- type ReportCliErrorRequest
- type RuleData
- type RuleOrigin
- type RuleType
- type SendEvaluationResultsResponse
- type TestCommandFlags
- type ValidatedFile
- type ValidatedYamlResult
- type VersionMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CliClient ¶
type CliClient struct {
// contains filtered or unexported fields
}
func NewCliClient ¶
func NewCliClient(url string, networkValidator NetworkValidator) *CliClient
func (*CliClient) CreateToken ¶
func (c *CliClient) CreateToken() (*CreateTokenResponse, error)
func (*CliClient) GetVersionMessage ¶
func (c *CliClient) GetVersionMessage(cliVersion string, timeout int) (*VersionMessage, error)
func (*CliClient) PublishPolicies ¶
func (c *CliClient) PublishPolicies(policiesConfiguration files.UnknownStruct, token string) (*PublishFailedResponse, error)
func (*CliClient) ReportCliError ¶
func (c *CliClient) ReportCliError(reportCliErrorRequest ReportCliErrorRequest, uri string) (StatusCode int, Error error)
func (*CliClient) RequestEvaluationPrerunData ¶
func (c *CliClient) RequestEvaluationPrerunData(tokenId string, isCi bool) (*EvaluationPrerunDataResponse, error)
func (*CliClient) SendEvaluationResult ¶
func (c *CliClient) SendEvaluationResult(request *EvaluationResultRequest) (*SendEvaluationResultsResponse, error)
func (*CliClient) SendValidateYamlResult ¶
func (c *CliClient) SendValidateYamlResult(request *ValidatedYamlResult)
type Configuration ¶
type CreateTokenResponse ¶
type CreateTokenResponse struct {
Token string `json:"token"`
}
type EvaluationPrerunDataResponse ¶
type EvaluationPrerunDataResponse struct { PoliciesJson *defaultPolicies.EvaluationPrerunPolicies `json:"policiesJson"` DefaultK8sVersion string `json:"defaultK8sVersion"` RegistrationURL string `json:"registrationURL"` PromptRegistrationURL string `json:"promptRegistrationURL"` IsPolicyAsCodeMode bool `json:"isPolicyAsCodeMode"` DefaultRulesYaml string `json:"defaultRulesYaml"` IsAnonymous bool `json:"isAnonymous"` }
type EvaluationRequest ¶
type EvaluationRequest struct { EvaluationId int `json:"evaluationId"` Files []*extractor.FileConfigurations `json:"files"` }
type EvaluationResponse ¶
type EvaluationResponse struct { Results []*EvaluationResult `json:"results"` Status string `json:"status"` }
type EvaluationResult ¶
type EvaluationResult struct { Passed bool `json:"passed"` Results struct { Matches []*Match `json:"matches"` Mismatches []*Match `json:"mismatches"` } `json:"results"` Rule struct { Identifier string `json:"identifier"` Name string `json:"name"` FailSuggestion string `json:"failSuggestion"` Origin RuleOrigin `json:"origin"` } `json:"rule"` }
type EvaluationResultRequest ¶
type EvaluationResultRequest struct { ClientId string `json:"clientId"` Token string `json:"token"` Metadata *Metadata `json:"metadata"` K8sVersion string `json:"k8sVersion"` PolicyName string `json:"policyName"` FailedYamlFiles []string `json:"failedYamlFiles"` FailedK8sFiles []string `json:"failedK8sFiles"` AllExecutedRules []RuleData `json:"allExecutedRules"` AllEvaluatedFiles []FileData `json:"allEvaluatedFiles"` PolicyCheckResults map[string]map[string]*FailedRule `json:"policyCheckResults"` }
type FailedRule ¶
type FailedRule struct { Name string `json:"ruleName"` DocumentationUrl string `json:"DocumentationUrl"` MessageOnFailure string `json:"messageOnFailure"` Configurations []Configuration `json:"configurations"` }
type FailureLocation ¶ added in v1.6.14
type HTTPClient ¶
type NetworkValidator ¶
type PublishFailedResponse ¶
type ReportCliErrorRequest ¶
type RuleOrigin ¶
type TestCommandFlags ¶
type ValidatedFile ¶
type ValidatedYamlResult ¶
type ValidatedYamlResult struct { Token string `json:"token"` ClientId string `json:"clientId"` Metadata *Metadata `json:"metadata"` Files []*ValidatedFile `json:"files"` Status string `json:"status"` }
type VersionMessage ¶
Click to show internal directories.
Click to hide internal directories.