models

package
v0.0.0-...-4ceb61e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name         string        `json:"name,omitempty"`
	Email        string        `json:"email,omitempty"`
	UserID       string        `json:"user_id,omitempty"`
	SshUsername  string        `json:"user_name,omitempty"`
	SshKey       string        `json:"sshkey,omitempty"`
	Organization *Organization `json:"primary_organization"`
}

type AddSocketToPolicyRequest

type AddSocketToPolicyRequest struct {
	Actions []PolicyActionUpdateRequest `json:"actions" binding:"required"`
}

type ClientResource

type ClientResource struct {
	PrivateSocket bool     `json:"private_socket,omitempty"`
	IPAddress     string   `json:"ip_address,omitempty"`
	SocketType    string   `json:"socket_type,omitempty"`
	SocketName    string   `json:"socket_name,omitempty"`
	Description   string   `json:"description,omitempty"`
	SocketPorts   []int    `json:"socket_ports,omitempty"`
	Domains       []string `json:"domains,omitempty"`
}

func (ClientResource) DomainsToString

func (c ClientResource) DomainsToString() string

func (ClientResource) FirstDomain

func (c ClientResource) FirstDomain(defaultValue string) string

func (ClientResource) HasDomain

func (c ClientResource) HasDomain(tryToFind string) bool

func (ClientResource) Hostname

func (c ClientResource) Hostname() string

func (ClientResource) Instruction

func (c ClientResource) Instruction() string

type ClientResources

type ClientResources struct {
	RefreshHint        int              `json:"refresh_hint,omitempty"`
	Resources          []ClientResource `json:"resources,omitempty"`
	DefaultIPAddresses []string         `json:"ip_addresses,omitempty"`
}

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 ConditionWhere struct {
	AllowedIP  []string `json:"allowed_ip,omitempty" mapstructure:"allowed_ip"`
	Country    []string `json:"country,omitempty" mapstructure:"country"`
	CountryNot []string `json:"country_not,omitempty" mapstructure:"country_not"`
}

type ConditionWho

type ConditionWho struct {
	Email  []string `json:"email,omitempty" mapstructure:"email"`
	Domain []string `json:"domain,omitempty" mapstructure:"domain"`
}

type ConnectorData

type ConnectorData struct {
	Name           string
	Connector      string
	Type           string
	Port           int
	TargetHostname string
	PolicyGroup    string
	Ec2Tag         string
	InstanceId     string
	PluginName     string
}

func (*ConnectorData) Key

func (c *ConnectorData) Key() string

func (*ConnectorData) Tags

func (c *ConnectorData) Tags() map[string]string

type CreatePolicyRequest

type CreatePolicyRequest struct {
	Name        string     `json:"name" binding:"required"`
	Description string     `json:"description"`
	PolicyData  PolicyData `json:"policy_data" binding:"required"`
}

type LoginForm

type LoginForm struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginRefresh

type LoginRefresh struct {
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
	MFA   bool   `json:"require_mfa"`
}

type MfaForm

type MfaForm struct {
	Code string `json:"code"`
}

type Organization

type Organization struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	Certificates map[string]string `json:"certificate"`
}

type Policy

type Policy struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	PolicyData  PolicyData `json:"policy_data"`
	SocketIDs   []string   `json:"socket_ids"`
}

type PolicyActionUpdateRequest

type PolicyActionUpdateRequest struct {
	Action string `json:"action" binding:"required"`
	ID     string `json:"id" binding:"required"`
}

type PolicyData

type PolicyData struct {
	Version   string    `json:"version"`
	Action    []string  `json:"action" mapstructure:"action"`
	Condition Condition `json:"condition" mapstructure:"condition"`
}

type RegisterForm

type RegisterForm struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Sshkey   string `json:"sshkey"`
}

type SessionTokenForm

type SessionTokenForm struct {
	Token string `json:"token"`
	MFA   bool   `json:"require_mfa"`
	State string `json:"state"`
}

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"`
	Tags                  map[string]string `json:"tags,omitempty"`
	CustomDomains         []string          `json:"custom_domains,omitempty"`
	PrivateSocket         bool              `json:"private_socket"`
	PolicyNames           []string          `json:"policy_names,omitempty"`
	Policies              []Policy          `json:"policies,omitempty"`

	TargetHostname string         `json:"-"`
	TargetPort     int            `json:"-"`
	PolicyGroup    string         `json:"-"`
	Ec2Tag         string         `json:"-"`
	InstanceId     string         `json:"-"`
	PluginName     string         `json:"-"`
	ConnectorData  *ConnectorData `json:"-"`
}

func (*Socket) BuildConnectorData

func (s *Socket) BuildConnectorData(connectorName string)

func (*Socket) BuildConnectorDataAndTags

func (s *Socket) BuildConnectorDataAndTags(connectorName string)

func (*Socket) BuildConnectorDataByTags

func (s *Socket) BuildConnectorDataByTags()

func (*Socket) SanitizeName

func (s *Socket) SanitizeName()

func (*Socket) SetupTypeAndUpstreamTypeByPortOrTags

func (s *Socket) SetupTypeAndUpstreamTypeByPortOrTags()

type SshCsr

type SshCsr struct {
	SSHPublicKey  string `json:"ssh_public_key"`
	SSHSignedCert string `json:"signed_ssh_cert,omitempty"`
}

type SwitchOrgRequest

type SwitchOrgRequest struct {
	OrgName string `json:"org_name"`
}

type SwitchOrgResponse

type SwitchOrgResponse struct {
	Token   string `json:"token"`
	OrgName string `json:"org_name"`
	OrgID   string `json:"org_id"`
}

type TokenForm

type TokenForm struct {
	Token string `json:"token"`
	MFA   bool   `json:"require_mfa"`
}

type Tunnel

type Tunnel struct {
	TunnelID     string `json:"tunnel_id,omitempty"`
	LocalPort    int    `json:"local_port,omitempty"`
	TunnelServer string `json:"tunnel_server,omitempty"`
}

type UpdatePolicyRequest

type UpdatePolicyRequest struct {
	Name        *string     `json:"name"`
	Description *string     `json:"description"`
	PolicyData  *PolicyData `json:"policy_data" binding:"required"`
}

Jump to

Keyboard shortcuts

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