acmd

package
v0.0.0-...-fc2a63e Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: BSD-3-Clause, MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcmPerm

type AcmPerm string

func NewAcmPerm

func NewAcmPerm(value string) (*AcmPerm, error)

func (*AcmPerm) MarshalJSON

func (p *AcmPerm) MarshalJSON() ([]byte, error)

func (*AcmPerm) String

func (p *AcmPerm) String() string

func (*AcmPerm) UnmarshalJSON

func (p *AcmPerm) UnmarshalJSON(value []byte) error

func (*AcmPerm) Validate

func (p *AcmPerm) Validate() error

type AcmV1Config

type AcmV1Config struct {
	Enable              bool   `rfc7951:"vyatta-system-acm-configd-v1:enable,emptyleaf" json:"enabled"`
	LogReq              bool   `rfc7951:"vyatta-system-acm-configd-v1:log-requests,emptyleaf" json:"log-requests"`
	CreateDefault       Action `rfc7951:"vyatta-system-acm-configd-v1:create-default" json:"create-default"`
	ReadDefault         Action `rfc7951:"vyatta-system-acm-configd-v1:read-default" json:"read-default"`
	UpdateDefault       Action `rfc7951:"vyatta-system-acm-configd-v1:update-default" json:"update-default"`
	DeleteDefault       Action `rfc7951:"vyatta-system-acm-configd-v1:delete-default" json:"delete-default"`
	RpcDefault          Action `rfc7951:"vyatta-system-acm-configd-v1:rpc-default" json:"rpc-default"`
	NotificationDefault Action `rfc7951:"vyatta-system-acm-configd-v1:notification-default" json:"notification-default"`
	Ruleset             struct {
		Rule []*AcmV1Rule `rfc7951:"rule"`
	} `rfc7951:"vyatta-system-acm-configd-v1:ruleset" json:"-"`
	RpcRuleset struct {
		Rule []*AcmV1RpcRule `rfc7951:"rule"`
	} `rfc7951:"vyatta-system-acm-configd-v1:rpc-ruleset" json:"-"`
	NotificationRuleset struct {
		Rule []*AcmV1NotificationRule `rfc7951:"rule"`
	} `rfc7951:"vyatta-system-acm-configd-v1:notification-ruleset" json:"-"`
}

type AcmV1NotificationRule

type AcmV1NotificationRule struct {
	RuleNumber   uint32   `rfc7951:"rule-number" json:"-"`
	Notification *string  `rfc7951:"notification-name" json:"notification-name"`
	Module       string   `rfc7951:"module-name"`
	Action       Action   `rfc7951:"action" json:"action"`
	Groups       []string `rfc7951:"group" json:"groups"`
}

type AcmV1RpcRule

type AcmV1RpcRule struct {
	RuleNumber uint32   `rfc7951:"rule-number" json:"-"`
	Rpc        *string  `rfc7951:"rpc-name" json:"rpc-name"`
	Module     string   `rfc7951:"module-name"`
	Action     Action   `rfc7951:"action" json:"action"`
	Groups     []string `rfc7951:"group" json:"groups"`
}

type AcmV1Rule

type AcmV1Rule struct {
	RuleNumber uint32   `rfc7951:"tagnode" json:"-"`
	Path       *string  `rfc7951:"path" json:"path"`
	Action     Action   `rfc7951:"action" json:"action"`
	Groups     []string `rfc7951:"group" json:"groups"`
	Log        bool     `rfc7951:"log,emptyleaf" json:"log"`
	Operation  AcmPerm  `rfc7951:"operation" json:"perm"`
}

type AcmdConfig

type AcmdConfig struct {
	System struct {
		Acm struct {
			*AcmV1Config
		} `rfc7951:"vyatta-system-acm-v1:acm,omitempty"`
	} `rfc7951:"vyatta-system-v1:system"`
}

type Action

type Action string

func NewAction

func NewAction(value string) (*Action, error)

func (*Action) MarshalJSON

func (a *Action) MarshalJSON() ([]byte, error)

func (*Action) String

func (a *Action) String() string

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(value []byte) error

func (*Action) Validate

func (a *Action) Validate() error

type Busconfig

type Busconfig struct {
	XMLName  xml.Name `xml:"busconfig"`
	Policies []*Policy
}

type Config

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

func NewConfig

func NewConfig(state *State) *Config

func (*Config) Check

func (c *Config) Check(cfg *AcmdConfig) error

func (*Config) Get

func (c *Config) Get() *AcmdConfig

func (*Config) Set

func (c *Config) Set(cfg *AcmdConfig) error

type Policy

type Policy struct {
	XMLName xml.Name `xml:"policy"`
	Context string   `xml:"context,attr,omitempty"`
	Group   string   `xml:"group,attr,omitempty"`
	Rules   []*Rule  `xml:"-,omitempty"`
}

func (*Policy) Defaults

func (p *Policy) Defaults(notification string) *Policy

A D-Bus policy that is applies the Notification default actions

type Rule

type Rule struct {
	Action string
	RuleAttributes
}

func (*Rule) MarshalXML

func (r *Rule) MarshalXML(e *xml.Encoder, start xml.StartElement) error

This is required to allow a dynamic Action for each rule allow/deny

type RuleAttributes

type RuleAttributes struct {
	RcvType       string `xml:"receive_type,attr,omitempty"`
	RcvInterface  string `xml:"receive_interface,attr,omitempty"`
	RcvMember     string `xml:"receive_member,attr,omitempty"`
	SendType      string `xml:"send_type,attr,omitempty"`
	SendInterface string `xml:"send_interface,attr,omitempty"`
	SendMember    string `xml:"send_member,attr,omitempty"`
}

type State

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

func NewState

func NewState() *State

func (*State) Get

func (s *State) Get() *AcmdConfig

Jump to

Keyboard shortcuts

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