gcpBind

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignments

type Assignments struct {
	BindAssignments []*BindAssignment
}

func (*Assignments) UnmarshalJSON

func (d *Assignments) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type BindAssignment

type BindAssignment struct {
	ResourceId string        `json:"resource_id"`
	Bindings   []iam.Binding `json:"bindings"`
}

BindAssignment is an array of GCP Bindings combined with a resource identifier.

func ParseBindings

func ParseBindings(bindingBytes []byte) ([]*BindAssignment, error)

ParseBindings will read either an iam.Binding or GcpBindAssignment structure and returns a []*GcpBindAssignment type. Note that if a single binding is provided, the GcpBindAssignment.ResourceId value will be nil

func ParseFile

func ParseFile(path string) ([]*BindAssignment, error)

ParseFile will load a file from the specified path and will auto-detect format and convert to GcpBindAssignment. See ParseBindings

type GooglePolicyMapper

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

func New

func New(nameMap map[string]string) *GooglePolicyMapper

func (*GooglePolicyMapper) MapBindingAssignmentToPolicy

func (m *GooglePolicyMapper) MapBindingAssignmentToPolicy(bindAssignment BindAssignment) ([]hexapolicy.PolicyInfo, error)

func (*GooglePolicyMapper) MapBindingAssignmentsToPolicy

func (m *GooglePolicyMapper) MapBindingAssignmentsToPolicy(bindAssignments []*BindAssignment) ([]hexapolicy.PolicyInfo, error)

func (*GooglePolicyMapper) MapBindingToPolicy

func (m *GooglePolicyMapper) MapBindingToPolicy(objectId string, binding iam.Binding) (hexapolicy.PolicyInfo, error)

func (*GooglePolicyMapper) MapPoliciesToBindings

func (m *GooglePolicyMapper) MapPoliciesToBindings(policies []hexapolicy.PolicyInfo) []*BindAssignment

func (*GooglePolicyMapper) MapPolicyToBinding

func (m *GooglePolicyMapper) MapPolicyToBinding(policy hexapolicy.PolicyInfo) (*iam.Binding, error)

func (*GooglePolicyMapper) Name

func (m *GooglePolicyMapper) Name() string

Jump to

Keyboard shortcuts

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