Documentation ¶
Overview ¶
Package fetchrules in the fetchrules go module is a function based on the function framework to fetch compliance rules related to the asset type
Triggered by ¶
A cloud event containing one asset config (the feed message)
Output ¶
- Cloud Events on PubSub assetRule topic.
Cardinality ¶
- n Cloud Events on PubSub assetRule topic. n = the number of matching rules
Automatic retrying ¶
Yes.
Index ¶
- func DeployRules(ctx context.Context, rulesFolderPath string, onlyType string, ...) (err error)
- func EntryPoint(ctxEvent context.Context, pubsubMsg pubsub.Message) error
- type ConstraintConfigs
- type ContentOrAssetTypeConfigs
- type Env
- type Global
- type RuleConfig
- type RuleConfigs
- type RulesRepo
- type ServiceEnv
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConstraintConfigs ¶
type ConstraintConfigs map[string]cai.ConstraintConfig
ConstraintConfigs map key is the constraint name
type ContentOrAssetTypeConfigs ¶
type ContentOrAssetTypeConfigs map[string]RuleConfigs
ContentOrAssetTypeConfigs map key is the ContentType or the AssetType
type Env ¶
type Env struct { KConfiguration string `envconfig:"k_configuration"` KRevision string `envconfig:"k_revision"` KService string `envconfig:"k_service"` }
Env list environment variables
type Global ¶
type Global struct { CommonEv glo.CommonEntryValues // contains filtered or unexported fields }
Global structure for global variables to optimize the performances in serverless mode
type RuleConfig ¶
type RuleConfig struct { RegoCode string `json:"regoCode"` Version time.Time `json:"version"` ConstraintConfigs ConstraintConfigs `json:"constraintConfigs"` }
RuleConfig one rego rule and associated constraint configs
type RuleConfigs ¶
type RuleConfigs map[string]*RuleConfig
RuleConfigs map key is the rule name aka the kind
type RulesRepo ¶
type RulesRepo struct { Version time.Time `json:"version"` ContentOrAssetTypeConfigs ContentOrAssetTypeConfigs `json:"contentOrAssetTypeConfigs"` }
RulesRepo repository of rules by ContentOrAssetType / rule kind / constraint name
type ServiceEnv ¶
type ServiceEnv struct { AssetRuleTopicID string `envconfig:"asset_rule_topic_id" default:"assetRule"` CacheMaxAgeMinutes float64 `envconfig:"cache_max_age_minutes" default:"60"` Environment string `envconfig:"environment" default:"dev"` LogOnlySeveritylevels string `envconfig:"log_only_severity_levels" default:"WARNING NOTICE CRITICAL"` ProjectID string `envconfig:"project_id" required:"true"` RulesRepoBucketName string `envconfig:"rules_repo_bucket_name"` StartProfiler bool `envconfig:"start_profiler" default:"false"` }
ServiceEnv list environment variables prefixed with the name of the microservice
Source Files ¶
- doc.go
- func_deploy_rules.go
- func_entrypoint.go
- func_get_asset_rules.go
- func_get_constraint.go
- func_get_readme.go
- func_get_rule.go
- func_get_string_value.go
- func_init.go
- func_initialize.go
- func_make_asset_rules.go
- func_make_rules_repo.go
- func_parse_rule_files.go
- func_redeployCloudRunRevision.go
- func_update_rules2gcs.go
- types.go