Documentation ¶
Overview ¶
Package authz is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterAuthorizationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthorizationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthorizationClient) error
- func RegisterAuthorizationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthorizationServer(s *grpc.Server, srv AuthorizationServer)
- type AuthorizationClient
- type AuthorizationServer
- type AuthorizationServerMock
- func (m *AuthorizationServerMock) CreatePolicy(ctx context.Context, req *request.CreatePolicyReq) (*response.CreatePolicyResp, error)
- func (m *AuthorizationServerMock) DeletePolicy(ctx context.Context, req *request.DeletePolicyReq) (*response.DeletePolicyResp, error)
- func (m *AuthorizationServerMock) GetVersion(ctx context.Context, req *version.VersionInfoRequest) (*version.VersionInfo, error)
- func (m *AuthorizationServerMock) Introspect(ctx context.Context, req *request.IntrospectReq) (*response.IntrospectResp, error)
- func (m *AuthorizationServerMock) IntrospectAll(ctx context.Context, req *request.IntrospectAllReq) (*response.IntrospectResp, error)
- func (m *AuthorizationServerMock) IntrospectAllProjects(ctx context.Context, req *request.IntrospectAllProjectsReq) (*response.IntrospectProjectsResp, error)
- func (m *AuthorizationServerMock) IntrospectSome(ctx context.Context, req *request.IntrospectSomeReq) (*response.IntrospectResp, error)
- func (m *AuthorizationServerMock) ListPolicies(ctx context.Context, req *request.ListPoliciesReq) (*response.ListPoliciesResp, error)
- func (m *AuthorizationServerMock) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAuthorizationHandler ¶
func RegisterAuthorizationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthorizationHandler registers the http handlers for service Authorization to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthorizationHandlerClient ¶
func RegisterAuthorizationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthorizationClient) error
RegisterAuthorizationHandlerClient registers the http handlers for service Authorization to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthorizationClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthorizationClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthorizationClient" to call the correct interceptors.
func RegisterAuthorizationHandlerFromEndpoint ¶
func RegisterAuthorizationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthorizationHandlerFromEndpoint is same as RegisterAuthorizationHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthorizationServer ¶
func RegisterAuthorizationServer(s *grpc.Server, srv AuthorizationServer)
Types ¶
type AuthorizationClient ¶
type AuthorizationClient interface { GetVersion(ctx context.Context, in *version.VersionInfoRequest, opts ...grpc.CallOption) (*version.VersionInfo, error) CreatePolicy(ctx context.Context, in *request.CreatePolicyReq, opts ...grpc.CallOption) (*response.CreatePolicyResp, error) ListPolicies(ctx context.Context, in *request.ListPoliciesReq, opts ...grpc.CallOption) (*response.ListPoliciesResp, error) DeletePolicy(ctx context.Context, in *request.DeletePolicyReq, opts ...grpc.CallOption) (*response.DeletePolicyResp, error) IntrospectAll(ctx context.Context, in *request.IntrospectAllReq, opts ...grpc.CallOption) (*response.IntrospectResp, error) IntrospectSome(ctx context.Context, in *request.IntrospectSomeReq, opts ...grpc.CallOption) (*response.IntrospectResp, error) Introspect(ctx context.Context, in *request.IntrospectReq, opts ...grpc.CallOption) (*response.IntrospectResp, error) IntrospectAllProjects(ctx context.Context, in *request.IntrospectAllProjectsReq, opts ...grpc.CallOption) (*response.IntrospectProjectsResp, error) }
AuthorizationClient is the client API for Authorization service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAuthorizationClient ¶
func NewAuthorizationClient(cc *grpc.ClientConn) AuthorizationClient
type AuthorizationServer ¶
type AuthorizationServer interface { GetVersion(context.Context, *version.VersionInfoRequest) (*version.VersionInfo, error) CreatePolicy(context.Context, *request.CreatePolicyReq) (*response.CreatePolicyResp, error) ListPolicies(context.Context, *request.ListPoliciesReq) (*response.ListPoliciesResp, error) DeletePolicy(context.Context, *request.DeletePolicyReq) (*response.DeletePolicyResp, error) IntrospectAll(context.Context, *request.IntrospectAllReq) (*response.IntrospectResp, error) IntrospectSome(context.Context, *request.IntrospectSomeReq) (*response.IntrospectResp, error) Introspect(context.Context, *request.IntrospectReq) (*response.IntrospectResp, error) IntrospectAllProjects(context.Context, *request.IntrospectAllProjectsReq) (*response.IntrospectProjectsResp, error) }
AuthorizationServer is the server API for Authorization service.
type AuthorizationServerMock ¶
type AuthorizationServerMock struct { GetVersionFunc func(context.Context, *version.VersionInfoRequest) (*version.VersionInfo, error) CreatePolicyFunc func(context.Context, *request.CreatePolicyReq) (*response.CreatePolicyResp, error) ListPoliciesFunc func(context.Context, *request.ListPoliciesReq) (*response.ListPoliciesResp, error) DeletePolicyFunc func(context.Context, *request.DeletePolicyReq) (*response.DeletePolicyResp, error) IntrospectAllFunc func(context.Context, *request.IntrospectAllReq) (*response.IntrospectResp, error) IntrospectSomeFunc func(context.Context, *request.IntrospectSomeReq) (*response.IntrospectResp, error) IntrospectFunc func(context.Context, *request.IntrospectReq) (*response.IntrospectResp, error) IntrospectAllProjectsFunc func(context.Context, *request.IntrospectAllProjectsReq) (*response.IntrospectProjectsResp, error) // contains filtered or unexported fields }
AuthorizationServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns
func NewAuthorizationServerMock ¶
func NewAuthorizationServerMock() *AuthorizationServerMock
NewAuthorizationServerMock gives you a fresh instance of AuthorizationServerMock.
func NewAuthorizationServerMockWithoutValidation ¶
func NewAuthorizationServerMockWithoutValidation() *AuthorizationServerMock
NewAuthorizationServerMockWithoutValidation gives you a fresh instance of AuthorizationServerMock which does not attempt to validate requests before passing them to their respective '*Func'.
func (*AuthorizationServerMock) CreatePolicy ¶
func (m *AuthorizationServerMock) CreatePolicy(ctx context.Context, req *request.CreatePolicyReq) (*response.CreatePolicyResp, error)
func (*AuthorizationServerMock) DeletePolicy ¶
func (m *AuthorizationServerMock) DeletePolicy(ctx context.Context, req *request.DeletePolicyReq) (*response.DeletePolicyResp, error)
func (*AuthorizationServerMock) GetVersion ¶
func (m *AuthorizationServerMock) GetVersion(ctx context.Context, req *version.VersionInfoRequest) (*version.VersionInfo, error)
func (*AuthorizationServerMock) Introspect ¶
func (m *AuthorizationServerMock) Introspect(ctx context.Context, req *request.IntrospectReq) (*response.IntrospectResp, error)
func (*AuthorizationServerMock) IntrospectAll ¶
func (m *AuthorizationServerMock) IntrospectAll(ctx context.Context, req *request.IntrospectAllReq) (*response.IntrospectResp, error)
func (*AuthorizationServerMock) IntrospectAllProjects ¶
func (m *AuthorizationServerMock) IntrospectAllProjects(ctx context.Context, req *request.IntrospectAllProjectsReq) (*response.IntrospectProjectsResp, error)
func (*AuthorizationServerMock) IntrospectSome ¶
func (m *AuthorizationServerMock) IntrospectSome(ctx context.Context, req *request.IntrospectSomeReq) (*response.IntrospectResp, error)
func (*AuthorizationServerMock) ListPolicies ¶
func (m *AuthorizationServerMock) ListPolicies(ctx context.Context, req *request.ListPoliciesReq) (*response.ListPoliciesResp, error)
func (*AuthorizationServerMock) Reset ¶
func (m *AuthorizationServerMock) Reset()
Reset resets all overridden functions