Documentation ¶
Overview ¶
Package api implements the HTTP API of the login-application.
the purpose of this application is to provide centralized authentication
Terms Of Service:
Schemes: https Host: login.binggl.net BasePath: /api/v1 Version: 1.0.0 License: Apache 2.0 https://opensource.org/licenses/Apache-2.0 Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Login ¶
type Login interface { // oidc HandleError(w http.ResponseWriter, r *http.Request) error HandleOIDCRedirect(w http.ResponseWriter, r *http.Request) error HandleAuthFlow(w http.ResponseWriter, r *http.Request) error HandleOIDCRedirectFinal(w http.ResponseWriter, r *http.Request) error HandleOIDCLogin(w http.ResponseWriter, r *http.Request) error HandleLogout(user security.User, w http.ResponseWriter, r *http.Request) error // sites HandleGetSites(user security.User, w http.ResponseWriter, r *http.Request) error HandleSaveSites(user security.User, w http.ResponseWriter, r *http.Request) error HandleGetUsersForSite(user security.User, w http.ResponseWriter, r *http.Request) error // wrapper methods Secure(f func(user security.User, w http.ResponseWriter, r *http.Request) error) http.HandlerFunc Call(f func(w http.ResponseWriter, r *http.Request) error) http.HandlerFunc // configuration GetOIDCRedirectURL() string }
Login defines the HTTP handlers responding to requests
func New ¶
func New(basePath string, baseHandler handler.Handler, cs cookies.Settings, version internal.VersionInfo, oauth config.OAuthConfig, jwt config.Security, repo persistence.Repository) Login
New creates a new instance of the API type
type OIDCToken ¶
type OIDCToken interface {
GetClaims(v interface{}) error
}
OIDCToken wraps the underlying implementation of oidc-token
type OIDCVerifier ¶
type OIDCVerifier interface {
VerifyToken(ctx context.Context, rawToken string) (OIDCToken, error)
}
OIDCVerifier wraps the underlying implementation of oidc-verify
func NewOIDC ¶
func NewOIDC(c config.OAuthConfig) (oauthConfig *oauth2.Config, oauthVerifier OIDCVerifier)
NewOIDC creates a config and a verifier for the OIDC interaction
type SiteInfo ¶
type SiteInfo struct { Name string `json:"name"` URL string `json:"url"` Perm []string `json:"permissions"` }
SiteInfo holds data of a site swagger:model
type SiteInfoRequestSwagger ¶
type SiteInfoRequestSwagger struct { // In: body Body SiteInfo }
swagger:parameters HandleSaveSites
Click to show internal directories.
Click to hide internal directories.