Documentation ¶
Index ¶
- func ExtractPrincipal(request events.APIGatewayProxyRequest) (goauth.Principal, error)
- func NewAuthorizerLambdaHandler(config AuthorizerLambdaConfig) ...
- func NewContextAppendingTransport(ctx context.Context, toWrap http.RoundTripper) http.RoundTripper
- type AllowedEndpoint
- type Authorizer
- type AuthorizerCallback
- type AuthorizerLambdaConfig
- type EndpointMapper
- type GatewayPolicyBuilder
- type HTTPClientFactory
- type PolicyBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPrincipal ¶
func ExtractPrincipal(request events.APIGatewayProxyRequest) (goauth.Principal, error)
func NewAuthorizerLambdaHandler ¶
func NewAuthorizerLambdaHandler(config AuthorizerLambdaConfig) func(ctx context.Context, request events.APIGatewayCustomAuthorizerRequest) (events.APIGatewayCustomAuthorizerResponse, error)
func NewContextAppendingTransport ¶
func NewContextAppendingTransport(ctx context.Context, toWrap http.RoundTripper) http.RoundTripper
Types ¶
type AllowedEndpoint ¶
Allowed Endpoint represents a resource a principal is allowed to access. Used in building policy documents, * globs are supported.
type Authorizer ¶
type AuthorizerCallback ¶
type AuthorizerLambdaConfig ¶
type AuthorizerLambdaConfig struct { AllowAnonymous bool Authorizer Authorizer CallbackFactory func(ctx context.Context) AuthorizerCallback PolicyBuilder PolicyBuilder }
type EndpointMapper ¶
type EndpointMapper interface {
AllowedEndpoints(ctx context.Context, principal goauth.Principal) ([]AllowedEndpoint, error)
}
EndpointMapper takes a principle and returns the endpoints they are allowed to access
type GatewayPolicyBuilder ¶
type GatewayPolicyBuilder struct { Region string AccountID string ApiID string Stage string // contains filtered or unexported fields }
GatewayPolicyBuilder builds policy documents that can be used with custom authorizer lambda's
func NewGatewayPolicyBuilder ¶
func NewGatewayPolicyBuilder(region, accountID, apiID, stage string, endpointMapper EndpointMapper) *GatewayPolicyBuilder
func (*GatewayPolicyBuilder) BuildPolicy ¶
func (g *GatewayPolicyBuilder) BuildPolicy(ctx context.Context, principal goauth.Principal) (events.APIGatewayCustomAuthorizerPolicy, error)
type HTTPClientFactory ¶
func NewXRAYAwareHTTPClientFactory ¶
func NewXRAYAwareHTTPClientFactory(baseClient *http.Client) HTTPClientFactory
func (HTTPClientFactory) HTTPClient ¶
func (h HTTPClientFactory) HTTPClient(ctx context.Context) *http.Client
type PolicyBuilder ¶
Click to show internal directories.
Click to hide internal directories.