server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2015 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginPageTemplateName              = "login.html"
	RegisterTemplateName               = "register.html"
	VerifyEmailTemplateName            = "verify-email.html"
	SendResetPasswordEmailTemplateName = "send-reset-password.html"
	ResetPasswordTemplateName          = "reset-password.html"

	APIVersion = "v1"
)
View Source
const (
	AdminAPIVersion = "v1"
)

Variables

View Source
var (
	AdminGetEndpoint      = addBasePath("/admin/:id")
	AdminCreateEndpoint   = addBasePath("/admin")
	AdminGetStateEndpoint = addBasePath("/state")
)
View Source
var (
	UsersSubTree        = "/users"
	UsersListEndpoint   = addBasePath(UsersSubTree) + "/"
	UsersCreateEndooint = addBasePath(UsersSubTree)
	UsersGetEndpoint    = addBasePath(UsersSubTree + "/:id")
)

Functions

This section is empty.

Types

type AdminServer

type AdminServer struct {
	// contains filtered or unexported fields
}

AdminServer serves the admin API.

func NewAdminServer

func NewAdminServer(adminAPI *admin.AdminAPI, rotator *key.PrivateKeyRotator) *AdminServer

func (*AdminServer) HTTPHandler

func (s *AdminServer) HTTPHandler() http.Handler

type JWTVerifierFactory

type JWTVerifierFactory func(clientID string) oidc.JWTVerifier
type Link struct {
	URL         string
	ID          string
	DisplayName string
}

type MultiServerConfig

type MultiServerConfig struct {
	KeySecrets     [][]byte
	DatabaseConfig db.Config
}

func (*MultiServerConfig) Configure

func (cfg *MultiServerConfig) Configure(srv *Server) error

type OIDCServer

type OIDCServer interface {
	ClientMetadata(string) (*oidc.ClientMetadata, error)
	NewSession(connectorID, clientID, clientState string, redirectURL url.URL, nonce string, register bool, scope []string) (string, error)
	Login(oidc.Identity, string) (string, error)
	// CodeToken exchanges a code for an ID token and a refresh token string on success.
	CodeToken(creds oidc.ClientCredentials, sessionKey string) (*jose.JWT, string, error)
	ClientCredsToken(creds oidc.ClientCredentials) (*jose.JWT, error)
	// RefreshToken takes a previously generated refresh token and returns a new ID token
	// if the token is valid.
	RefreshToken(creds oidc.ClientCredentials, token string) (*jose.JWT, error)
	KillSession(string) error
}

type ResetPasswordHandler

type ResetPasswordHandler struct {
	// contains filtered or unexported fields
}

func (*ResetPasswordHandler) ServeHTTP

func (h *ResetPasswordHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SendResetPasswordEmailHandler

type SendResetPasswordEmailHandler struct {
	// contains filtered or unexported fields
}

func (*SendResetPasswordEmailHandler) ServeHTTP

type Server

type Server struct {
	IssuerURL                      url.URL
	KeyManager                     key.PrivateKeyManager
	KeySetRepo                     key.PrivateKeySetRepo
	SessionManager                 *session.SessionManager
	ClientIdentityRepo             client.ClientIdentityRepo
	ConnectorConfigRepo            connector.ConnectorConfigRepo
	Templates                      *template.Template
	LoginTemplate                  *template.Template
	RegisterTemplate               *template.Template
	VerifyEmailTemplate            *template.Template
	SendResetPasswordEmailTemplate *template.Template
	ResetPasswordTemplate          *template.Template
	HealthChecks                   []health.Checkable
	Connectors                     []connector.Connector
	UserRepo                       user.UserRepo
	UserManager                    *user.Manager
	PasswordInfoRepo               user.PasswordInfoRepo
	RefreshTokenRepo               refresh.RefreshTokenRepo
	UserEmailer                    *useremail.UserEmailer
	// contains filtered or unexported fields
}

func (*Server) AddConnector

func (s *Server) AddConnector(cfg connector.ConnectorConfig) error

func (*Server) ClientCredsToken

func (s *Server) ClientCredsToken(creds oidc.ClientCredentials) (*jose.JWT, error)

func (*Server) ClientMetadata

func (s *Server) ClientMetadata(clientID string) (*oidc.ClientMetadata, error)

func (*Server) CodeToken

func (s *Server) CodeToken(creds oidc.ClientCredentials, sessionKey string) (*jose.JWT, string, error)

func (*Server) HTTPHandler

func (s *Server) HTTPHandler() http.Handler

func (*Server) JWTVerifierFactory

func (s *Server) JWTVerifierFactory() JWTVerifierFactory

func (*Server) KillSession

func (s *Server) KillSession(sessionKey string) error

func (*Server) Login

func (s *Server) Login(ident oidc.Identity, key string) (string, error)

func (*Server) NewClientTokenAuthHandler

func (s *Server) NewClientTokenAuthHandler(handler http.Handler) http.Handler

NewClientTokenAuthHandler returns the given handler wrapped in middleware which requires a Client Bearer token.

func (*Server) NewSession

func (s *Server) NewSession(ipdcID, clientID, clientState string, redirectURL url.URL, nonce string, register bool, scope []string) (string, error)

func (*Server) ProviderConfig

func (s *Server) ProviderConfig() oidc.ProviderConfig

func (*Server) RefreshToken

func (s *Server) RefreshToken(creds oidc.ClientCredentials, token string) (*jose.JWT, error)

func (*Server) Run

func (s *Server) Run() chan struct{}

type ServerConfig

type ServerConfig struct {
	IssuerURL         string
	IssuerName        string
	IssuerLogoURL     string
	TemplateDir       string
	EmailTemplateDirs []string
	EmailFromAddress  string
	EmailerConfigFile string
	StateConfig       StateConfigurer
}

func (*ServerConfig) Server

func (cfg *ServerConfig) Server() (*Server, error)

type SingleServerConfig

type SingleServerConfig struct {
	ClientsFile    string
	ConnectorsFile string
	UsersFile      string
}

func (*SingleServerConfig) Configure

func (cfg *SingleServerConfig) Configure(srv *Server) error

type StateConfigurer

type StateConfigurer interface {
	Configure(*Server) error
}

type UserMgmtServer

type UserMgmtServer struct {
	// contains filtered or unexported fields
}

func NewUserMgmtServer

func NewUserMgmtServer(userMgmtAPI *api.UsersAPI, jwtvFactory JWTVerifierFactory, um *user.Manager, cir client.ClientIdentityRepo) *UserMgmtServer

func (*UserMgmtServer) HTTPHandler

func (s *UserMgmtServer) HTTPHandler() http.Handler

Jump to

Keyboard shortcuts

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