policy

package
v0.8.63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package policy is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Policy_ListPolicies_FullMethodName = "/aserto.authorizer.policy.v1.Policy/ListPolicies"
	Policy_GetPolicies_FullMethodName  = "/aserto.authorizer.policy.v1.Policy/GetPolicies"
	Policy_GetModule_FullMethodName    = "/aserto.authorizer.policy.v1.Policy/GetModule"
)

Variables

View Source
var File_aserto_authorizer_policy_v1_policy_proto protoreflect.FileDescriptor
View Source
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

func RegisterPolicyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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"`
	PolicyName    string `protobuf:"bytes,3,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"`
	InstanceLabel string `protobuf:"bytes,4,opt,name=instance_label,json=instanceLabel,proto3" json:"instance_label,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) GetInstanceLabel added in v0.8.29

func (x *GetModuleRequest) GetInstanceLabel() string

func (*GetModuleRequest) GetPolicyId

func (x *GetModuleRequest) GetPolicyId() string

func (*GetModuleRequest) GetPolicyName added in v0.8.29

func (x *GetModuleRequest) GetPolicyName() 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"`
	Name          string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	InstanceLabel string `protobuf:"bytes,3,opt,name=instance_label,json=instanceLabel,proto3" json:"instance_label,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) GetInstanceLabel added in v0.8.29

func (x *GetPoliciesRequest) GetInstanceLabel() string

func (*GetPoliciesRequest) GetName added in v0.8.29

func (x *GetPoliciesRequest) GetName() 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) Descriptor() ([]byte, []int)

Deprecated: Use Module.ProtoReflect.Descriptor instead.

func (*Module) GetContent

func (x *Module) GetContent() string

func (*Module) GetId

func (x *Module) GetId() string

func (*Module) GetName

func (x *Module) GetName() string

func (*Module) GetRules

func (x *Module) GetRules() []string

func (*Module) ProtoMessage

func (*Module) ProtoMessage()

func (*Module) ProtoReflect

func (x *Module) ProtoReflect() protoreflect.Message

func (*Module) Reset

func (x *Module) Reset()

func (*Module) String

func (x *Module) String() string

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

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) GetPolicies

func (UnimplementedPolicyServer) ListPolicies

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL