Documentation ¶
Index ¶
- Constants
- func ExtractClaims(tokenStr string) (uint32, error)
- type AccountResult
- type AggregatedError
- type AuthAccount
- type AuthError
- type Authentication
- func (a *Authentication) DeleteAccount(username, password string, id uint32) *AggregatedError
- func (a *Authentication) GetAccount(id uint32, username, password string) (*AggregatedError, *AuthAccount)
- func (a *Authentication) GetJwks(uri string) (*AggregatedError, *JsonKeys)
- func (a *Authentication) GetJwtPublicKey() (*AggregatedError, *JwtConfiguration)
- func (a *Authentication) IsUsernameAvailable(username string) (*AggregatedError, bool)
- func (a *Authentication) LockOrUnlockAccount(id int, username, password string, lock bool) *AggregatedError
- func (a *Authentication) LogOut() *AggregatedError
- func (a *Authentication) Login(username, password string) (*AggregatedError, *string)
- func (a *Authentication) RefreshToken() (*AggregatedError, *TokenId)
- func (a *Authentication) SetHeadersAndPerformRequest(request *http.Request, username, password string, isPublic bool) (error, *http.Response)
- func (a *Authentication) SignUp(username, password string) (*AggregatedError, *TokenId)
- func (a *Authentication) UpdateAccount(username, password string, locked bool) (*AggregatedError, int)
- func (a *Authentication) UpdateUsername(username, password string, id uint32) *AggregatedError
- type Credentials
- type ErrorFields
- type IdResult
- type JsonKeys
- type JsonWebKeys
- type JwtConfiguration
- type LoginAccount
- type ParseJwtResponse
- type TokenId
- type TokenResult
- type UpdateAccount
- type UpdateAccountResponse
- type UsernamePayload
Constants ¶
View Source
const ( AccountsUrl = "http://localhost:3000/accounts" Origin = "http://localhost:3000" )
Variables ¶
This section is empty.
Functions ¶
func ExtractClaims ¶
Types ¶
type AccountResult ¶
type AggregatedError ¶
type AggregatedError struct { AuthErrorMsg *AuthError `json:"authentication_error"` Error error `json:"error"` }
func ExtractErrorResponse ¶
type AuthAccount ¶
type AuthAccount struct {
Result AccountResult `json:"result"`
}
type AuthError ¶
type AuthError struct {
AuthErrorMessage []ErrorFields `json:"errors"`
}
type Authentication ¶
type Authentication struct { Origin string AccountsBase string SessionBase string Availability string Import string RefreshSession string EnablePrivateEndpointInteraction bool }
func NewAuthenticationService ¶
func NewAuthenticationService(origin string, enablePrivateEndpointInteraction bool) *Authentication
Obtain authentication service
func (*Authentication) DeleteAccount ¶
func (a *Authentication) DeleteAccount(username, password string, id uint32) *AggregatedError
func (*Authentication) GetAccount ¶
func (a *Authentication) GetAccount(id uint32, username, password string) (*AggregatedError, *AuthAccount)
func (*Authentication) GetJwks ¶
func (a *Authentication) GetJwks(uri string) (*AggregatedError, *JsonKeys)
func (*Authentication) GetJwtPublicKey ¶
func (a *Authentication) GetJwtPublicKey() (*AggregatedError, *JwtConfiguration)
func (*Authentication) IsUsernameAvailable ¶
func (a *Authentication) IsUsernameAvailable(username string) (*AggregatedError, bool)
func (*Authentication) LockOrUnlockAccount ¶
func (a *Authentication) LockOrUnlockAccount(id int, username, password string, lock bool) *AggregatedError
func (*Authentication) LogOut ¶
func (a *Authentication) LogOut() *AggregatedError
func (*Authentication) Login ¶
func (a *Authentication) Login(username, password string) (*AggregatedError, *string)
func (*Authentication) RefreshToken ¶
func (a *Authentication) RefreshToken() (*AggregatedError, *TokenId)
func (*Authentication) SetHeadersAndPerformRequest ¶
func (*Authentication) SignUp ¶
func (a *Authentication) SignUp(username, password string) (*AggregatedError, *TokenId)
func (*Authentication) UpdateAccount ¶
func (a *Authentication) UpdateAccount(username, password string, locked bool) (*AggregatedError, int)
func (*Authentication) UpdateUsername ¶
func (a *Authentication) UpdateUsername(username, password string, id uint32) *AggregatedError
type Credentials ¶
type ErrorFields ¶
type JsonKeys ¶
type JsonKeys struct {
Result []JsonWebKeys `json:"keys"`
}
type JsonWebKeys ¶
type JwtConfiguration ¶
type JwtConfiguration struct { Issuer string `json:"issuer"` ResponseTypesSupported []string `json:"response_types_supported"` SubjectTypesSupported []string `json:"subject_types_supported"` TokenSigningAlgo []string `json:"id_token_signing_alg_values_supported"` ClaimsSupported []string `json:"claims_supported"` JwtPublicKeyURI string `json:"jwks_uri"` }
type LoginAccount ¶
type ParseJwtResponse ¶
type ParseJwtResponse struct { Auth []string `json:"aud"` AuthTime *jwt.NumericDate `json:"auth_time"` Exp *jwt.NumericDate `json:"exp"` Iat *jwt.NumericDate `json:"iat"` Iss string `json:"iss"` Sub string `json:"sub"` }
type TokenId ¶
type TokenId struct {
Result TokenResult `json:"result"`
}
type TokenResult ¶
type TokenResult struct {
Token string `json:"id_token"`
}
type UpdateAccount ¶
type UpdateAccountResponse ¶
type UpdateAccountResponse struct {
Result IdResult `json:"result"`
}
type UsernamePayload ¶
type UsernamePayload struct {
Username string `json:"username"`
}
Click to show internal directories.
Click to hide internal directories.