hoststore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UI   = Source("UI")
	SCAN = Source("SCAN")
)

Source constants

View Source
const (
	SSH   = Scheme("SSH")
	RDP   = Scheme("RDP")
	VNC   = Scheme("VNC")
	HTTP  = Scheme("HTTP")
	HTTPS = Scheme("HTTPS")
)

Scheme constants, all supported protocols

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address string

Address is fully qualified domain names, IPv4 or IPv6 addresses of the host

type Host

type Host struct {
	ID         string      `json:"id,omitempty"`
	Name       string      `json:"common_name,omitempty"`
	Addresses  []Address   `json:"addresses,omitempty"`
	Services   []Service   `json:"services,omitempty"`
	Principals []Principal `json:"principals,omitempty"`
}

Host defines PrivX target

type HostStore

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

HostStore is a role-store client instance.

func New

func New(api restapi.Connector) *HostStore

New creates a new host-store client instance See http://apispecs.ssh.com/#swagger-ui-4 for details about api

func (*HostStore) RegisterHost

func (store *HostStore) RegisterHost(host Host) (string, error)

RegisterHost append a target to PrivX

type Principal

type Principal struct {
	ID     string              `json:"principal"`
	Roles  []rolestore.RoleRef `json:"roles"`
	Source Source              `json:"source"`
}

Principal of the target host

func NewPrincipal

func NewPrincipal(id string, role ...rolestore.RoleRef) Principal

NewPrincipal creates a corresponding definition from roles

type Scheme

type Scheme string

Scheme of protocols allowed by the host

func (Scheme) Service

func (scheme Scheme) Service(addr Address, port int) Service

Service creates a corresponding service definition

hosts.SSH.Service(...)

type Service

type Service struct {
	Scheme  Scheme  `json:"service"`
	Address Address `json:"address"`
	Port    int     `json:"port"`
	Source  Source  `json:"source"`
}

Service specify the service available on target host

type Source

type Source string

Source of host objects

Jump to

Keyboard shortcuts

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