Documentation ¶
Index ¶
Constants ¶
View Source
const (
Function61 = "https://function61.com/id" // our ID server
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer func(*http.Request, *httpauth.UserDetails) bool
func UserListAuthorizer ¶
func UserListAuthorizer(authorizedUserIds ...string) Authorizer
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateAuthGateway ¶
func (c *Client) CreateAuthGateway(router *mux.Router, audience string) *GatewayApi
func (*Client) ObtainPublicKey ¶
type GatewayApi ¶
type GatewayApi struct {
// contains filtered or unexported fields
}
func (*GatewayApi) AuthenticateAndAuthorize ¶
func (g *GatewayApi) AuthenticateAndAuthorize( w http.ResponseWriter, r *http.Request, authorizer Authorizer, ) *httpauth.UserDetails
returns UserDetails if user is authenticated & authorized. if returns nil, error response was already sent.
func (*GatewayApi) LogoutUrl ¶
func (g *GatewayApi) LogoutUrl() string
func (*GatewayApi) Protect ¶
func (g *GatewayApi) Protect(authorizer Authorizer, authorizedHandler http.Handler) http.Handler
wraps inner Handler with protection: 1) authentication 2) authorization
Click to show internal directories.
Click to hide internal directories.