Documentation
¶
Index ¶
- func AuthenticateAPIKey(username, apiKey string) bool
- func DeleteExpiredTokens()
- func Disable2FA(c *gin.Context)
- func Get2FARecoveryCodes(c *gin.Context)
- func Get2FAStatus(c *gin.Context)
- func GetPhoneIslandToken(jwtToken string, onlyToken bool) (string, error)
- func GetUserStatus(username string) (string, error)
- func PhoneIslandTokenCheck(c *gin.Context)
- func PhoneIslandTokenLogin(c *gin.Context)
- func PhoneIslandTokenRemove(c *gin.Context)
- func ProxyV1Request(c *gin.Context, path string)
- func QRCode(c *gin.Context)
- func VerifyOTP(c *gin.Context)
- func VerifyUserPassword(username, password string) bool
- type DefaultDevice
- type Endpoints
- type Extension
- type Profile
- type Settings
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateAPIKey ¶ added in v0.0.3
AuthenticateAPIKey returns true if the API key matches the stored key for the user, false otherwise
func DeleteExpiredTokens ¶ added in v0.0.3
func DeleteExpiredTokens()
func Disable2FA ¶ added in v0.0.3
Disable2FA disables two-factor authentication for the user
func Get2FARecoveryCodes ¶ added in v0.0.3
Get2FARecoveryCodes retrieves the recovery codes for the user
func Get2FAStatus ¶ added in v0.0.3
Test2FAStatus checks if 2FA is enabled for the user
func GetPhoneIslandToken ¶ added in v0.0.3
Return the PhoneIslandToken from ApiKeyData given a JWT token string
func GetUserStatus ¶ added in v0.0.3
GetUserStatus retrieves the 2FA status for the user
func PhoneIslandTokenCheck ¶ added in v0.0.3
PhoneIslandTokenCheck checks if the user has a Phone Island API key
func PhoneIslandTokenLogin ¶ added in v0.0.3
PhoneIslandTokenLogin handles the login for Phone Island using a JWT token
func PhoneIslandTokenRemove ¶ added in v0.0.3
PhoneIslandTokenRemove removes the Phone Island API key for the user
func ProxyV1Request ¶
ProxyV1Request forwards requests to the legacy V1 API
func VerifyUserPassword ¶ added in v0.2.0
VerifyUserPassword verifies a user's password against NetCTI server
Types ¶
type DefaultDevice ¶ added in v0.3.0
type DefaultDevice struct {
ID string `json:"id"`
Type string `json:"type"`
Secret string `json:"secret"`
Username string `json:"username"`
Description string `json:"description"`
Actions map[string]bool `json:"actions"`
}
DefaultDevice represents the default device
type Endpoints ¶ added in v0.3.0
type Endpoints struct {
Email []interface{} `json:"email"`
Jabber []interface{} `json:"jabber"`
Extension []Extension `json:"extension"`
Cellphone []interface{} `json:"cellphone"`
Voicemail []interface{} `json:"voicemail"`
MainExtension []Extension `json:"mainextension"`
}
Endpoints represents all endpoint types
type Extension ¶ added in v0.3.0
type Extension struct {
ID string `json:"id"`
Type string `json:"type"`
Secret string `json:"secret"`
Username string `json:"username"`
Description string `json:"description"`
Actions map[string]bool `json:"actions"`
}
Extension represents a phone extension
type Profile ¶ added in v0.3.0
type Profile struct {
ID string `json:"id"`
Name string `json:"name"`
MacroPermissions map[string]interface{} `json:"macro_permissions"`
OutboundRoutesPermissions []interface{} `json:"outbound_routes_permissions"`
}
Profile represents user profile with permissions
type Settings ¶ added in v0.3.0
type Settings struct {
DesktopNotifications bool `json:"desktop_notifications"`
OpenCcard string `json:"open_ccard"`
ChatNotifications bool `json:"chat_notifications"`
DefaultExtension string `json:"default_extension"`
}
Settings represents user settings
type UserInfo ¶ added in v0.3.0
type UserInfo struct {
Name string `json:"name"`
Username string `json:"username"`
MainPresence string `json:"mainPresence"`
Presence string `json:"presence"`
Endpoints Endpoints `json:"endpoints"`
PresenceOnBusy string `json:"presenceOnBusy"`
RecallOnBusy string `json:"recallOnBusy"`
Profile Profile `json:"profile"`
DefaultDevice DefaultDevice `json:"default_device"`
LKHash string `json:"lkhash"`
ProxyFQDN string `json:"proxy_fqdn"`
Settings Settings `json:"settings"`
// Computed fields for easier access
DisplayName string `json:"-"`
PhoneNumbers []string `json:"-"`
}
UserInfo represents complete user information from the API
func GetUserInfo ¶ added in v0.3.0
GetUserInfo retrieves user information from V1 API using the provided token