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 CreatePolicyRefRequest
- func (*CreatePolicyRefRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePolicyRefRequest) GetForceReconnect() bool
- func (x *CreatePolicyRefRequest) GetPolicyRef() *v1.PolicyRef
- func (*CreatePolicyRefRequest) ProtoMessage()
- func (x *CreatePolicyRefRequest) ProtoReflect() protoreflect.Message
- func (x *CreatePolicyRefRequest) Reset()
- func (x *CreatePolicyRefRequest) String() string
- type CreatePolicyRefResponse
- func (*CreatePolicyRefResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePolicyRefResponse) GetId() string
- func (*CreatePolicyRefResponse) ProtoMessage()
- func (x *CreatePolicyRefResponse) ProtoReflect() protoreflect.Message
- func (x *CreatePolicyRefResponse) Reset()
- func (x *CreatePolicyRefResponse) String() string
- type DeletePolicyRefRequest
- func (*DeletePolicyRefRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePolicyRefRequest) GetId() string
- func (*DeletePolicyRefRequest) ProtoMessage()
- func (x *DeletePolicyRefRequest) ProtoReflect() protoreflect.Message
- func (x *DeletePolicyRefRequest) Reset()
- func (x *DeletePolicyRefRequest) String() string
- type DeletePolicyRefResponse
- func (*DeletePolicyRefResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePolicyRefResponse) GetResult() *emptypb.Empty
- func (*DeletePolicyRefResponse) ProtoMessage()
- func (x *DeletePolicyRefResponse) ProtoReflect() protoreflect.Message
- func (x *DeletePolicyRefResponse) Reset()
- func (x *DeletePolicyRefResponse) String() string
- type ListPolicyRefsRequest
- type ListPolicyRefsResponse
- func (*ListPolicyRefsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListPolicyRefsResponse) GetResults() []*v1.PolicyRef
- func (*ListPolicyRefsResponse) ProtoMessage()
- func (x *ListPolicyRefsResponse) ProtoReflect() protoreflect.Message
- func (x *ListPolicyRefsResponse) Reset()
- func (x *ListPolicyRefsResponse) String() string
- type OPAConfig
- type OPADiscoveryRequest
- func (*OPADiscoveryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *OPADiscoveryRequest) GetPolicyId() string
- func (*OPADiscoveryRequest) ProtoMessage()
- func (x *OPADiscoveryRequest) ProtoReflect() protoreflect.Message
- func (x *OPADiscoveryRequest) Reset()
- func (x *OPADiscoveryRequest) String() string
- type OPADiscoveryResponse
- func (*OPADiscoveryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *OPADiscoveryResponse) GetOpa() *OPAConfig
- func (*OPADiscoveryResponse) ProtoMessage()
- func (x *OPADiscoveryResponse) ProtoReflect() protoreflect.Message
- func (x *OPADiscoveryResponse) Reset()
- func (x *OPADiscoveryResponse) String() string
- type PolicyClient
- type PolicyServer
- type UnimplementedPolicyServer
- func (UnimplementedPolicyServer) CreatePolicyRef(context.Context, *CreatePolicyRefRequest) (*CreatePolicyRefResponse, error)
- func (UnimplementedPolicyServer) DeletePolicyRef(context.Context, *DeletePolicyRefRequest) (*DeletePolicyRefResponse, error)
- func (UnimplementedPolicyServer) ListPolicyRefs(context.Context, *ListPolicyRefsRequest) (*ListPolicyRefsResponse, error)
- func (UnimplementedPolicyServer) OPADiscovery(context.Context, *OPADiscoveryRequest) (*OPADiscoveryResponse, error)
- func (UnimplementedPolicyServer) UpdatePolicyRef(context.Context, *UpdatePolicyRefRequest) (*UpdatePolicyRefResponse, error)
- type UnsafePolicyServer
- type UpdatePolicyRefRequest
- func (*UpdatePolicyRefRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePolicyRefRequest) GetPolicyRef() *v1.PolicyRef
- func (x *UpdatePolicyRefRequest) GetUpdateMask() *v1.Fields
- func (*UpdatePolicyRefRequest) ProtoMessage()
- func (x *UpdatePolicyRefRequest) ProtoReflect() protoreflect.Message
- func (x *UpdatePolicyRefRequest) Reset()
- func (x *UpdatePolicyRefRequest) String() string
- type UpdatePolicyRefResponse
- func (*UpdatePolicyRefResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePolicyRefResponse) GetResults() *emptypb.Empty
- func (*UpdatePolicyRefResponse) ProtoMessage()
- func (x *UpdatePolicyRefResponse) ProtoReflect() protoreflect.Message
- func (x *UpdatePolicyRefResponse) Reset()
- func (x *UpdatePolicyRefResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var File_aserto_tenant_policy_v1_policy_proto protoreflect.FileDescriptor
var Policy_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aserto.tenant.policy.v1.Policy", HandlerType: (*PolicyServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListPolicyRefs", Handler: _Policy_ListPolicyRefs_Handler, }, { MethodName: "CreatePolicyRef", Handler: _Policy_CreatePolicyRef_Handler, }, { MethodName: "DeletePolicyRef", Handler: _Policy_DeletePolicyRef_Handler, }, { MethodName: "UpdatePolicyRef", Handler: _Policy_UpdatePolicyRef_Handler, }, { MethodName: "OPADiscovery", Handler: _Policy_OPADiscovery_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "aserto/tenant/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 CreatePolicyRefRequest ¶
type CreatePolicyRefRequest struct { PolicyRef *v1.PolicyRef `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"` ForceReconnect bool `protobuf:"varint,2,opt,name=force_reconnect,json=forceReconnect,proto3" json:"force_reconnect,omitempty"` // contains filtered or unexported fields }
func (*CreatePolicyRefRequest) Descriptor
deprecated
func (*CreatePolicyRefRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreatePolicyRefRequest.ProtoReflect.Descriptor instead.
func (*CreatePolicyRefRequest) GetForceReconnect ¶
func (x *CreatePolicyRefRequest) GetForceReconnect() bool
func (*CreatePolicyRefRequest) GetPolicyRef ¶
func (x *CreatePolicyRefRequest) GetPolicyRef() *v1.PolicyRef
func (*CreatePolicyRefRequest) ProtoMessage ¶
func (*CreatePolicyRefRequest) ProtoMessage()
func (*CreatePolicyRefRequest) ProtoReflect ¶
func (x *CreatePolicyRefRequest) ProtoReflect() protoreflect.Message
func (*CreatePolicyRefRequest) Reset ¶
func (x *CreatePolicyRefRequest) Reset()
func (*CreatePolicyRefRequest) String ¶
func (x *CreatePolicyRefRequest) String() string
type CreatePolicyRefResponse ¶
type CreatePolicyRefResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreatePolicyRefResponse) Descriptor
deprecated
func (*CreatePolicyRefResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreatePolicyRefResponse.ProtoReflect.Descriptor instead.
func (*CreatePolicyRefResponse) GetId ¶
func (x *CreatePolicyRefResponse) GetId() string
func (*CreatePolicyRefResponse) ProtoMessage ¶
func (*CreatePolicyRefResponse) ProtoMessage()
func (*CreatePolicyRefResponse) ProtoReflect ¶
func (x *CreatePolicyRefResponse) ProtoReflect() protoreflect.Message
func (*CreatePolicyRefResponse) Reset ¶
func (x *CreatePolicyRefResponse) Reset()
func (*CreatePolicyRefResponse) String ¶
func (x *CreatePolicyRefResponse) String() string
type DeletePolicyRefRequest ¶
type DeletePolicyRefRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeletePolicyRefRequest) Descriptor
deprecated
func (*DeletePolicyRefRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeletePolicyRefRequest.ProtoReflect.Descriptor instead.
func (*DeletePolicyRefRequest) GetId ¶
func (x *DeletePolicyRefRequest) GetId() string
func (*DeletePolicyRefRequest) ProtoMessage ¶
func (*DeletePolicyRefRequest) ProtoMessage()
func (*DeletePolicyRefRequest) ProtoReflect ¶
func (x *DeletePolicyRefRequest) ProtoReflect() protoreflect.Message
func (*DeletePolicyRefRequest) Reset ¶
func (x *DeletePolicyRefRequest) Reset()
func (*DeletePolicyRefRequest) String ¶
func (x *DeletePolicyRefRequest) String() string
type DeletePolicyRefResponse ¶
type DeletePolicyRefResponse struct { Result *emptypb.Empty `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
func (*DeletePolicyRefResponse) Descriptor
deprecated
func (*DeletePolicyRefResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeletePolicyRefResponse.ProtoReflect.Descriptor instead.
func (*DeletePolicyRefResponse) GetResult ¶
func (x *DeletePolicyRefResponse) GetResult() *emptypb.Empty
func (*DeletePolicyRefResponse) ProtoMessage ¶
func (*DeletePolicyRefResponse) ProtoMessage()
func (*DeletePolicyRefResponse) ProtoReflect ¶
func (x *DeletePolicyRefResponse) ProtoReflect() protoreflect.Message
func (*DeletePolicyRefResponse) Reset ¶
func (x *DeletePolicyRefResponse) Reset()
func (*DeletePolicyRefResponse) String ¶
func (x *DeletePolicyRefResponse) String() string
type ListPolicyRefsRequest ¶
type ListPolicyRefsRequest struct {
// contains filtered or unexported fields
}
func (*ListPolicyRefsRequest) Descriptor
deprecated
func (*ListPolicyRefsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListPolicyRefsRequest.ProtoReflect.Descriptor instead.
func (*ListPolicyRefsRequest) ProtoMessage ¶
func (*ListPolicyRefsRequest) ProtoMessage()
func (*ListPolicyRefsRequest) ProtoReflect ¶
func (x *ListPolicyRefsRequest) ProtoReflect() protoreflect.Message
func (*ListPolicyRefsRequest) Reset ¶
func (x *ListPolicyRefsRequest) Reset()
func (*ListPolicyRefsRequest) String ¶
func (x *ListPolicyRefsRequest) String() string
type ListPolicyRefsResponse ¶
type ListPolicyRefsResponse struct { Results []*v1.PolicyRef `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*ListPolicyRefsResponse) Descriptor
deprecated
func (*ListPolicyRefsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListPolicyRefsResponse.ProtoReflect.Descriptor instead.
func (*ListPolicyRefsResponse) GetResults ¶
func (x *ListPolicyRefsResponse) GetResults() []*v1.PolicyRef
func (*ListPolicyRefsResponse) ProtoMessage ¶
func (*ListPolicyRefsResponse) ProtoMessage()
func (*ListPolicyRefsResponse) ProtoReflect ¶
func (x *ListPolicyRefsResponse) ProtoReflect() protoreflect.Message
func (*ListPolicyRefsResponse) Reset ¶
func (x *ListPolicyRefsResponse) Reset()
func (*ListPolicyRefsResponse) String ¶
func (x *ListPolicyRefsResponse) String() string
type OPAConfig ¶
type OPAConfig struct { Discovery *structpb.Struct `protobuf:"bytes,1,opt,name=discovery,proto3" json:"discovery,omitempty"` // contains filtered or unexported fields }
func (*OPAConfig) Descriptor
deprecated
func (*OPAConfig) GetDiscovery ¶
func (*OPAConfig) ProtoMessage ¶
func (*OPAConfig) ProtoMessage()
func (*OPAConfig) ProtoReflect ¶
func (x *OPAConfig) ProtoReflect() protoreflect.Message
type OPADiscoveryRequest ¶
type OPADiscoveryRequest struct { PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` // contains filtered or unexported fields }
func (*OPADiscoveryRequest) Descriptor
deprecated
func (*OPADiscoveryRequest) Descriptor() ([]byte, []int)
Deprecated: Use OPADiscoveryRequest.ProtoReflect.Descriptor instead.
func (*OPADiscoveryRequest) GetPolicyId ¶
func (x *OPADiscoveryRequest) GetPolicyId() string
func (*OPADiscoveryRequest) ProtoMessage ¶
func (*OPADiscoveryRequest) ProtoMessage()
func (*OPADiscoveryRequest) ProtoReflect ¶
func (x *OPADiscoveryRequest) ProtoReflect() protoreflect.Message
func (*OPADiscoveryRequest) Reset ¶
func (x *OPADiscoveryRequest) Reset()
func (*OPADiscoveryRequest) String ¶
func (x *OPADiscoveryRequest) String() string
type OPADiscoveryResponse ¶
type OPADiscoveryResponse struct { Opa *OPAConfig `protobuf:"bytes,1,opt,name=opa,proto3" json:"opa,omitempty"` // contains filtered or unexported fields }
func (*OPADiscoveryResponse) Descriptor
deprecated
func (*OPADiscoveryResponse) Descriptor() ([]byte, []int)
Deprecated: Use OPADiscoveryResponse.ProtoReflect.Descriptor instead.
func (*OPADiscoveryResponse) GetOpa ¶
func (x *OPADiscoveryResponse) GetOpa() *OPAConfig
func (*OPADiscoveryResponse) ProtoMessage ¶
func (*OPADiscoveryResponse) ProtoMessage()
func (*OPADiscoveryResponse) ProtoReflect ¶
func (x *OPADiscoveryResponse) ProtoReflect() protoreflect.Message
func (*OPADiscoveryResponse) Reset ¶
func (x *OPADiscoveryResponse) Reset()
func (*OPADiscoveryResponse) String ¶
func (x *OPADiscoveryResponse) String() string
type PolicyClient ¶
type PolicyClient interface { ListPolicyRefs(ctx context.Context, in *ListPolicyRefsRequest, opts ...grpc.CallOption) (*ListPolicyRefsResponse, error) CreatePolicyRef(ctx context.Context, in *CreatePolicyRefRequest, opts ...grpc.CallOption) (*CreatePolicyRefResponse, error) DeletePolicyRef(ctx context.Context, in *DeletePolicyRefRequest, opts ...grpc.CallOption) (*DeletePolicyRefResponse, error) UpdatePolicyRef(ctx context.Context, in *UpdatePolicyRefRequest, opts ...grpc.CallOption) (*UpdatePolicyRefResponse, error) OPADiscovery(ctx context.Context, in *OPADiscoveryRequest, opts ...grpc.CallOption) (*OPADiscoveryResponse, 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 PolicyServer ¶
type PolicyServer interface { ListPolicyRefs(context.Context, *ListPolicyRefsRequest) (*ListPolicyRefsResponse, error) CreatePolicyRef(context.Context, *CreatePolicyRefRequest) (*CreatePolicyRefResponse, error) DeletePolicyRef(context.Context, *DeletePolicyRefRequest) (*DeletePolicyRefResponse, error) UpdatePolicyRef(context.Context, *UpdatePolicyRefRequest) (*UpdatePolicyRefResponse, error) OPADiscovery(context.Context, *OPADiscoveryRequest) (*OPADiscoveryResponse, 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) CreatePolicyRef ¶
func (UnimplementedPolicyServer) CreatePolicyRef(context.Context, *CreatePolicyRefRequest) (*CreatePolicyRefResponse, error)
func (UnimplementedPolicyServer) DeletePolicyRef ¶
func (UnimplementedPolicyServer) DeletePolicyRef(context.Context, *DeletePolicyRefRequest) (*DeletePolicyRefResponse, error)
func (UnimplementedPolicyServer) ListPolicyRefs ¶
func (UnimplementedPolicyServer) ListPolicyRefs(context.Context, *ListPolicyRefsRequest) (*ListPolicyRefsResponse, error)
func (UnimplementedPolicyServer) OPADiscovery ¶
func (UnimplementedPolicyServer) OPADiscovery(context.Context, *OPADiscoveryRequest) (*OPADiscoveryResponse, error)
func (UnimplementedPolicyServer) UpdatePolicyRef ¶
func (UnimplementedPolicyServer) UpdatePolicyRef(context.Context, *UpdatePolicyRefRequest) (*UpdatePolicyRefResponse, 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.
type UpdatePolicyRefRequest ¶
type UpdatePolicyRefRequest struct { PolicyRef *v1.PolicyRef `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"` UpdateMask *v1.Fields `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*UpdatePolicyRefRequest) Descriptor
deprecated
func (*UpdatePolicyRefRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePolicyRefRequest.ProtoReflect.Descriptor instead.
func (*UpdatePolicyRefRequest) GetPolicyRef ¶
func (x *UpdatePolicyRefRequest) GetPolicyRef() *v1.PolicyRef
func (*UpdatePolicyRefRequest) GetUpdateMask ¶
func (x *UpdatePolicyRefRequest) GetUpdateMask() *v1.Fields
func (*UpdatePolicyRefRequest) ProtoMessage ¶
func (*UpdatePolicyRefRequest) ProtoMessage()
func (*UpdatePolicyRefRequest) ProtoReflect ¶
func (x *UpdatePolicyRefRequest) ProtoReflect() protoreflect.Message
func (*UpdatePolicyRefRequest) Reset ¶
func (x *UpdatePolicyRefRequest) Reset()
func (*UpdatePolicyRefRequest) String ¶
func (x *UpdatePolicyRefRequest) String() string
type UpdatePolicyRefResponse ¶
type UpdatePolicyRefResponse struct { Results *emptypb.Empty `protobuf:"bytes,1,opt,name=results,proto3" json:"results,omitempty"` // contains filtered or unexported fields }
func (*UpdatePolicyRefResponse) Descriptor
deprecated
func (*UpdatePolicyRefResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePolicyRefResponse.ProtoReflect.Descriptor instead.
func (*UpdatePolicyRefResponse) GetResults ¶
func (x *UpdatePolicyRefResponse) GetResults() *emptypb.Empty
func (*UpdatePolicyRefResponse) ProtoMessage ¶
func (*UpdatePolicyRefResponse) ProtoMessage()
func (*UpdatePolicyRefResponse) ProtoReflect ¶
func (x *UpdatePolicyRefResponse) ProtoReflect() protoreflect.Message
func (*UpdatePolicyRefResponse) Reset ¶
func (x *UpdatePolicyRefResponse) Reset()
func (*UpdatePolicyRefResponse) String ¶
func (x *UpdatePolicyRefResponse) String() string