Documentation ¶
Index ¶
- Constants
- func AdjustServerName(servername string) string
- func AdjustUserName(username string) string
- func CopyConfiguration(fromConfig IKeeperConfiguration, toConfig IKeeperConfiguration)
- func GetTeamKeys(keeperAuth IKeeperAuth, teamKeys map[string][]byte) (errs []error)
- func GetUserPublicKeys(keeperAuth IKeeperAuth, userKeys map[string]*PublicKeys) (errs []error)
- func PrepareApiRequest(keyId int32, payload []byte, transmissionKey []byte, sessionToken []byte, ...) (result *proto_auth.ApiRequest, err error)
- type AccountAuthType
- type DataKeyShareChannel
- type DeviceApprovalChannel
- type DeviceConfiguration
- type DeviceServerConfiguration
- type IAuthContext
- type IConfigurationCollection
- type IConfigurationStorage
- func NewCommanderConfiguration(filename string) IConfigurationStorage
- func NewInMemoryConfigurationStorage(configuration IKeeperConfiguration) IConfigurationStorage
- func NewJsonConfigurationFile(filePath string) IConfigurationStorage
- func NewJsonConfigurationStorage(loader IJsonConfigurationLoader) IConfigurationStorage
- type IConnectedStep
- type IDeviceApprovalStep
- type IDeviceConfiguration
- type IDeviceServerConfiguration
- type IEntityId
- type IErrorStep
- type IJsonConfigurationLoader
- type IKeeperAuth
- type IKeeperConfiguration
- type IKeeperEndpoint
- type ILoginAuth
- type ILoginStep
- type IPasswordStep
- type IPushEndpoint
- type IServerConfiguration
- type ISsoDataKeyStep
- type ISsoLoginInfo
- type ISsoTokenStep
- type ITwoFactorChannelInfo
- type ITwoFactorStep
- type IUserConfiguration
- type IUserDeviceConfiguration
- type KeeperConfiguration
- func (c *KeeperConfiguration) Devices() IConfigurationCollection[IDeviceConfiguration]
- func (c *KeeperConfiguration) LastLogin() string
- func (c *KeeperConfiguration) LastServer() string
- func (c *KeeperConfiguration) Servers() IConfigurationCollection[IServerConfiguration]
- func (c *KeeperConfiguration) SetLastLogin(lastLogin string)
- func (c *KeeperConfiguration) SetLastServer(lastServer string)
- func (c *KeeperConfiguration) Users() IConfigurationCollection[IUserConfiguration]
- type LoginState
- type NotificationEvent
- type PublicKeys
- type PushCallback
- type PushEndpoint
- func (p *PushEndpoint) Close() error
- func (p *PushEndpoint) IsClosed() bool
- func (p *PushEndpoint) Push(event *NotificationEvent)
- func (p *PushEndpoint) RegisterCallback(cb PushCallback)
- func (p *PushEndpoint) RemoveAllCallback()
- func (p *PushEndpoint) RemoveCallback(cb PushCallback)
- func (p *PushEndpoint) SendToPushChannel(_ []byte, _ bool) error
- type ServerConfiguration
- type SessionRestriction
- type TwoFactorChannel
- type TwoFactorDuration
- type TwoFactorPushAction
- type UserConfiguration
- func (u *UserConfiguration) Id() string
- func (u *UserConfiguration) LastDevice() IUserDeviceConfiguration
- func (u *UserConfiguration) Password() string
- func (u *UserConfiguration) Server() string
- func (u *UserConfiguration) SetLastDevice(lastDevice IUserDeviceConfiguration)
- func (u *UserConfiguration) SetPassword(password string)
- func (u *UserConfiguration) SetServer(server string)
- func (u *UserConfiguration) Username() string
- type UserDeviceConfiguration
Constants ¶
View Source
const ( SessionRestriction_Unrestricted SessionRestriction = 0 SessionRestriction_AccountRecovery = 1 << 0 SessionRestriction_AcceptInvite = 1 << 2 SessionRestriction_AccountExpired = 1 << 3 )
View Source
const ClientVersion = "c16.9.0"
View Source
const DefaultDeviceName = "GoLang Keeper API"
View Source
const DefaultKeeperServer = "keepersecurity.com"
View Source
const DefaultLocale = "en_US"
Variables ¶
This section is empty.
Functions ¶
func AdjustServerName ¶
func AdjustUserName ¶
func CopyConfiguration ¶
func CopyConfiguration(fromConfig IKeeperConfiguration, toConfig IKeeperConfiguration)
func GetTeamKeys ¶
func GetTeamKeys(keeperAuth IKeeperAuth, teamKeys map[string][]byte) (errs []error)
func GetUserPublicKeys ¶
func GetUserPublicKeys(keeperAuth IKeeperAuth, userKeys map[string]*PublicKeys) (errs []error)
func PrepareApiRequest ¶
func PrepareApiRequest(keyId int32, payload []byte, transmissionKey []byte, sessionToken []byte, locale string) (result *proto_auth.ApiRequest, err error)
Types ¶
type AccountAuthType ¶
type AccountAuthType int32
const ( AuthType_Regular AccountAuthType = iota + 1 AuthType_SsoCloud AuthType_OnsiteSso AuthType_ManagedCompany )
type DeviceApprovalChannel ¶
type DeviceApprovalChannel = int32
const ( DeviceApproval_Email DeviceApprovalChannel = iota DeviceApproval_TwoFactorAuth DeviceApproval_KeeperPush )
type DeviceConfiguration ¶
type DeviceConfiguration struct {
// contains filtered or unexported fields
}
func CloneDeviceConfiguration ¶
func CloneDeviceConfiguration(other IDeviceConfiguration) *DeviceConfiguration
func NewDeviceConfiguration ¶
func NewDeviceConfiguration(deviceToken string, deviceKey []byte) *DeviceConfiguration
func (*DeviceConfiguration) DeviceKey ¶
func (d *DeviceConfiguration) DeviceKey() []byte
func (*DeviceConfiguration) DeviceToken ¶
func (d *DeviceConfiguration) DeviceToken() string
func (*DeviceConfiguration) Id ¶
func (d *DeviceConfiguration) Id() string
func (*DeviceConfiguration) ServerInfo ¶
func (d *DeviceConfiguration) ServerInfo() IConfigurationCollection[IDeviceServerConfiguration]
type DeviceServerConfiguration ¶
type DeviceServerConfiguration struct {
// contains filtered or unexported fields
}
func CloneDeviceServerConfiguration ¶
func CloneDeviceServerConfiguration(other IDeviceServerConfiguration) *DeviceServerConfiguration
func NewDeviceServerConfiguration ¶
func NewDeviceServerConfiguration(server string) *DeviceServerConfiguration
func (*DeviceServerConfiguration) CloneCode ¶
func (ds *DeviceServerConfiguration) CloneCode() string
func (*DeviceServerConfiguration) Id ¶
func (ds *DeviceServerConfiguration) Id() string
func (*DeviceServerConfiguration) Server ¶
func (ds *DeviceServerConfiguration) Server() string
func (*DeviceServerConfiguration) SetCloneCode ¶
func (ds *DeviceServerConfiguration) SetCloneCode(cloneCode string)
type IAuthContext ¶
type IAuthContext interface { Username() string AccountUid() string SessionToken() []byte SessionRestriction() SessionRestriction DataKey() []byte ClientKey() []byte RsaPrivateKey() *rsa.PrivateKey EcPrivateKey() *ecdh.PrivateKey EcPublicKey() *ecdh.PublicKey EnterpriseEcPublicKey() *ecdh.PublicKey EnterpriseRsaPublicKey() *rsa.PublicKey IsEnterpriseAdmin() bool License() *proto_account_summary.License Settings() *proto_account_summary.Settings Enforcements() *proto_account_summary.Enforcements SsoLoginInfo() ISsoLoginInfo DeviceToken() []byte DevicePrivateKey() *ecdh.PrivateKey }
type IConfigurationStorage ¶
type IConfigurationStorage interface { Get() (IKeeperConfiguration, error) Put(IKeeperConfiguration) error }
func NewCommanderConfiguration ¶
func NewCommanderConfiguration(filename string) IConfigurationStorage
func NewInMemoryConfigurationStorage ¶
func NewInMemoryConfigurationStorage(configuration IKeeperConfiguration) IConfigurationStorage
func NewJsonConfigurationFile ¶
func NewJsonConfigurationFile(filePath string) IConfigurationStorage
func NewJsonConfigurationStorage ¶
func NewJsonConfigurationStorage(loader IJsonConfigurationLoader) IConfigurationStorage
type IConnectedStep ¶
type IConnectedStep interface { ILoginStep TakeKeeperAuth() (IKeeperAuth, error) }
type IDeviceApprovalStep ¶
type IDeviceApprovalStep interface { ILoginStep SendPush(DeviceApprovalChannel) error SendCode(DeviceApprovalChannel, string) error Resume() error }
type IDeviceConfiguration ¶
type IDeviceConfiguration interface { IEntityId DeviceToken() string DeviceKey() []byte ServerInfo() IConfigurationCollection[IDeviceServerConfiguration] }
type IErrorStep ¶
type IErrorStep interface { ILoginStep Error() error }
type IJsonConfigurationLoader ¶
func NewJsonConfigurationFileLoader ¶
func NewJsonConfigurationFileLoader(filename string) IJsonConfigurationLoader
type IKeeperAuth ¶
type IKeeperAuth interface { io.Closer Endpoint() IKeeperEndpoint PushNotifications() IPushEndpoint AuthContext() IAuthContext ExecuteAuthCommand(api.IKeeperCommand, api.IKeeperResponse, bool) error ExecuteAuthRest(string, proto.Message, proto.Message) error ExecuteBatch([]api.IKeeperCommand) ([]*api.KeeperApiResponse, error) OnIdle() }
type IKeeperConfiguration ¶
type IKeeperConfiguration interface { Users() IConfigurationCollection[IUserConfiguration] Servers() IConfigurationCollection[IServerConfiguration] Devices() IConfigurationCollection[IDeviceConfiguration] LastLogin() string SetLastLogin(string) LastServer() string SetLastServer(string) }
type IKeeperEndpoint ¶
type IKeeperEndpoint interface { ClientVersion() string SetClientVersion(string) DeviceName() string SetDeviceName(string) Locale() string SetLocale(string) Server() string SetServer(string) ServerKeyId() int32 CommunicateKeeper(string, []byte, []byte) ([]byte, error) PushServer() string ConnectToPushServer(*proto_auth.WssConnectionRequest) (IPushEndpoint, error) ConfigurationStorage() IConfigurationStorage }
func NewKeeperEndpoint ¶
func NewKeeperEndpoint(server string, storage IConfigurationStorage) IKeeperEndpoint
type ILoginAuth ¶
type ILoginAuth interface { io.Closer Endpoint() IKeeperEndpoint Step() ILoginStep Login(string, ...string) LoginSso(string) AlternatePassword() bool SetAlternatePassword(bool) ResumeSession() bool SetResumeSession(bool) OnNextStep() func() SetOnNextStep(func()) OnRegionChanged() func(string) SetOnRegionChanged(func(string)) }
func NewLoginAuth ¶
func NewLoginAuth(endpoint IKeeperEndpoint) ILoginAuth
type ILoginStep ¶
type ILoginStep interface { io.Closer LoginState() LoginState }
type IPasswordStep ¶
type IPushEndpoint ¶
type IPushEndpoint interface { io.Closer IsClosed() bool RegisterCallback(PushCallback) RemoveCallback(PushCallback) RemoveAllCallback() Push(*NotificationEvent) SendToPushChannel([]byte, bool) error }
func NewWebSocketEndpoint ¶
func NewWebSocketEndpoint(url string, key []byte) IPushEndpoint
type IServerConfiguration ¶
type ISsoDataKeyStep ¶
type ISsoDataKeyStep interface { ILoginStep Channels() []DataKeyShareChannel RequestDataKey(DataKeyShareChannel) error Resume() error }
type ISsoLoginInfo ¶
type ISsoTokenStep ¶
type ITwoFactorChannelInfo ¶
type ITwoFactorChannelInfo interface { ChannelType() TwoFactorChannel ChannelName() string ChannelUid() []byte Phone() string PushActions() []TwoFactorPushAction MaxDuration() TwoFactorDuration }
type ITwoFactorStep ¶
type ITwoFactorStep interface { ILoginStep Channels() []ITwoFactorChannelInfo Duration() TwoFactorDuration SetDuration(TwoFactorDuration) SendPush([]byte, TwoFactorPushAction) error SendCode([]byte, string) error Resume() error }
type IUserConfiguration ¶
type IUserConfiguration interface { IEntityId Username() string Password() string Server() string LastDevice() IUserDeviceConfiguration }
type KeeperConfiguration ¶
type KeeperConfiguration struct {
// contains filtered or unexported fields
}
func CloneKeeperConfiguration ¶
func CloneKeeperConfiguration(other IKeeperConfiguration) *KeeperConfiguration
func NewKeeperConfiguration ¶
func NewKeeperConfiguration() *KeeperConfiguration
func (*KeeperConfiguration) Devices ¶
func (c *KeeperConfiguration) Devices() IConfigurationCollection[IDeviceConfiguration]
func (*KeeperConfiguration) LastLogin ¶
func (c *KeeperConfiguration) LastLogin() string
func (*KeeperConfiguration) LastServer ¶
func (c *KeeperConfiguration) LastServer() string
func (*KeeperConfiguration) Servers ¶
func (c *KeeperConfiguration) Servers() IConfigurationCollection[IServerConfiguration]
func (*KeeperConfiguration) SetLastLogin ¶
func (c *KeeperConfiguration) SetLastLogin(lastLogin string)
func (*KeeperConfiguration) SetLastServer ¶
func (c *KeeperConfiguration) SetLastServer(lastServer string)
func (*KeeperConfiguration) Users ¶
func (c *KeeperConfiguration) Users() IConfigurationCollection[IUserConfiguration]
type LoginState ¶
type LoginState = int
const ( LoginState_Ready LoginState = iota + 1 LoginState_DeviceApproval LoginState_TwoFactor LoginState_Password LoginState_SsoToken LoginState_SsoDataKey LoginState_Connected LoginState_Error )
type NotificationEvent ¶
type NotificationEvent struct { Command string `json:"command"` Event string `json:"event"` Message string `json:"message"` Email string `json:"email"` Username string `json:"username"` Approved bool `json:"approved"` Sync bool `json:"sync"` Passcode string `json:"passcode"` DeviceName string `json:"deviceName"` EncryptedLoginToken string `json:"encryptedLoginToken"` EncryptedDeviceToken string `json:"encryptedDeviceToken"` IPAddress string `json:"ipAddress"` }
type PublicKeys ¶
type PushCallback ¶
type PushCallback = func(*NotificationEvent) bool
type PushEndpoint ¶
type PushEndpoint struct {
// contains filtered or unexported fields
}
func (*PushEndpoint) Close ¶
func (p *PushEndpoint) Close() error
func (*PushEndpoint) IsClosed ¶
func (p *PushEndpoint) IsClosed() bool
func (*PushEndpoint) Push ¶
func (p *PushEndpoint) Push(event *NotificationEvent)
func (*PushEndpoint) RegisterCallback ¶
func (p *PushEndpoint) RegisterCallback(cb PushCallback)
func (*PushEndpoint) RemoveAllCallback ¶
func (p *PushEndpoint) RemoveAllCallback()
func (*PushEndpoint) RemoveCallback ¶
func (p *PushEndpoint) RemoveCallback(cb PushCallback)
func (*PushEndpoint) SendToPushChannel ¶
func (p *PushEndpoint) SendToPushChannel(_ []byte, _ bool) error
type ServerConfiguration ¶
type ServerConfiguration struct {
// contains filtered or unexported fields
}
func CloneServerConfiguration ¶
func CloneServerConfiguration(other IServerConfiguration) *ServerConfiguration
func NewServerConfiguration ¶
func NewServerConfiguration(server string) *ServerConfiguration
func (*ServerConfiguration) Id ¶
func (s *ServerConfiguration) Id() string
func (*ServerConfiguration) Server ¶
func (s *ServerConfiguration) Server() string
func (*ServerConfiguration) ServerKeyId ¶
func (s *ServerConfiguration) ServerKeyId() int32
func (*ServerConfiguration) SetServerKeyId ¶
func (s *ServerConfiguration) SetServerKeyId(keyId int32)
type SessionRestriction ¶
type SessionRestriction int32
func (SessionRestriction) Has ¶
func (r SessionRestriction) Has(restriction SessionRestriction) bool
type TwoFactorChannel ¶
type TwoFactorChannel = int32
const ( TwoFactorChannel_Other TwoFactorChannel = iota TwoFactorChannel_Authenticator TwoFactorChannel_TextMessage TwoFactorChannel_DuoSecurity TwoFactorChannel_RSASecurID TwoFactorChannel_KeeperDNA TwoFactorChannel_SecurityKey TwoFactorChannel_Backup )
type TwoFactorDuration ¶
type TwoFactorDuration = int32
const ( TwoFactorDuration_EveryLogin TwoFactorDuration = iota TwoFactorDuration_Every12Hour TwoFactorDuration_EveryDay TwoFactorDuration_Every30Days TwoFactorDuration_Forever )
type TwoFactorPushAction ¶
type TwoFactorPushAction = int32
const ( TwoFactorAction_DuoPush TwoFactorPushAction = iota + 1 TwoFactorAction_DuoTextMessage TwoFactorAction_DuoVoiceCall TwoFactorAction_TextMessage TwoFactorAction_KeeperDna )
type UserConfiguration ¶
type UserConfiguration struct {
// contains filtered or unexported fields
}
func CloneUserConfiguration ¶
func CloneUserConfiguration(other IUserConfiguration) *UserConfiguration
func NewUserConfiguration ¶
func NewUserConfiguration(username string) *UserConfiguration
func (*UserConfiguration) Id ¶
func (u *UserConfiguration) Id() string
func (*UserConfiguration) LastDevice ¶
func (u *UserConfiguration) LastDevice() IUserDeviceConfiguration
func (*UserConfiguration) Password ¶
func (u *UserConfiguration) Password() string
func (*UserConfiguration) Server ¶
func (u *UserConfiguration) Server() string
func (*UserConfiguration) SetLastDevice ¶
func (u *UserConfiguration) SetLastDevice(lastDevice IUserDeviceConfiguration)
func (*UserConfiguration) SetPassword ¶
func (u *UserConfiguration) SetPassword(password string)
func (*UserConfiguration) SetServer ¶
func (u *UserConfiguration) SetServer(server string)
func (*UserConfiguration) Username ¶
func (u *UserConfiguration) Username() string
type UserDeviceConfiguration ¶
type UserDeviceConfiguration struct {
// contains filtered or unexported fields
}
func CloneUserDeviceConfiguration ¶
func CloneUserDeviceConfiguration(other IUserDeviceConfiguration) *UserDeviceConfiguration
func NewUserDeviceConfiguration ¶
func NewUserDeviceConfiguration(deviceToken string) *UserDeviceConfiguration
func (*UserDeviceConfiguration) DeviceToken ¶
func (ud *UserDeviceConfiguration) DeviceToken() string
func (*UserDeviceConfiguration) Id ¶
func (ud *UserDeviceConfiguration) Id() string
Click to show internal directories.
Click to hide internal directories.