gcpBind

package module
v0.6.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

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