models

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CICDTriggerActionsAttrTypes = map[string]attr.Type{
	"report_issue": types.BoolType,
	"block_cicd":   types.BoolType,
	"report_cicd":  types.BoolType,
}

CICDTriggerActionsAttrTypes describes the action sub-block for the `cicd` trigger.

View Source
var CICDTriggerAttrTypes = triggerObjectAttrTypes(CICDTriggerActionsAttrTypes)

CICDTriggerAttrTypes is the full type map for cicd_trigger.

View Source
var CIImageTriggerActionsAttrTypes = map[string]attr.Type{
	"report_issue": types.BoolType,
	"report_cicd":  types.BoolType,
	"block_cicd":   types.BoolType,
}

CIImageTriggerActionsAttrTypes describes the action sub-block for the `ciImage` trigger.

View Source
var CIImageTriggerAttrTypes = triggerObjectAttrTypes(CIImageTriggerActionsAttrTypes)

CIImageTriggerAttrTypes is the full type map for ci_image_trigger.

View Source
var ImageRegistryTriggerActionsAttrTypes = map[string]attr.Type{
	"report_issue": types.BoolType,
}

ImageRegistryTriggerActionsAttrTypes describes the action sub-block for the `imageRegistry` trigger.

View Source
var ImageRegistryTriggerAttrTypes = triggerObjectAttrTypes(ImageRegistryTriggerActionsAttrTypes)

ImageRegistryTriggerAttrTypes is the full type map for image_registry_trigger.

View Source
var PRTriggerActionsAttrTypes = map[string]attr.Type{
	"report_issue":      types.BoolType,
	"block_pr":          types.BoolType,
	"report_pr_comment": types.BoolType,
}

PRTriggerActionsAttrTypes describes the action sub-block for the `pr` trigger.

View Source
var PRTriggerAttrTypes = triggerObjectAttrTypes(PRTriggerActionsAttrTypes)

PRTriggerAttrTypes is the full type map for pr_trigger.

View Source
var PeriodicTriggerActionsAttrTypes = map[string]attr.Type{
	"report_issue": types.BoolType,
}

PeriodicTriggerActionsAttrTypes describes the action sub-block for the `periodic` trigger.

View Source
var PeriodicTriggerAttrTypes = triggerObjectAttrTypes(PeriodicTriggerActionsAttrTypes)

PeriodicTriggerAttrTypes is the full type map for periodic_trigger.

Functions

This section is empty.

Types

type FrameworkModel

type FrameworkModel struct {
	Name                   types.String `tfsdk:"name"`
	Definition             types.String `tfsdk:"definition"`
	DefinitionLink         types.String `tfsdk:"definition_link"`
	RemediationDescription types.String `tfsdk:"remediation_description"`
}

FrameworkModel represents a framework definition.

type PoliciesDataSourceModel

type PoliciesDataSourceModel struct {
	ID       types.String  `tfsdk:"id"`
	IsCustom types.Bool    `tfsdk:"is_custom"`
	Status   types.String  `tfsdk:"status"`
	Policies []PolicyModel `tfsdk:"policies"`
}

PoliciesDataSourceModel is the model for the policies list data source.

func (*PoliciesDataSourceModel) RefreshFromRemote

func (m *PoliciesDataSourceModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote []appsecTypes.Policy)

RefreshFromRemote updates the data source model from the SDK response.

func (*PoliciesDataSourceModel) ToListRequest

ToListPoliciesRequest converts the data source model to an SDK list request.

type PolicyModel

type PolicyModel struct {
	ID                          types.String  `tfsdk:"id"`
	Name                        types.String  `tfsdk:"name"`
	Description                 types.String  `tfsdk:"description"`
	Status                      types.String  `tfsdk:"status"`
	IsCustom                    types.Bool    `tfsdk:"is_custom"`
	Conditions                  types.String  `tfsdk:"conditions"` // JSON string
	Scope                       types.String  `tfsdk:"scope"`      // JSON string
	AssetGroupIds               types.List    `tfsdk:"asset_group_ids"`
	PeriodicTrigger             types.Object  `tfsdk:"periodic_trigger"`
	PRTrigger                   types.Object  `tfsdk:"pr_trigger"`
	CICDTrigger                 types.Object  `tfsdk:"cicd_trigger"`
	CIImageTrigger              types.Object  `tfsdk:"ci_image_trigger"`
	ImageRegistryTrigger        types.Object  `tfsdk:"image_registry_trigger"`
	DeveloperSuppressionAffects types.Bool    `tfsdk:"developer_suppression_affects"`
	OverrideIssueSeverity       types.String  `tfsdk:"override_issue_severity"`
	CreatedBy                   types.String  `tfsdk:"created_by"`
	DateCreated                 types.String  `tfsdk:"date_created"`
	ModifiedBy                  types.String  `tfsdk:"modified_by"`
	DateModified                types.String  `tfsdk:"date_modified"`
	Version                     types.Float64 `tfsdk:"version"`
}

PolicyModel is the Terraform model for an AppSec policy. Note: conditions and scope are stored as JSON strings due to deep nesting complexity (up to 10 levels). Triggers are exposed as five strongly-typed nested objects (one per trigger type) since each has a fixed shape.

func (*PolicyModel) RefreshFromRemote

func (m *PolicyModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote *appsecTypes.Policy)

RefreshFromRemote updates the Terraform model from the SDK response.

func (*PolicyModel) ToCreateRequest

func (m *PolicyModel) ToCreateRequest(ctx context.Context, diags *diag.Diagnostics) appsecTypes.CreatePolicyRequest

ToCreateRequest converts the Terraform model to an SDK create request.

func (*PolicyModel) ToUpdateRequest

func (m *PolicyModel) ToUpdateRequest(ctx context.Context, diags *diag.Diagnostics) appsecTypes.UpdatePolicyRequest

ToUpdateRequest converts the Terraform model to an SDK update request.

type RuleModel

type RuleModel struct {
	ID              types.String `tfsdk:"id"`
	Name            types.String `tfsdk:"name"`
	Severity        types.String `tfsdk:"severity"`
	Scanner         types.String `tfsdk:"scanner"`
	Category        types.String `tfsdk:"category"`
	SubCategory     types.String `tfsdk:"sub_category"`
	Description     types.String `tfsdk:"description"`
	Frameworks      types.List   `tfsdk:"frameworks"`
	Labels          types.List   `tfsdk:"labels"`
	IsCustom        types.Bool   `tfsdk:"is_custom"`
	IsEnabled       types.Bool   `tfsdk:"is_enabled"`
	CloudProvider   types.String `tfsdk:"cloud_provider"`
	Domain          types.String `tfsdk:"domain"`
	FindingCategory types.String `tfsdk:"finding_category"`
	CreatedAt       types.String `tfsdk:"created_at"`
	UpdatedAt       types.String `tfsdk:"updated_at"`
}

RuleModel is the Terraform model for an AppSec rule.

func (*RuleModel) RefreshFromRemote

func (m *RuleModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote *appsecTypes.Rule)

RefreshFromRemote updates the Terraform model from the SDK response.

func (*RuleModel) ToCreateRequest

func (m *RuleModel) ToCreateRequest(ctx context.Context, diags *diag.Diagnostics) appsecTypes.CreateOrCloneRequest

ToCreateRequest converts the Terraform model to an SDK create request.

func (*RuleModel) ToUpdateRequest

func (m *RuleModel) ToUpdateRequest(ctx context.Context, diags *diag.Diagnostics) appsecTypes.UpdateRequest

ToUpdateRequest converts the Terraform model to an SDK update request.

type RulesDataSourceModel

type RulesDataSourceModel struct {
	ID       types.String `tfsdk:"id"`
	IsCustom types.Bool   `tfsdk:"is_custom"`
	Limit    types.Int64  `tfsdk:"limit"`
	Offset   types.Int64  `tfsdk:"offset"`
	Rules    []RuleModel  `tfsdk:"rules"`
}

RulesDataSourceModel is the model for the rules list data source.

func (*RulesDataSourceModel) RefreshFromRemote

func (m *RulesDataSourceModel) RefreshFromRemote(ctx context.Context, diags *diag.Diagnostics, remote []appsecTypes.Rule)

RefreshFromRemote updates the data source model from the SDK response.

func (*RulesDataSourceModel) ToListRequest

ToListRulesRequest converts the data source model to an SDK list request.

Jump to

Keyboard shortcuts

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