Versions in this module Expand all Collapse all v0 v0.14.5 Oct 27, 2020 v0.14.4 Oct 23, 2020 Changes in this version + const WaitBeforeRefreshSeconds + var RefreshBeforeExpiryMinutes = int64(10) + func ExtractExpiryFromAccessToken(token string) (int, error) + func ExtractUsernameFromAccessToken(token string) (string, error) + func GetTokenMinutesLeft(token string) (int64, error) + func IsEncrypted(buffer []byte) (bool, error) + func SshAuthentication(url, sshKeyPath, sshPassphrase string) (sshAuthHeaders map[string]string, newUrl string, err error) + func SshTokenRefreshPreRequestInterceptor(fields *CommonConfigFields, httpClientDetails *httputils.HttpClientDetails) error + type CommonConfigFields struct + AccessToken string + ApiKey string + ClientCertKeyPath string + ClientCertPath string + Password string + PreRequestInterceptors []PreRequestInterceptorFunc + SshAuthHeaders map[string]string + SshKeyPath string + SshPassphrase string + SshUrl string + TokenMutex sync.Mutex + Url string + User string + Version string + func (ccf *CommonConfigFields) AppendPreRequestInterceptor(interceptor PreRequestInterceptorFunc) + func (ccf *CommonConfigFields) AuthenticateSsh(sshKeyPath, sshPassphrase string) error + func (ccf *CommonConfigFields) CreateHttpClientDetails() httputils.HttpClientDetails + func (ccf *CommonConfigFields) GetAccessToken() string + func (ccf *CommonConfigFields) GetApiKey() string + func (ccf *CommonConfigFields) GetClientCertKeyPath() string + func (ccf *CommonConfigFields) GetClientCertPath() string + func (ccf *CommonConfigFields) GetPassword() string + func (ccf *CommonConfigFields) GetPreRequestInterceptor() []PreRequestInterceptorFunc + func (ccf *CommonConfigFields) GetSshAuthHeaders() map[string]string + func (ccf *CommonConfigFields) GetSshKeyPath() string + func (ccf *CommonConfigFields) GetSshPassphrase() string + func (ccf *CommonConfigFields) GetSshUrl() string + func (ccf *CommonConfigFields) GetUrl() string + func (ccf *CommonConfigFields) GetUser() string + func (ccf *CommonConfigFields) InitSsh() error + func (ccf *CommonConfigFields) IsSshAuthHeaderSet() bool + func (ccf *CommonConfigFields) IsSshAuthentication() bool + func (ccf *CommonConfigFields) RunPreRequestInterceptors(httpClientDetails *httputils.HttpClientDetails) error + func (ccf *CommonConfigFields) SetAccessToken(accessToken string) + func (ccf *CommonConfigFields) SetApiKey(apiKey string) + func (ccf *CommonConfigFields) SetClientCertKeyPath(certificatePath string) + func (ccf *CommonConfigFields) SetClientCertPath(certificatePath string) + func (ccf *CommonConfigFields) SetPassword(password string) + func (ccf *CommonConfigFields) SetSshAuthHeaders(sshAuthHeaders map[string]string) + func (ccf *CommonConfigFields) SetSshKeyPath(sshKeyPath string) + func (ccf *CommonConfigFields) SetSshPassphrase(sshPassphrase string) + func (ccf *CommonConfigFields) SetSshUrl(sshUrl string) + func (ccf *CommonConfigFields) SetUrl(url string) + func (ccf *CommonConfigFields) SetUser(user string) + type PreRequestInterceptorFunc func(*CommonConfigFields, *httputils.HttpClientDetails) error + type ServiceDetails interface + AppendPreRequestInterceptor func(PreRequestInterceptorFunc) + AuthenticateSsh func(sshKey, sshPassphrase string) error + CreateHttpClientDetails func() httputils.HttpClientDetails + GetAccessToken func() string + GetApiKey func() string + GetClientCertKeyPath func() string + GetClientCertPath func() string + GetPassword func() string + GetPreRequestInterceptor func() []PreRequestInterceptorFunc + GetSshAuthHeaders func() map[string]string + GetSshKeyPath func() string + GetSshPassphrase func() string + GetSshUrl func() string + GetUrl func() string + GetUser func() string + GetVersion func() (string, error) + InitSsh func() error + IsSshAuthHeaderSet func() bool + IsSshAuthentication func() bool + RunPreRequestInterceptors func(httpClientDetails *httputils.HttpClientDetails) error + SetAccessToken func(accessToken string) + SetApiKey func(apiKey string) + SetClientCertKeyPath func(certificatePath string) + SetClientCertPath func(certificatePath string) + SetPassword func(password string) + SetSshAuthHeaders func(sshAuthHeaders map[string]string) + SetSshKeyPath func(sshKeyPath string) + SetSshPassphrase func(sshPassphrase string) + SetSshUrl func(url string) + SetUrl func(url string) + SetUser func(user string) + type SshAuthResult struct + Headers map[string]string + Href string + type TokenPayload struct + Audience string + ExpirationTime int + IssuedAt int + Issuer string + JwtId string + Scope string + Subject string