Documentation
¶
Index ¶
- type IAM
- type Server
- func (s *Server) Health(w http.ResponseWriter, r *http.Request)
- func (s *Server) ListenAndServe() error
- func (s *Server) Login(w http.ResponseWriter, r *http.Request)
- func (s *Server) Logout(w http.ResponseWriter, r *http.Request)
- func (s *Server) Proxy(w http.ResponseWriter, r *http.Request)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IAM ¶
type IAM interface {
GetGroup(input *iam.GetGroupInput) (*iam.GetGroupOutput, error)
}
IAM interface holds required method signatures of IAM for easier test mocking
type Server ¶
type Server struct { Addr string AllowedGroups []string IAM *iam.IAM SecretKey []byte SessionCookieName string Upstream *url.URL GroupCachePeriod time.Duration // contains filtered or unexported fields }
Server implements a simple reverse proxy server authenticating on AWS IAM
func (*Server) Health ¶
func (s *Server) Health(w http.ResponseWriter, r *http.Request)
Health returns a successful health check
func (*Server) ListenAndServe ¶
ListenAndServer starts the HTTP server. This server respects SIGINT and will gracefully shutdown.
func (*Server) Login ¶
func (s *Server) Login(w http.ResponseWriter, r *http.Request)
login validates basic auth of username and secret+mfa on AWS IAM and sets cookie with session jwt
func (*Server) Logout ¶
func (s *Server) Logout(w http.ResponseWriter, r *http.Request)
logout kills cookie and redirect to /
Click to show internal directories.
Click to hide internal directories.