Documentation ¶
Index ¶
- func BuildFilterRules(policy *ACLPolicy, dst *Machine, peers []Machine) []tailcfg.FilterRule
- func IsValidPeer(policy *ACLPolicy, src *Machine, dest *Machine) bool
- type ACL
- type ACLPolicy
- type Account
- type AllowIPs
- type AuthFilter
- type AuthFilters
- type AuthKey
- type AuthMethod
- type ControlKeys
- type DNSConfig
- type Endpoints
- type HostInfo
- type IP
- type Machine
- func (m *Machine) HasIP(v netaddr.IP) bool
- func (m *Machine) HasTag(tag string) bool
- func (m *Machine) HasTags() bool
- func (m *Machine) HasUser(loginName string) bool
- func (m *Machine) IsAllowedIP(i netaddr.IP) bool
- func (m *Machine) IsAllowedIPPrefix(i netaddr.IPPrefix) bool
- func (m *Machine) IsExpired() bool
- type Machines
- type RegistrationRequest
- type RegistrationRequestData
- type Repository
- type ServerConfig
- type StringSet
- type Tags
- type Tailnet
- type TailnetConfig
- type TailnetRole
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFilterRules ¶
func BuildFilterRules(policy *ACLPolicy, dst *Machine, peers []Machine) []tailcfg.FilterRule
Types ¶
type AllowIPs ¶
func (AllowIPs) GormDBDataType ¶
GormDBDataType gorm db data type
func (AllowIPs) GormDataType ¶
GormDataType gorm common data type
type AuthFilter ¶
type AuthFilter struct { ID uint64 `gorm:"primary_key;autoIncrement:false"` Expr string AuthMethodID uint64 AuthMethod AuthMethod TailnetID *uint64 Tailnet *Tailnet }
func (*AuthFilter) Evaluate ¶
func (f *AuthFilter) Evaluate(v interface{}) (bool, error)
type AuthFilters ¶
type AuthFilters []AuthFilter
func (AuthFilters) Evaluate ¶
func (fs AuthFilters) Evaluate(v interface{}) []Tailnet
type AuthKey ¶
type AuthMethod ¶
type ControlKeys ¶ added in v0.2.0
type ControlKeys struct { ControlKey key.MachinePrivate LegacyControlKey key.MachinePrivate }
type Endpoints ¶
type Endpoints []string
func (Endpoints) GormDBDataType ¶
GormDBDataType gorm db data type
func (Endpoints) GormDataType ¶
GormDataType gorm common data type
type HostInfo ¶
func (HostInfo) GormDBDataType ¶
GormDBDataType gorm db data type
func (HostInfo) GormDataType ¶
GormDataType gorm common data type
type Machine ¶
type Machine struct { ID uint64 `gorm:"primary_key;autoIncrement:false"` Name string NameIdx uint64 MachineKey string NodeKey string DiscoKey string Ephemeral bool RegisteredTags Tags Tags Tags HostInfo HostInfo Endpoints Endpoints AllowIPs AllowIPs IPv4 IP IPv6 IP CreatedAt time.Time ExpiresAt *time.Time LastSeen *time.Time UserID uint64 User User TailnetID uint64 Tailnet Tailnet }
type RegistrationRequest ¶
type RegistrationRequest struct { MachineKey string `gorm:"primary_key;autoIncrement:false"` Key string `gorm:"type:varchar(64);unique_index"` Data RegistrationRequestData CreatedAt time.Time Authenticated bool Error string }
func (*RegistrationRequest) IsFinished ¶
func (r *RegistrationRequest) IsFinished() bool
type RegistrationRequestData ¶
type RegistrationRequestData tailcfg.RegisterRequest
func (RegistrationRequestData) GormDBDataType ¶
GormDBDataType gorm db data type
func (RegistrationRequestData) GormDataType ¶
func (RegistrationRequestData) GormDataType() string
GormDataType gorm common data type
func (*RegistrationRequestData) Scan ¶
func (hi *RegistrationRequestData) Scan(destination interface{}) error
type Repository ¶
type Repository interface { GetControlKeys(ctx context.Context) (*ControlKeys, error) SetControlKeys(ctx context.Context, v *ControlKeys) error GetDERPMap(ctx context.Context) (*tailcfg.DERPMap, error) SetDERPMap(ctx context.Context, v *tailcfg.DERPMap) error SaveAuthMethod(ctx context.Context, m *AuthMethod) error ListAuthMethods(ctx context.Context) ([]AuthMethod, error) GetAuthMethod(ctx context.Context, id uint64) (*AuthMethod, error) GetAuthFilter(ctx context.Context, id uint64) (*AuthFilter, error) SaveAuthFilter(ctx context.Context, m *AuthFilter) error ListAuthFilters(ctx context.Context) (AuthFilters, error) ListAuthFiltersByAuthMethod(ctx context.Context, authMethodID uint64) (AuthFilters, error) DeleteAuthFilter(ctx context.Context, id uint64) error DeleteAuthFiltersByTailnet(ctx context.Context, tailnetID uint64) error GetAccount(ctx context.Context, accountID uint64) (*Account, error) GetOrCreateAccount(ctx context.Context, authMethodID uint64, externalID, loginName string) (*Account, bool, error) GetOrCreateTailnet(ctx context.Context, name string) (*Tailnet, bool, error) GetTailnet(ctx context.Context, id uint64) (*Tailnet, error) ListTailnets(ctx context.Context) ([]Tailnet, error) DeleteTailnet(ctx context.Context, id uint64) error GetDNSConfig(ctx context.Context, tailnetID uint64) (*DNSConfig, error) SetDNSConfig(ctx context.Context, tailnetID uint64, config *DNSConfig) error DeleteDNSConfig(ctx context.Context, tailnetID uint64) error GetACLPolicy(ctx context.Context, tailnetID uint64) (*ACLPolicy, error) SetACLPolicy(ctx context.Context, tailnetID uint64, policy *ACLPolicy) error DeleteACLPolicy(ctx context.Context, tailnetID uint64) error GetAuthKey(ctx context.Context, id uint64) (*AuthKey, error) SaveAuthKey(ctx context.Context, key *AuthKey) error DeleteAuthKey(ctx context.Context, id uint64) (bool, error) DeleteAuthKeysByTailnet(ctx context.Context, tailnetID uint64) error ListAuthKeys(ctx context.Context, tailnetID uint64) ([]AuthKey, error) LoadAuthKey(ctx context.Context, key string) (*AuthKey, error) GetOrCreateServiceUser(ctx context.Context, tailnet *Tailnet) (*User, bool, error) ListUsers(ctx context.Context, tailnetID uint64) (Users, error) GetOrCreateUserWithAccount(ctx context.Context, tailnet *Tailnet, account *Account) (*User, bool, error) DeleteUsersByTailnet(ctx context.Context, tailnetID uint64) error SaveMachine(ctx context.Context, m *Machine) error DeleteMachine(ctx context.Context, id uint64) (bool, error) GetMachine(ctx context.Context, id uint64) (*Machine, error) GetMachineByKey(ctx context.Context, tailnetID uint64, key string) (*Machine, error) GetMachineByKeys(ctx context.Context, machineKey string, nodeKey string) (*Machine, error) CountMachinesWithIPv4(ctx context.Context, ip string) (int64, error) GetNextMachineNameIndex(ctx context.Context, tailnetID uint64, name string) (uint64, error) ListMachineByTailnet(ctx context.Context, tailnetID uint64) (Machines, error) CountMachineByTailnet(ctx context.Context, tailnetID uint64) (int64, error) DeleteMachineByTailnet(ctx context.Context, tailnetID uint64) error ListMachinePeers(ctx context.Context, tailnetID uint64, key string) (Machines, error) ListInactiveEphemeralMachines(ctx context.Context, checkpoint time.Time) (Machines, error) SetMachineLastSeen(ctx context.Context, machineID uint64) error ExpireMachineByAuthMethod(ctx context.Context, authMethodID uint64) (int64, error) SaveRegistrationRequest(ctx context.Context, request *RegistrationRequest) error GetRegistrationRequestByKey(ctx context.Context, key string) (*RegistrationRequest, error) GetRegistrationRequestByMachineKey(ctx context.Context, key string) (*RegistrationRequest, error) Transaction(func(rp Repository) error) error }
func NewRepository ¶
func NewRepository(db *gorm.DB) Repository
type ServerConfig ¶
type ServerConfig struct { Key configKey `gorm:"primary_key"` Value []byte }
type TailnetConfig ¶
type TailnetRole ¶
type TailnetRole string
const ( TailnetRoleService TailnetRole = "service" TailnetRoleMember TailnetRole = "member" )
Click to show internal directories.
Click to hide internal directories.