Versions in this module Expand all Collapse all v1 v1.0.1 Jul 18, 2018 Changes in this version + func ParseUrls(baseUrl, redirectUrl string) (retBaseUrl, retRedirectUrl *url.URL, err error) + type Logger interface + Printf func(format string, v ...interface{}) + type LoggerDefault struct + func (l LoggerDefault) Printf(format string, v ...interface{}) type Server + Logger Logger v1.0.0 Dec 20, 2017 Changes in this version + const CODE + const E_ACCESS_DENIED + const E_INVALID_CLIENT + const E_INVALID_GRANT + const E_INVALID_REQUEST + const E_INVALID_SCOPE + const E_SERVER_ERROR + const E_TEMPORARILY_UNAVAILABLE + const E_UNAUTHORIZED_CLIENT + const E_UNSUPPORTED_GRANT_TYPE + const E_UNSUPPORTED_RESPONSE_TYPE + const PKCE_PLAIN + const PKCE_S256 + const TOKEN + var ErrNotFound = errors.New("Entity not found") + func CheckClientSecret(client Client, secret string) bool + func FirstUri(baseUriList string, separator string) string + func OutputJSON(rs *Response, w http.ResponseWriter, r *http.Request) error + func ValidateUri(baseUri string, redirectUri string) error + func ValidateUriList(baseUriList string, redirectUri string, separator string) error + type AccessData struct + AccessData *AccessData + AccessToken string + AuthorizeData *AuthorizeData + Client Client + CreatedAt time.Time + ExpiresIn int32 + RedirectUri string + RefreshToken string + Scope string + UserData interface{} + func (d *AccessData) ExpireAt() time.Time + func (d *AccessData) IsExpired() bool + func (d *AccessData) IsExpiredAt(t time.Time) bool + type AccessRequest struct + AccessData *AccessData + Assertion string + AssertionType string + AuthorizeData *AuthorizeData + Authorized bool + Client Client + Code string + CodeVerifier string + Expiration int32 + ForceAccessData *AccessData + GenerateRefresh bool + HttpRequest *http.Request + Password string + RedirectUri string + Scope string + Type AccessRequestType + UserData interface{} + Username string + type AccessRequestType string + const ASSERTION + const AUTHORIZATION_CODE + const CLIENT_CREDENTIALS + const IMPLICIT + const PASSWORD + const REFRESH_TOKEN + type AccessTokenGen interface + GenerateAccessToken func(data *AccessData, generaterefresh bool) (accesstoken string, refreshtoken string, err error) + type AccessTokenGenDefault struct + func (a *AccessTokenGenDefault) GenerateAccessToken(data *AccessData, generaterefresh bool) (accesstoken string, refreshtoken string, err error) + type AllowedAccessType []AccessRequestType + func (t AllowedAccessType) Exists(rt AccessRequestType) bool + type AllowedAuthorizeType []AuthorizeRequestType + func (t AllowedAuthorizeType) Exists(rt AuthorizeRequestType) bool + type AuthorizeData struct + Client Client + Code string + CodeChallenge string + CodeChallengeMethod string + CreatedAt time.Time + ExpiresIn int32 + RedirectUri string + Scope string + State string + UserData interface{} + func (d *AuthorizeData) ExpireAt() time.Time + func (d *AuthorizeData) IsExpired() bool + func (d *AuthorizeData) IsExpiredAt(t time.Time) bool + type AuthorizeRequest struct + Authorized bool + Client Client + CodeChallenge string + CodeChallengeMethod string + Expiration int32 + HttpRequest *http.Request + RedirectUri string + Scope string + State string + Type AuthorizeRequestType + UserData interface{} + type AuthorizeRequestType string + type AuthorizeTokenGen interface + GenerateAuthorizeToken func(data *AuthorizeData) (string, error) + type AuthorizeTokenGenDefault struct + func (a *AuthorizeTokenGenDefault) GenerateAuthorizeToken(data *AuthorizeData) (ret string, err error) + type BasicAuth struct + Password string + Username string + func CheckBasicAuth(r *http.Request) (*BasicAuth, error) + type BearerAuth struct + Code string + func CheckBearerAuth(r *http.Request) *BearerAuth + type Client interface + GetId func() string + GetRedirectUri func() string + GetSecret func() string + GetUserData func() interface{} + type ClientSecretMatcher interface + ClientSecretMatches func(secret string) bool + type DefaultClient struct + Id string + RedirectUri string + Secret string + UserData interface{} + func (d *DefaultClient) ClientSecretMatches(secret string) bool + func (d *DefaultClient) CopyFrom(client Client) + func (d *DefaultClient) GetId() string + func (d *DefaultClient) GetRedirectUri() string + func (d *DefaultClient) GetSecret() string + func (d *DefaultClient) GetUserData() interface{} + type DefaultErrorId string + type DefaultErrors struct + func NewDefaultErrors() *DefaultErrors + func (e *DefaultErrors) Get(id string) string + type InfoRequest struct + AccessData *AccessData + Code string + type Response struct + ErrorId string + ErrorStatusCode int + Headers http.Header + InternalError error + IsError bool + Output ResponseData + RedirectInFragment bool + StatusCode int + StatusText string + Storage Storage + Type ResponseType + URL string + func NewResponse(storage Storage) *Response + func (r *Response) Close() + func (r *Response) GetRedirectUrl() (string, error) + func (r *Response) SetError(id string, description string) + func (r *Response) SetErrorState(id string, description string, state string) + func (r *Response) SetErrorUri(id string, description string, uri string, state string) + func (r *Response) SetRedirect(url string) + func (r *Response) SetRedirectFragment(f bool) + type ResponseData map[string]interface + type ResponseType int + const DATA + const REDIRECT + type Server struct + AccessTokenGen AccessTokenGen + AuthorizeTokenGen AuthorizeTokenGen + Config *ServerConfig + Now func() time.Time + Storage Storage + func NewServer(config *ServerConfig, storage Storage) *Server + func (s *Server) FinishAccessRequest(w *Response, r *http.Request, ar *AccessRequest) + func (s *Server) FinishAuthorizeRequest(w *Response, r *http.Request, ar *AuthorizeRequest) + func (s *Server) FinishInfoRequest(w *Response, r *http.Request, ir *InfoRequest) + func (s *Server) HandleAccessRequest(w *Response, r *http.Request) *AccessRequest + func (s *Server) HandleAuthorizeRequest(w *Response, r *http.Request) *AuthorizeRequest + func (s *Server) HandleInfoRequest(w *Response, r *http.Request) *InfoRequest + func (s *Server) NewResponse() *Response + type ServerConfig struct + AccessExpiration int32 + AllowClientSecretInParams bool + AllowGetAccessRequest bool + AllowedAccessTypes AllowedAccessType + AllowedAuthorizeTypes AllowedAuthorizeType + AuthorizationExpiration int32 + ErrorStatusCode int + RedirectUriSeparator string + RequirePKCEForPublicClients bool + RetainTokenAfterRefresh bool + TokenType string + func NewServerConfig() *ServerConfig + type Storage interface + Clone func() Storage + Close func() + GetClient func(id string) (Client, error) + LoadAccess func(token string) (*AccessData, error) + LoadAuthorize func(code string) (*AuthorizeData, error) + LoadRefresh func(token string) (*AccessData, error) + RemoveAccess func(token string) error + RemoveAuthorize func(code string) error + RemoveRefresh func(token string) error + SaveAccess func(*AccessData) error + SaveAuthorize func(*AuthorizeData) error + type UriValidationError string + func (e UriValidationError) Error() string Incompatible versions in this module v2.0.0+incompatible Feb 20, 2020