policy

package
v0.8.55 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Overview

Package policy is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_aserto_tenant_policy_v1_policy_proto protoreflect.FileDescriptor
View Source
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,
		},
		{
			MethodName: "OPAInstanceDiscovery",
			Handler:    _Policy_OPAInstanceDiscovery_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

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 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) Descriptor() ([]byte, []int)

Deprecated: Use OPAConfig.ProtoReflect.Descriptor instead.

func (*OPAConfig) GetDiscovery

func (x *OPAConfig) GetDiscovery() *structpb.Struct

func (*OPAConfig) ProtoMessage

func (*OPAConfig) ProtoMessage()

func (*OPAConfig) ProtoReflect

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

func (*OPAConfig) Reset

func (x *OPAConfig) Reset()

func (*OPAConfig) String

func (x *OPAConfig) String() string

type OPADiscoveryRequest

type OPADiscoveryRequest struct {
	PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	UseTags  string `protobuf:"bytes,2,opt,name=use_tags,json=useTags,proto3" json:"use_tags,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) GetUseTags added in v0.8.35

func (x *OPADiscoveryRequest) GetUseTags() 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 OPAInstanceDiscoveryRequest added in v0.8.29

type OPAInstanceDiscoveryRequest struct {
	PolicyName    string `protobuf:"bytes,1,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"`
	InstanceLabel string `protobuf:"bytes,2,opt,name=instance_label,json=instanceLabel,proto3" json:"instance_label,omitempty"`
	// contains filtered or unexported fields
}

func (*OPAInstanceDiscoveryRequest) Descriptor deprecated added in v0.8.29

func (*OPAInstanceDiscoveryRequest) Descriptor() ([]byte, []int)

Deprecated: Use OPAInstanceDiscoveryRequest.ProtoReflect.Descriptor instead.

func (*OPAInstanceDiscoveryRequest) GetInstanceLabel added in v0.8.29

func (x *OPAInstanceDiscoveryRequest) GetInstanceLabel() string

func (*OPAInstanceDiscoveryRequest) GetPolicyName added in v0.8.29

func (x *OPAInstanceDiscoveryRequest) GetPolicyName() string

func (*OPAInstanceDiscoveryRequest) ProtoMessage added in v0.8.29

func (*OPAInstanceDiscoveryRequest) ProtoMessage()

func (*OPAInstanceDiscoveryRequest) ProtoReflect added in v0.8.29

func (*OPAInstanceDiscoveryRequest) Reset added in v0.8.29

func (x *OPAInstanceDiscoveryRequest) Reset()

func (*OPAInstanceDiscoveryRequest) String added in v0.8.29

func (x *OPAInstanceDiscoveryRequest) String() string

type OPAInstanceDiscoveryResponse added in v0.8.29

type OPAInstanceDiscoveryResponse struct {
	Opa *OPAConfig `protobuf:"bytes,1,opt,name=opa,proto3" json:"opa,omitempty"`
	// contains filtered or unexported fields
}

func (*OPAInstanceDiscoveryResponse) Descriptor deprecated added in v0.8.29

func (*OPAInstanceDiscoveryResponse) Descriptor() ([]byte, []int)

Deprecated: Use OPAInstanceDiscoveryResponse.ProtoReflect.Descriptor instead.

func (*OPAInstanceDiscoveryResponse) GetOpa added in v0.8.29

func (*OPAInstanceDiscoveryResponse) ProtoMessage added in v0.8.29

func (*OPAInstanceDiscoveryResponse) ProtoMessage()

func (*OPAInstanceDiscoveryResponse) ProtoReflect added in v0.8.29

func (*OPAInstanceDiscoveryResponse) Reset added in v0.8.29

func (x *OPAInstanceDiscoveryResponse) Reset()

func (*OPAInstanceDiscoveryResponse) String added in v0.8.29

type PolicyClient

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

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

func (UnimplementedPolicyServer) ListPolicyRefs

func (UnimplementedPolicyServer) OPADiscovery

func (UnimplementedPolicyServer) OPAInstanceDiscovery added in v0.8.29

func (UnimplementedPolicyServer) UpdatePolicyRef

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

Jump to

Keyboard shortcuts

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