authztest

package
v0.3.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthzTestService_NoPolicy_FullMethodName         = "/prefab.authz_test.AuthzTestService/NoPolicy"
	AuthzTestService_Self_FullMethodName             = "/prefab.authz_test.AuthzTestService/Self"
	AuthzTestService_GetDocument_FullMethodName      = "/prefab.authz_test.AuthzTestService/GetDocument"
	AuthzTestService_SaveDocument_FullMethodName     = "/prefab.authz_test.AuthzTestService/SaveDocument"
	AuthzTestService_GetDocumentTitle_FullMethodName = "/prefab.authz_test.AuthzTestService/GetDocumentTitle"
	AuthzTestService_ListDocuments_FullMethodName    = "/prefab.authz_test.AuthzTestService/ListDocuments"
)

Variables

View Source
var AuthzTestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "prefab.authz_test.AuthzTestService",
	HandlerType: (*AuthzTestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NoPolicy",
			Handler:    _AuthzTestService_NoPolicy_Handler,
		},
		{
			MethodName: "Self",
			Handler:    _AuthzTestService_Self_Handler,
		},
		{
			MethodName: "GetDocument",
			Handler:    _AuthzTestService_GetDocument_Handler,
		},
		{
			MethodName: "SaveDocument",
			Handler:    _AuthzTestService_SaveDocument_Handler,
		},
		{
			MethodName: "GetDocumentTitle",
			Handler:    _AuthzTestService_GetDocumentTitle_Handler,
		},
		{
			MethodName: "ListDocuments",
			Handler:    _AuthzTestService_ListDocuments_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "plugins/authz/authztest/acltest.proto",
}

AuthzTestService_ServiceDesc is the grpc.ServiceDesc for AuthzTestService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_plugins_authz_authztest_acltest_proto protoreflect.FileDescriptor

Functions

func RegisterAuthzTestServiceHandler

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

RegisterAuthzTestServiceHandler registers the http handlers for service AuthzTestService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAuthzTestServiceHandlerClient

func RegisterAuthzTestServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzTestServiceClient) error

RegisterAuthzTestServiceHandlerClient registers the http handlers for service AuthzTestService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthzTestServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthzTestServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthzTestServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterAuthzTestServiceHandlerFromEndpoint

func RegisterAuthzTestServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAuthzTestServiceHandlerFromEndpoint is same as RegisterAuthzTestServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAuthzTestServiceHandlerServer

func RegisterAuthzTestServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzTestServiceServer) error

RegisterAuthzTestServiceHandlerServer registers the http handlers for service AuthzTestService to "mux". UnaryRPC :call AuthzTestServiceServer 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 RegisterAuthzTestServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterAuthzTestServiceServer

func RegisterAuthzTestServiceServer(s grpc.ServiceRegistrar, srv AuthzTestServiceServer)

Types

type AuthzTestServiceClient

type AuthzTestServiceClient interface {
	NoPolicy(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	// Demonstrated an action only endpoint with no target resource.
	Self(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	// Demonstrates a standard deny Authz. All users are denied by default, and a
	// policy can be used to allow certain roles to view the document.
	GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*GetDocumentResponse, error)
	// Another standard deny Authz, but with a different action.
	SaveDocument(ctx context.Context, in *SaveDocumentRequest, opts ...grpc.CallOption) (*SaveDocumentResponse, error)
	// Demonstrates a default allow Authz. Policies can be used to restrict certain
	// roles from viewing the title.
	GetDocumentTitle(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*GetDocumentResponse, error)
	ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (*ListDocumentsResponse, error)
}

AuthzTestServiceClient is the client API for AuthzTestService 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.

type AuthzTestServiceServer

type AuthzTestServiceServer interface {
	NoPolicy(context.Context, *Request) (*Response, error)
	// Demonstrated an action only endpoint with no target resource.
	Self(context.Context, *Request) (*Response, error)
	// Demonstrates a standard deny Authz. All users are denied by default, and a
	// policy can be used to allow certain roles to view the document.
	GetDocument(context.Context, *GetDocumentRequest) (*GetDocumentResponse, error)
	// Another standard deny Authz, but with a different action.
	SaveDocument(context.Context, *SaveDocumentRequest) (*SaveDocumentResponse, error)
	// Demonstrates a default allow Authz. Policies can be used to restrict certain
	// roles from viewing the title.
	GetDocumentTitle(context.Context, *GetDocumentRequest) (*GetDocumentResponse, error)
	ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error)
	// contains filtered or unexported methods
}

AuthzTestServiceServer is the server API for AuthzTestService service. All implementations must embed UnimplementedAuthzTestServiceServer for forward compatibility.

type GetDocumentRequest

type GetDocumentRequest struct {
	OrgId      string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDocumentRequest) Descriptor deprecated

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

Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead.

func (*GetDocumentRequest) GetDocumentId

func (x *GetDocumentRequest) GetDocumentId() string

func (*GetDocumentRequest) GetOrgId

func (x *GetDocumentRequest) GetOrgId() string

func (*GetDocumentRequest) ProtoMessage

func (*GetDocumentRequest) ProtoMessage()

func (*GetDocumentRequest) ProtoReflect

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

func (*GetDocumentRequest) Reset

func (x *GetDocumentRequest) Reset()

func (*GetDocumentRequest) String

func (x *GetDocumentRequest) String() string

type GetDocumentResponse

type GetDocumentResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Body  string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDocumentResponse) Descriptor deprecated

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

Deprecated: Use GetDocumentResponse.ProtoReflect.Descriptor instead.

func (*GetDocumentResponse) GetBody

func (x *GetDocumentResponse) GetBody() string

func (*GetDocumentResponse) GetId

func (x *GetDocumentResponse) GetId() string

func (*GetDocumentResponse) GetTitle

func (x *GetDocumentResponse) GetTitle() string

func (*GetDocumentResponse) ProtoMessage

func (*GetDocumentResponse) ProtoMessage()

func (*GetDocumentResponse) ProtoReflect

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

func (*GetDocumentResponse) Reset

func (x *GetDocumentResponse) Reset()

func (*GetDocumentResponse) String

func (x *GetDocumentResponse) String() string

type ListDocumentsRequest

type ListDocumentsRequest struct {
	OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDocumentsRequest) Descriptor deprecated

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

Deprecated: Use ListDocumentsRequest.ProtoReflect.Descriptor instead.

func (*ListDocumentsRequest) GetOrgId

func (x *ListDocumentsRequest) GetOrgId() string

func (*ListDocumentsRequest) ProtoMessage

func (*ListDocumentsRequest) ProtoMessage()

func (*ListDocumentsRequest) ProtoReflect

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

func (*ListDocumentsRequest) Reset

func (x *ListDocumentsRequest) Reset()

func (*ListDocumentsRequest) String

func (x *ListDocumentsRequest) String() string

type ListDocumentsResponse

type ListDocumentsResponse struct {
	DocumentIds []string `protobuf:"bytes,1,rep,name=document_ids,json=documentIds,proto3" json:"document_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDocumentsResponse) Descriptor deprecated

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

Deprecated: Use ListDocumentsResponse.ProtoReflect.Descriptor instead.

func (*ListDocumentsResponse) GetDocumentIds

func (x *ListDocumentsResponse) GetDocumentIds() []string

func (*ListDocumentsResponse) ProtoMessage

func (*ListDocumentsResponse) ProtoMessage()

func (*ListDocumentsResponse) ProtoReflect

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

func (*ListDocumentsResponse) Reset

func (x *ListDocumentsResponse) Reset()

func (*ListDocumentsResponse) String

func (x *ListDocumentsResponse) String() string

type Request

type Request struct {
	Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetField

func (x *Request) GetField() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetSuccess

func (x *Response) GetSuccess() bool

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type SaveDocumentRequest

type SaveDocumentRequest struct {
	OrgId      string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"`
	DocumentId string `protobuf:"bytes,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
	Title      string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	Body       string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveDocumentRequest) Descriptor deprecated

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

Deprecated: Use SaveDocumentRequest.ProtoReflect.Descriptor instead.

func (*SaveDocumentRequest) GetBody

func (x *SaveDocumentRequest) GetBody() string

func (*SaveDocumentRequest) GetDocumentId

func (x *SaveDocumentRequest) GetDocumentId() string

func (*SaveDocumentRequest) GetOrgId

func (x *SaveDocumentRequest) GetOrgId() string

func (*SaveDocumentRequest) GetTitle

func (x *SaveDocumentRequest) GetTitle() string

func (*SaveDocumentRequest) ProtoMessage

func (*SaveDocumentRequest) ProtoMessage()

func (*SaveDocumentRequest) ProtoReflect

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

func (*SaveDocumentRequest) Reset

func (x *SaveDocumentRequest) Reset()

func (*SaveDocumentRequest) String

func (x *SaveDocumentRequest) String() string

type SaveDocumentResponse

type SaveDocumentResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Body  string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveDocumentResponse) Descriptor deprecated

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

Deprecated: Use SaveDocumentResponse.ProtoReflect.Descriptor instead.

func (*SaveDocumentResponse) GetBody

func (x *SaveDocumentResponse) GetBody() string

func (*SaveDocumentResponse) GetId

func (x *SaveDocumentResponse) GetId() string

func (*SaveDocumentResponse) GetTitle

func (x *SaveDocumentResponse) GetTitle() string

func (*SaveDocumentResponse) ProtoMessage

func (*SaveDocumentResponse) ProtoMessage()

func (*SaveDocumentResponse) ProtoReflect

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

func (*SaveDocumentResponse) Reset

func (x *SaveDocumentResponse) Reset()

func (*SaveDocumentResponse) String

func (x *SaveDocumentResponse) String() string

type UnimplementedAuthzTestServiceServer

type UnimplementedAuthzTestServiceServer struct{}

UnimplementedAuthzTestServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAuthzTestServiceServer) GetDocument

func (UnimplementedAuthzTestServiceServer) GetDocumentTitle

func (UnimplementedAuthzTestServiceServer) ListDocuments

func (UnimplementedAuthzTestServiceServer) NoPolicy

func (UnimplementedAuthzTestServiceServer) SaveDocument

func (UnimplementedAuthzTestServiceServer) Self

type UnsafeAuthzTestServiceServer

type UnsafeAuthzTestServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAuthzTestServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthzTestServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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