Documentation
¶
Overview ¶
Package server provides an http.Handler implementation that includes the Heroku Platform API compatibility layer, GitHub Deployments integration and a simple health check.
Index ¶
- Variables
- type HealthHandler
- type Options
- type Server
- func (s *Server) Handler(r *http.Request) http.Handler
- func (s *Server) PerformCodeExchange(w http.ResponseWriter, r *http.Request)
- func (s *Server) SAMLACS(w http.ResponseWriter, r *http.Request)
- func (s *Server) SAMLLogin(w http.ResponseWriter, r *http.Request)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) StartWebFlow(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
var (
DefaultOptions = Options{}
)
Functions ¶
This section is empty.
Types ¶
type HealthHandler ¶
type HealthHandler struct {
// A function that returns true if empire is healthy.
IsHealthy func() error
}
HealthHandler is an http.Handler that returns the health of empire.
func NewHealthHandler ¶
func NewHealthHandler(e *empire.Empire) *HealthHandler
NewHealthHandler returns a new HealthHandler using the IsHealthy method from an Empire instance.
func (*HealthHandler) ServeHTTP ¶
func (h *HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Server ¶
type Server struct {
// Base host for the server.
URL *url.URL
// The underlying Heroku http.Handler.
Heroku *heroku.Server
GitHubWebhooks http.Handler
Health *HealthHandler
// If provided, enables the SAML integration.
ServiceProvider *saml.ServiceProvider
AuthConfig *oauth2.Config
}
Server composes the Heroku API compatibility layer, the GitHub Webhooks handlers and a health check as a single http.Handler.
func (*Server) PerformCodeExchange ¶
func (s *Server) PerformCodeExchange(w http.ResponseWriter, r *http.Request)
func (*Server) SAMLACS ¶
func (s *Server) SAMLACS(w http.ResponseWriter, r *http.Request)
SAMLACS handles the SAML Response call. It will validate the SAML Response and assertions, generate an API token, then present the token to the user.
func (*Server) SAMLLogin ¶
func (s *Server) SAMLLogin(w http.ResponseWriter, r *http.Request)
SAMLLogin starts a Service Provider initiated login. It generates an AuthnRequest, signs the generated id and stores it in a cookie, then starts the login with the IdP.
func (*Server) StartWebFlow ¶
func (s *Server) StartWebFlow(w http.ResponseWriter, r *http.Request)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth contains types for authenticating and authorizing requests.
|
Package auth contains types for authenticating and authorizing requests. |
|
github
Package github provides auth.Authentication and auth.Authorizer implementations backed by GitHub users, orgs and teams.
|
Package github provides auth.Authentication and auth.Authorizer implementations backed by GitHub users, orgs and teams. |
|
Package cloudformation provides a server for the CloudFormation interface to Empire.
|
Package cloudformation provides a server for the CloudFormation interface to Empire. |
|
Package github provides an http.Handler implementation that allows Empire to handle GitHub Deployments.
|
Package github provides an http.Handler implementation that allows Empire to handle GitHub Deployments. |
|
Package heroku provides a Heroku Platform API compatible http.Handler implementation for Empire.
|
Package heroku provides a Heroku Platform API compatible http.Handler implementation for Empire. |