processor

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package processor is used to process the library files and read them into a result struct for Alzlib to use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LibArchetype

type LibArchetype struct {
	Name                 string             `json:"name" yaml:"name"`
	PolicyAssignments    mapset.Set[string] `json:"policy_assignments" yaml:"policy_assignments"`
	PolicyDefinitions    mapset.Set[string] `json:"policy_definitions" yaml:"policy_definitions"`
	PolicySetDefinitions mapset.Set[string] `json:"policy_set_definitions" yaml:"policy_set_definitions"`
	RoleDefinitions      mapset.Set[string] `json:"role_definitions" yaml:"role_definitions"`
}

LibArchetype represents an archetype definition file, it used to construct the Archetype struct and is then added to the AlzLib struct.

func (*LibArchetype) UnmarshalJSON added in v0.13.0

func (la *LibArchetype) UnmarshalJSON(data []byte) error

UnmarshalJSON creates a LibArchetype from the supplied JSON bytes.

func (*LibArchetype) UnmarshalYAML added in v0.18.4

func (la *LibArchetype) UnmarshalYAML(n *yaml.Node) error

UnmarshalYAML creates a LibArchetype from the supplied JSON bytes.

type LibArchetypeOverride added in v0.13.0

type LibArchetypeOverride struct {
	Name                         string             `json:"name" yaml:"name"`
	BaseArchetype                string             `json:"base_archetype" yaml:"base_archetype"`
	PolicyAssignmentsToAdd       mapset.Set[string] `json:"policy_assignments_to_add" yaml:"policy_assignments_to_add"`
	PolicyAssignmentsToRemove    mapset.Set[string] `json:"policy_assignments_to_remove" yaml:"policy_assignments_to_remove"`
	PolicyDefinitionsToAdd       mapset.Set[string] `json:"policy_definitions_to_add" yaml:"policy_definitions_to_add"`
	PolicyDefinitionsToRemove    mapset.Set[string] `json:"policy_definitions_to_remove" yaml:"policy_definitions_to_remove"`
	PolicySetDefinitionsToAdd    mapset.Set[string] `json:"policy_set_definitions_to_add" yaml:"policy_set_definitions_to_add"`
	PolicySetDefinitionsToRemove mapset.Set[string] `json:"policy_set_definitions_to_remove" yaml:"policy_set_definitions_to_remove"`
	RoleDefinitionsToAdd         mapset.Set[string] `json:"role_definitions_to_add" yaml:"role_definitions_to_add"`
	RoleDefinitionsToRemove      mapset.Set[string] `json:"role_definitions_to_remove" yaml:"role_definitions_to_remove"`
}

LibArchetypeOverride represents an archetype override definition file, it used to construct generate a new Archetype struct from an existing full archetype and is then added to the AlzLib struct.

func (*LibArchetypeOverride) UnmarshalJSON added in v0.13.0

func (lao *LibArchetypeOverride) UnmarshalJSON(data []byte) error

func (*LibArchetypeOverride) UnmarshalYAML added in v0.18.4

func (lao *LibArchetypeOverride) UnmarshalYAML(n *yaml.Node) error

type LibArchitecture added in v0.14.0

type LibArchitecture struct {
	Name             string                           `json:"name" yaml:"name"`
	ManagementGroups []LibArchitectureManagementGroup `json:"management_groups" yaml:"management_groups"`
}

LibArchitecture represents a management group hierarchy in the library.

func (*LibArchitecture) UnmarshalJSON added in v0.14.0

func (la *LibArchitecture) UnmarshalJSON(data []byte) error

UnmarshalJSON creates a LibArchitecture from the supplied JSON bytes.

func (*LibArchitecture) UnmarshalYAML added in v0.18.4

func (la *LibArchitecture) UnmarshalYAML(n *yaml.Node) error

UnmarshalJSON creates a LibArchitecture from the supplied JSON bytes.

type LibArchitectureManagementGroup added in v0.14.0

type LibArchitectureManagementGroup struct {
	Id          string             `json:"id" yaml:"id"`
	DisplayName string             `json:"display_name" yaml:"display_name"`
	Archetypes  mapset.Set[string] `json:"archetypes" yaml:"archetypes"`
	ParentId    *string            `json:"parent_id" yaml:"parent_id"`
	Exists      bool               `json:"exists" yaml:"exists"`
}

LibArchitectureManagementGroup represents a management group in the library.

type LibDefaultPolicyValue added in v0.19.0

type LibDefaultPolicyValue struct {
	Name              string                             `json:"name" yaml:"name"`
	PolicyAssignments []LibDefaultPolicyValueAssignments `json:"policy_assignments" yaml:"policy_assignments"`
}

LibDefaultPolicyValue represents the default policy values that allow a single value to be mapped into different assignments.

type LibDefaultPolicyValueAssignments added in v0.19.0

type LibDefaultPolicyValueAssignments struct {
	PolicyAssignmentName string   `json:"policy_assignment_name" yaml:"policy_assignment_name"`
	ParameterNames       []string `json:"parameter_names" yaml:"parameter_names"`
}

type ProcessorClient

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

ProcessorClient is the client that is used to process the library files.

func NewProcessorClient

func NewProcessorClient(fs fs.FS) *ProcessorClient

func (*ProcessorClient) Process

func (client *ProcessorClient) Process(res *Result) error

type Result

type Result struct {
	PolicyDefinitions      map[string]*armpolicy.Definition
	PolicySetDefinitions   map[string]*armpolicy.SetDefinition
	PolicyAssignments      map[string]*armpolicy.Assignment
	RoleDefinitions        map[string]*armauthorization.RoleDefinition
	LibArchetypes          map[string]*LibArchetype
	LibArchetypeOverrides  map[string]*LibArchetypeOverride
	LibDefaultPolicyValues map[string]*LibDefaultPolicyValue
	LibArchitectures       map[string]*LibArchitecture
}

Result is the structure that gets built by scanning the library files.

Jump to

Keyboard shortcuts

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