Documentation
¶
Overview ¶
Package client implements a gRPC client for the authorization service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface { // Authorize takes a route and user session and returns whether the // request is valid per access policy Authorize(ctx context.Context, user string, r *http.Request) (*pb.IsAuthorizedReply, error) // Close closes the auth connection if any. Close() error }
Authorizer provides the authorize service interface
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gRPC implementation of an authenticator (authorize client)
func New ¶
func New(conn *grpc.ClientConn) (p *Client, err error)
New returns a new authorize service client.
type MockAuthorize ¶
type MockAuthorize struct { AuthorizeResponse *pb.IsAuthorizedReply AuthorizeError error IsAdminResponse bool IsAdminError error CloseError error }
MockAuthorize provides a mocked implementation of the authorizer interface.
func (MockAuthorize) Authorize ¶
func (a MockAuthorize) Authorize(ctx context.Context, user string, r *http.Request) (*pb.IsAuthorizedReply, error)
Authorize is a mocked authorizer client function.
func (MockAuthorize) Close ¶
func (a MockAuthorize) Close() error
Close is a mocked authorizer client function.
Click to show internal directories.
Click to hide internal directories.