Documentation ¶
Overview ¶
Package policy is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterPolicyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPolicyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PolicyClient) error
- func RegisterPolicyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPolicyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PolicyServer) error
- func RegisterPolicyServer(s grpc.ServiceRegistrar, srv PolicyServer)
- type GetModuleRequest
- func (*GetModuleRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetModuleRequest) GetId() string
- func (x *GetModuleRequest) GetPolicyId() string
- func (*GetModuleRequest) ProtoMessage()
- func (x *GetModuleRequest) ProtoReflect() protoreflect.Message
- func (x *GetModuleRequest) Reset()
- func (x *GetModuleRequest) String() string
- type GetModuleResponse
- type GetPoliciesRequest
- type GetPoliciesResponse
- func (*GetPoliciesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPoliciesResponse) GetId() string
- func (x *GetPoliciesResponse) GetName() string
- func (x *GetPoliciesResponse) GetPolicies() []*PolicyItem
- func (*GetPoliciesResponse) ProtoMessage()
- func (x *GetPoliciesResponse) ProtoReflect() protoreflect.Message
- func (x *GetPoliciesResponse) Reset()
- func (x *GetPoliciesResponse) String() string
- type ListPoliciesRequest
- type ListPoliciesResponse
- func (*ListPoliciesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListPoliciesResponse) GetResults() []*PolicyItem
- func (*ListPoliciesResponse) ProtoMessage()
- func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message
- func (x *ListPoliciesResponse) Reset()
- func (x *ListPoliciesResponse) String() string
- type Module
- func (*Module) Descriptor() ([]byte, []int)deprecated
- func (x *Module) GetContent() string
- func (x *Module) GetId() string
- func (x *Module) GetName() string
- func (x *Module) GetRules() []string
- func (*Module) ProtoMessage()
- func (x *Module) ProtoReflect() protoreflect.Message
- func (x *Module) Reset()
- func (x *Module) String() string
- type PolicyClient
- type PolicyItem
- type PolicyServer
- type UnimplementedPolicyServer
- func (UnimplementedPolicyServer) GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error)
- func (UnimplementedPolicyServer) GetPolicies(context.Context, *GetPoliciesRequest) (*GetPoliciesResponse, error)
- func (UnimplementedPolicyServer) ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error)
- type UnsafePolicyServer
Constants ¶
This section is empty.
Variables ¶
var Policy_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aserto.authorizer.policy.v1.Policy", HandlerType: (*PolicyServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListPolicies", Handler: _Policy_ListPolicies_Handler, }, { MethodName: "GetPolicies", Handler: _Policy_GetPolicies_Handler, }, { MethodName: "GetModule", Handler: _Policy_GetModule_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "aserto/authorizer/policy/v1/policy.proto", }
Policy_ServiceDesc is the grpc.ServiceDesc for Policy service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPolicyHandler ¶
RegisterPolicyHandler registers the http handlers for service Policy to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPolicyHandlerClient ¶
func RegisterPolicyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PolicyClient) error
RegisterPolicyHandlerClient registers the http handlers for service Policy to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PolicyClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PolicyClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PolicyClient" to call the correct interceptors.
func RegisterPolicyHandlerFromEndpoint ¶
func RegisterPolicyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPolicyHandlerFromEndpoint is same as RegisterPolicyHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPolicyHandlerServer ¶
func RegisterPolicyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PolicyServer) error
RegisterPolicyHandlerServer registers the http handlers for service Policy to "mux". UnaryRPC :call PolicyServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPolicyHandlerFromEndpoint instead.
func RegisterPolicyServer ¶
func RegisterPolicyServer(s grpc.ServiceRegistrar, srv PolicyServer)
Types ¶
type GetModuleRequest ¶
type GetModuleRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` PolicyId string `protobuf:"bytes,2,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` // contains filtered or unexported fields }
func (*GetModuleRequest) Descriptor
deprecated
func (*GetModuleRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetModuleRequest.ProtoReflect.Descriptor instead.
func (*GetModuleRequest) GetId ¶
func (x *GetModuleRequest) GetId() string
func (*GetModuleRequest) GetPolicyId ¶
func (x *GetModuleRequest) GetPolicyId() string
func (*GetModuleRequest) ProtoMessage ¶
func (*GetModuleRequest) ProtoMessage()
func (*GetModuleRequest) ProtoReflect ¶
func (x *GetModuleRequest) ProtoReflect() protoreflect.Message
func (*GetModuleRequest) Reset ¶
func (x *GetModuleRequest) Reset()
func (*GetModuleRequest) String ¶
func (x *GetModuleRequest) String() string
type GetModuleResponse ¶
type GetModuleResponse struct { Module *Module `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` // contains filtered or unexported fields }
func (*GetModuleResponse) Descriptor
deprecated
func (*GetModuleResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetModuleResponse.ProtoReflect.Descriptor instead.
func (*GetModuleResponse) GetModule ¶
func (x *GetModuleResponse) GetModule() *Module
func (*GetModuleResponse) ProtoMessage ¶
func (*GetModuleResponse) ProtoMessage()
func (*GetModuleResponse) ProtoReflect ¶
func (x *GetModuleResponse) ProtoReflect() protoreflect.Message
func (*GetModuleResponse) Reset ¶
func (x *GetModuleResponse) Reset()
func (*GetModuleResponse) String ¶
func (x *GetModuleResponse) String() string
type GetPoliciesRequest ¶
type GetPoliciesRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetPoliciesRequest) Descriptor
deprecated
func (*GetPoliciesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPoliciesRequest.ProtoReflect.Descriptor instead.
func (*GetPoliciesRequest) GetId ¶
func (x *GetPoliciesRequest) GetId() string
func (*GetPoliciesRequest) ProtoMessage ¶
func (*GetPoliciesRequest) ProtoMessage()
func (*GetPoliciesRequest) ProtoReflect ¶
func (x *GetPoliciesRequest) ProtoReflect() protoreflect.Message
func (*GetPoliciesRequest) Reset ¶
func (x *GetPoliciesRequest) Reset()
func (*GetPoliciesRequest) String ¶
func (x *GetPoliciesRequest) String() string
type GetPoliciesResponse ¶
type GetPoliciesResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Policies []*PolicyItem `protobuf:"bytes,3,rep,name=policies,proto3" json:"policies,omitempty"` // contains filtered or unexported fields }
func (*GetPoliciesResponse) Descriptor
deprecated
func (*GetPoliciesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPoliciesResponse.ProtoReflect.Descriptor instead.
func (*GetPoliciesResponse) GetId ¶
func (x *GetPoliciesResponse) GetId() string
func (*GetPoliciesResponse) GetName ¶
func (x *GetPoliciesResponse) GetName() string
func (*GetPoliciesResponse) GetPolicies ¶
func (x *GetPoliciesResponse) GetPolicies() []*PolicyItem
func (*GetPoliciesResponse) ProtoMessage ¶
func (*GetPoliciesResponse) ProtoMessage()
func (*GetPoliciesResponse) ProtoReflect ¶
func (x *GetPoliciesResponse) ProtoReflect() protoreflect.Message
func (*GetPoliciesResponse) Reset ¶
func (x *GetPoliciesResponse) Reset()
func (*GetPoliciesResponse) String ¶
func (x *GetPoliciesResponse) String() string
type ListPoliciesRequest ¶
type ListPoliciesRequest struct {
// contains filtered or unexported fields
}
func (*ListPoliciesRequest) Descriptor
deprecated
func (*ListPoliciesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListPoliciesRequest.ProtoReflect.Descriptor instead.
func (*ListPoliciesRequest) ProtoMessage ¶
func (*ListPoliciesRequest) ProtoMessage()
func (*ListPoliciesRequest) ProtoReflect ¶
func (x *ListPoliciesRequest) ProtoReflect() protoreflect.Message
func (*ListPoliciesRequest) Reset ¶
func (x *ListPoliciesRequest) Reset()
func (*ListPoliciesRequest) String ¶
func (x *ListPoliciesRequest) String() string
type ListPoliciesResponse ¶
type ListPoliciesResponse struct { Results []*PolicyItem `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*ListPoliciesResponse) Descriptor
deprecated
func (*ListPoliciesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListPoliciesResponse.ProtoReflect.Descriptor instead.
func (*ListPoliciesResponse) GetResults ¶
func (x *ListPoliciesResponse) GetResults() []*PolicyItem
func (*ListPoliciesResponse) ProtoMessage ¶
func (*ListPoliciesResponse) ProtoMessage()
func (*ListPoliciesResponse) ProtoReflect ¶
func (x *ListPoliciesResponse) ProtoReflect() protoreflect.Message
func (*ListPoliciesResponse) Reset ¶
func (x *ListPoliciesResponse) Reset()
func (*ListPoliciesResponse) String ¶
func (x *ListPoliciesResponse) String() string
type Module ¶
type Module struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Rules []string `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` // contains filtered or unexported fields }
func (*Module) Descriptor
deprecated
func (*Module) GetContent ¶
func (*Module) ProtoMessage ¶
func (*Module) ProtoMessage()
func (*Module) ProtoReflect ¶
func (x *Module) ProtoReflect() protoreflect.Message
type PolicyClient ¶
type PolicyClient interface { ListPolicies(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) GetPolicies(ctx context.Context, in *GetPoliciesRequest, opts ...grpc.CallOption) (*GetPoliciesResponse, error) GetModule(ctx context.Context, in *GetModuleRequest, opts ...grpc.CallOption) (*GetModuleResponse, error) }
PolicyClient is the client API for Policy service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPolicyClient ¶
func NewPolicyClient(cc grpc.ClientConnInterface) PolicyClient
type PolicyItem ¶
type PolicyItem struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*PolicyItem) Descriptor
deprecated
func (*PolicyItem) Descriptor() ([]byte, []int)
Deprecated: Use PolicyItem.ProtoReflect.Descriptor instead.
func (*PolicyItem) GetId ¶
func (x *PolicyItem) GetId() string
func (*PolicyItem) GetName ¶
func (x *PolicyItem) GetName() string
func (*PolicyItem) ProtoMessage ¶
func (*PolicyItem) ProtoMessage()
func (*PolicyItem) ProtoReflect ¶
func (x *PolicyItem) ProtoReflect() protoreflect.Message
func (*PolicyItem) Reset ¶
func (x *PolicyItem) Reset()
func (*PolicyItem) String ¶
func (x *PolicyItem) String() string
type PolicyServer ¶
type PolicyServer interface { ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) GetPolicies(context.Context, *GetPoliciesRequest) (*GetPoliciesResponse, error) GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error) }
PolicyServer is the server API for Policy service. All implementations should embed UnimplementedPolicyServer for forward compatibility
type UnimplementedPolicyServer ¶
type UnimplementedPolicyServer struct { }
UnimplementedPolicyServer should be embedded to have forward compatible implementations.
func (UnimplementedPolicyServer) GetModule ¶
func (UnimplementedPolicyServer) GetModule(context.Context, *GetModuleRequest) (*GetModuleResponse, error)
func (UnimplementedPolicyServer) GetPolicies ¶
func (UnimplementedPolicyServer) GetPolicies(context.Context, *GetPoliciesRequest) (*GetPoliciesResponse, error)
func (UnimplementedPolicyServer) ListPolicies ¶
func (UnimplementedPolicyServer) ListPolicies(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error)
type UnsafePolicyServer ¶
type UnsafePolicyServer interface {
// contains filtered or unexported methods
}
UnsafePolicyServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PolicyServer will result in compilation errors.