api

package
v0.0.0-...-c2f928c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

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

type UserList

type UserList struct {
	Count int      `json:"count"`
	Users []string `json:"users"`
}

UserList holds the usernames for a given site swagger:model

type UserSites

type UserSites struct {
	User     string     `json:"user"`
	Editable bool       `json:"editable"`
	Sites    []SiteInfo `json:"userSites"`
}

UserSites holds information about the current user and sites swagger:model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL