firewaller

package
v0.0.0-...-3d086f3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModelFirewallRulesWatcher

func NewModelFirewallRulesWatcher(st State) (*modelFirewallRulesWatcher, error)

NewModelFirewallRulesWatcher returns a worker that notifies when a change to something determining the model firewall rules takes place

NOTE: At this time, ssh-allow model config item is the only thing that needs to be watched

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

func StateShim

func StateShim(st *state.State, m *state.Model) stateShim

TODO(wallyworld) - for tests, remove when remaining firewaller tests become unit tests.

Types

type ControllerConfigAPI

type ControllerConfigAPI interface {
	// ControllerConfig returns the controller's configuration.
	ControllerConfig() (params.ControllerConfigResult, error)

	// ControllerAPIInfoForModels returns the controller api connection details for the specified models.
	ControllerAPIInfoForModels(args params.Entities) (params.ControllerAPIInfoResults, error)
}

ControllerConfigAPI provides the subset of common.ControllerConfigAPI required by the remote firewaller facade

type FirewallerAPI

FirewallerAPI provides access to the Firewaller API facade.

func NewStateFirewallerAPI

func NewStateFirewallerAPI(
	st State,
	resources facade.Resources,
	authorizer facade.Authorizer,
	cloudSpecAPI cloudspec.CloudSpecer,
	controllerConfigAPI ControllerConfigAPI,
) (*FirewallerAPI, error)

NewStateFirewallerAPI creates a new server-side FirewallerAPIV7 facade.

func (*FirewallerAPI) AreManuallyProvisioned

func (f *FirewallerAPI) AreManuallyProvisioned(args params.Entities) (params.BoolResults, error)

AreManuallyProvisioned returns whether each given entity is manually provisioned or not. Only machine tags are accepted.

func (*FirewallerAPI) GetAssignedMachine

func (f *FirewallerAPI) GetAssignedMachine(args params.Entities) (params.StringResults, error)

GetAssignedMachine returns the assigned machine tag (if any) for each given unit.

func (*FirewallerAPI) GetExposeInfo

func (f *FirewallerAPI) GetExposeInfo(args params.Entities) (params.ExposeInfoResults, error)

GetExposeInfo returns the expose flag and per-endpoint expose settings for the specified applications.

func (*FirewallerAPI) MacaroonForRelations

func (f *FirewallerAPI) MacaroonForRelations(args params.Entities) (params.MacaroonResults, error)

MacaroonForRelations returns the macaroon for the specified relations.

func (*FirewallerAPI) ModelFirewallRules

func (f *FirewallerAPI) ModelFirewallRules() (params.IngressRulesResult, error)

ModelFirewallRules returns the firewall rules that this model is configured to open

func (*FirewallerAPI) OpenedMachinePortRanges

func (f *FirewallerAPI) OpenedMachinePortRanges(args params.Entities) (params.OpenMachinePortRangesResults, error)

OpenedMachinePortRanges returns a list of the opened port ranges for the specified machines where each result is broken down by unit. The list of opened ports for each unit is further grouped by endpoint name and includes the subnet CIDRs that belong to the space that each endpoint is bound to.

func (*FirewallerAPI) SetRelationsStatus

func (f *FirewallerAPI) SetRelationsStatus(args params.SetStatus) (params.ErrorResults, error)

SetRelationsStatus sets the status for the specified relations.

func (*FirewallerAPI) SpaceInfos

SpaceInfos returns a comprehensive representation of either all spaces or a filtered subset of the known spaces and their associated subnet details.

func (*FirewallerAPI) WatchEgressAddressesForRelations

func (f *FirewallerAPI) WatchEgressAddressesForRelations(relations params.Entities) (params.StringsWatchResults, error)

WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which connections will originate for the relation, change. Each event contains the entire set of addresses which are required for ingress for the relation.

func (*FirewallerAPI) WatchIngressAddressesForRelations

func (f *FirewallerAPI) WatchIngressAddressesForRelations(relations params.Entities) (params.StringsWatchResults, error)

WatchIngressAddressesForRelations creates a watcher that returns the ingress networks that have been recorded against the specified relations.

func (*FirewallerAPI) WatchModelFirewallRules

func (f *FirewallerAPI) WatchModelFirewallRules() (params.NotifyWatchResult, error)

WatchModelFirewallRules returns a NotifyWatcher that notifies of potential changes to a model's configured firewall rules

func (*FirewallerAPI) WatchOpenedPorts

func (f *FirewallerAPI) WatchOpenedPorts(args params.Entities) (params.StringsWatchResults, error)

WatchOpenedPorts returns a new StringsWatcher for each given model tag.

func (*FirewallerAPI) WatchSubnets

func (f *FirewallerAPI) WatchSubnets(args params.Entities) (params.StringsWatchResult, error)

WatchSubnets returns a new StringsWatcher that watches the specified subnet tags or all tags if no entities are specified.

type State

type State interface {
	firewall.State

	ControllerConfig() (controller.Config, error)
	IsController() bool
	ModelUUID() string
	GetMacaroon(entity names.Tag) (*macaroon.Macaroon, error)
	WatchOpenedPorts() state.StringsWatcher
	FindEntity(tag names.Tag) (state.Entity, error)
	AllEndpointBindings() (map[string]map[string]string, error)
	SpaceInfos() (network.SpaceInfos, error)
}

State provides the subset of global state required by the remote firewaller facade.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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