Documentation ¶
Index ¶
- Constants
- func CreateBorder0Config(ctx context.Context, nodesMap map[string]nodes.Node, labname string) (string, error)
- func Login(ctx context.Context, email, password string) error
- func ParseSocketCfg(s, host string) (*configSocket, error)
- func RefreshLogin(ctx context.Context) error
- func Request(ctx context.Context, method string, url string, targetStruct interface{}, ...) error
- type AddSocketToPolicyRequest
- type Condition
- type ConditionWhat
- type ConditionWhen
- type ConditionWhere
- type ConditionWho
- type CreatePolicyRequest
- type ErrorMessage
- type LoginRefreshResponse
- type LoginRequest
- type LoginResponse
- type Policy
- type PolicyActionUpdateRequest
- type PolicyData
- type Socket
- type StaticSocketsConfig
- type Tunnel
- type UpdatePolicyRequest
Constants ¶
View Source
const ( ENV_NAME_BORDER0_ADMIN_TOKEN = "BORDER0_ADMIN_TOKEN" ENV_NAME_BORDER0_API = "BORDER0_API" )
Variables ¶
This section is empty.
Functions ¶
func CreateBorder0Config ¶
func CreateBorder0Config(ctx context.Context, nodesMap map[string]nodes.Node, labname string) (string, error)
CreateBorder0Config inspects the `publish` section of the nodes configuration and builds a configuration for the border0.com cli clients "Static Sockets plugin" [https://docs.border0.com/docs/static-sockets-plugin]
func Login ¶
Login performs a login to border0.com and stores the retrieved the access-token in the cwd.
func ParseSocketCfg ¶
ParseSocketCfg parses the nodes publish configuration string and returns resulting *configSocket.
func RefreshLogin ¶
RefreshLogin checking the validity of the login token as well as it.
Types ¶
type AddSocketToPolicyRequest ¶
type AddSocketToPolicyRequest struct {
Actions []PolicyActionUpdateRequest `json:"actions" binding:"required"`
}
type Condition ¶
type Condition struct { Who ConditionWho `json:"who,omitempty" mapstructure:"who"` Where ConditionWhere `json:"where,omitempty" mapstructure:"where"` When ConditionWhen `json:"when,omitempty" mapstructure:"when"` }
type ConditionWhat ¶
type ConditionWhat struct{}
type ConditionWhen ¶
type ConditionWhen struct { After string `json:"after,omitempty" mapstructure:"after"` Before string `json:"before,omitempty" mapstructure:"before"` TimeOfDayAfter string `json:"time_of_day_after,omitempty" mapstructure:"time_of_day_after"` TimeOfDayBefore string `json:"time_of_day_before,omitempty" mapstructure:"time_of_day_before"` }
type ConditionWhere ¶
type ConditionWho ¶
type CreatePolicyRequest ¶
type CreatePolicyRequest struct { Name string `json:"name" binding:"required"` Description string `json:"description"` PolicyData PolicyData `json:"policy_data" binding:"required"` Orgwide bool `json:"org_wide"` }
type ErrorMessage ¶
type ErrorMessage struct {
ErrorMessage string `json:"error_message,omitempty"`
}
type LoginRefreshResponse ¶
type LoginRefreshResponse struct {
Token string `json:"token"`
}
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct { LoginRefreshResponse MFA bool `json:"require_mfa"` }
type Policy ¶
type PolicyData ¶
type Socket ¶
type Socket struct { Tunnels []Tunnel `json:"tunnels,omitempty"` Username string `json:"user_name,omitempty"` SocketID string `json:"socket_id,omitempty"` SocketTcpPorts []int `json:"socket_tcp_ports,omitempty"` Dnsname string `json:"dnsname,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` SocketType string `json:"socket_type,omitempty"` ProtectedSocket bool `json:"protected_socket"` ProtectedUsername string `json:"protected_username"` ProtectedPassword string `json:"protected_password"` AllowedEmailAddresses []string `json:"cloud_authentication_email_allowed_addressses,omitempty"` AllowedEmailDomains []string `json:"cloud_authentication_email_allowed_domains,omitempty"` SSHCa string `json:"ssh_ca,omitempty"` UpstreamUsername string `json:"upstream_username,omitempty"` UpstreamPassword string `json:"upstream_password,omitempty"` UpstreamHttpHostname string `json:"upstream_http_hostname,omitempty"` UpstreamType string `json:"upstream_type,omitempty"` CloudAuthEnabled bool `json:"cloud_authentication_enabled,omitempty"` ConnectorAuthenticationEnabled bool `json:"connector_authentication_enabled,omitempty"` Tags map[string]string `json:"tags,omitempty"` CustomDomains []string `json:"custom_domains,omitempty"` PrivateSocket bool `json:"private_socket"` PolicyNames []string `json:"policy_names,omitempty"` }
func (*Socket) SanitizeName ¶
func (s *Socket) SanitizeName()
type StaticSocketsConfig ¶
type StaticSocketsConfig struct { Connector *configConnector `yaml:"connector"` Credentials *configCredentials `yaml:"credentials"` Sockets []map[string]*configSocket `yaml:"sockets"` }
type UpdatePolicyRequest ¶
type UpdatePolicyRequest struct { Name *string `json:"name"` Description *string `json:"description"` PolicyData *PolicyData `json:"policy_data" binding:"required"` }
Click to show internal directories.
Click to hide internal directories.