Documentation ¶
Overview ¶
Package authzv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAuthzAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthzAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzAPIClient) error
- func RegisterAuthzAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthzAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzAPIServer) error
- func RegisterAuthzAPIServer(s grpc.ServiceRegistrar, srv AuthzAPIServer)
- type AuthzAPIClient
- type AuthzAPIServer
- type CheckRequest
- func (*CheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckRequest) GetActionType() v1.ActionType
- func (x *CheckRequest) GetMethod() string
- func (x *CheckRequest) GetResource() string
- func (x *CheckRequest) GetSubject() *Subject
- func (*CheckRequest) ProtoMessage()
- func (x *CheckRequest) ProtoReflect() protoreflect.Message
- func (x *CheckRequest) Reset()
- func (x *CheckRequest) String() string
- func (m *CheckRequest) Validate() error
- func (m *CheckRequest) ValidateAll() error
- type CheckRequestMultiError
- type CheckRequestValidationError
- func (e CheckRequestValidationError) Cause() error
- func (e CheckRequestValidationError) Error() string
- func (e CheckRequestValidationError) ErrorName() string
- func (e CheckRequestValidationError) Field() string
- func (e CheckRequestValidationError) Key() bool
- func (e CheckRequestValidationError) Reason() string
- type CheckResponse
- func (*CheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckResponse) GetDecision() Decision
- func (*CheckResponse) ProtoMessage()
- func (x *CheckResponse) ProtoReflect() protoreflect.Message
- func (x *CheckResponse) Reset()
- func (x *CheckResponse) String() string
- func (m *CheckResponse) Validate() error
- func (m *CheckResponse) ValidateAll() error
- type CheckResponseMultiError
- type CheckResponseValidationError
- func (e CheckResponseValidationError) Cause() error
- func (e CheckResponseValidationError) Error() string
- func (e CheckResponseValidationError) ErrorName() string
- func (e CheckResponseValidationError) Field() string
- func (e CheckResponseValidationError) Key() bool
- func (e CheckResponseValidationError) Reason() string
- type Decision
- type Subject
- func (*Subject) Descriptor() ([]byte, []int)deprecated
- func (x *Subject) GetGroups() []string
- func (x *Subject) GetUser() string
- func (*Subject) ProtoMessage()
- func (x *Subject) ProtoReflect() protoreflect.Message
- func (x *Subject) Reset()
- func (x *Subject) String() string
- func (m *Subject) Validate() error
- func (m *Subject) ValidateAll() error
- type SubjectMultiError
- type SubjectValidationError
- type UnimplementedAuthzAPIServer
- type UnsafeAuthzAPIServer
Constants ¶
const (
AuthzAPI_Check_FullMethodName = "/clutch.authz.v1.AuthzAPI/Check"
)
Variables ¶
var ( Decision_name = map[int32]string{ 0: "UNSPECIFIED", 1: "DENY", 2: "ALLOW", } Decision_value = map[string]int32{ "UNSPECIFIED": 0, "DENY": 1, "ALLOW": 2, } )
Enum value maps for Decision.
var AuthzAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "clutch.authz.v1.AuthzAPI", HandlerType: (*AuthzAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _AuthzAPI_Check_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "authz/v1/authz.proto", }
AuthzAPI_ServiceDesc is the grpc.ServiceDesc for AuthzAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_authz_v1_authz_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthzAPIHandler ¶
func RegisterAuthzAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthzAPIHandler registers the http handlers for service AuthzAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthzAPIHandlerClient ¶
func RegisterAuthzAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthzAPIClient) error
RegisterAuthzAPIHandlerClient registers the http handlers for service AuthzAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthzAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthzAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthzAPIClient" to call the correct interceptors.
func RegisterAuthzAPIHandlerFromEndpoint ¶
func RegisterAuthzAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthzAPIHandlerFromEndpoint is same as RegisterAuthzAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthzAPIHandlerServer ¶
func RegisterAuthzAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthzAPIServer) error
RegisterAuthzAPIHandlerServer registers the http handlers for service AuthzAPI to "mux". UnaryRPC :call AuthzAPIServer 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 RegisterAuthzAPIHandlerFromEndpoint instead.
func RegisterAuthzAPIServer ¶
func RegisterAuthzAPIServer(s grpc.ServiceRegistrar, srv AuthzAPIServer)
Types ¶
type AuthzAPIClient ¶
type AuthzAPIClient interface {
Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
}
AuthzAPIClient is the client API for AuthzAPI 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 NewAuthzAPIClient ¶
func NewAuthzAPIClient(cc grpc.ClientConnInterface) AuthzAPIClient
type AuthzAPIServer ¶
type AuthzAPIServer interface {
Check(context.Context, *CheckRequest) (*CheckResponse, error)
}
AuthzAPIServer is the server API for AuthzAPI service. All implementations should embed UnimplementedAuthzAPIServer for forward compatibility
type CheckRequest ¶
type CheckRequest struct { Subject *Subject `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` ActionType v1.ActionType `protobuf:"varint,3,opt,name=action_type,json=actionType,proto3,enum=clutch.api.v1.ActionType" json:"action_type,omitempty"` Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"` // contains filtered or unexported fields }
func (*CheckRequest) Descriptor
deprecated
func (*CheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.
func (*CheckRequest) GetActionType ¶
func (x *CheckRequest) GetActionType() v1.ActionType
func (*CheckRequest) GetMethod ¶
func (x *CheckRequest) GetMethod() string
func (*CheckRequest) GetResource ¶
func (x *CheckRequest) GetResource() string
func (*CheckRequest) GetSubject ¶
func (x *CheckRequest) GetSubject() *Subject
func (*CheckRequest) ProtoMessage ¶
func (*CheckRequest) ProtoMessage()
func (*CheckRequest) ProtoReflect ¶
func (x *CheckRequest) ProtoReflect() protoreflect.Message
func (*CheckRequest) Reset ¶
func (x *CheckRequest) Reset()
func (*CheckRequest) String ¶
func (x *CheckRequest) String() string
func (*CheckRequest) Validate ¶
func (m *CheckRequest) Validate() error
Validate checks the field values on CheckRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CheckRequest) ValidateAll ¶
func (m *CheckRequest) ValidateAll() error
ValidateAll checks the field values on CheckRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CheckRequestMultiError, or nil if none found.
type CheckRequestMultiError ¶
type CheckRequestMultiError []error
CheckRequestMultiError is an error wrapping multiple validation errors returned by CheckRequest.ValidateAll() if the designated constraints aren't met.
func (CheckRequestMultiError) AllErrors ¶
func (m CheckRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CheckRequestMultiError) Error ¶
func (m CheckRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CheckRequestValidationError ¶
type CheckRequestValidationError struct {
// contains filtered or unexported fields
}
CheckRequestValidationError is the validation error returned by CheckRequest.Validate if the designated constraints aren't met.
func (CheckRequestValidationError) Cause ¶
func (e CheckRequestValidationError) Cause() error
Cause function returns cause value.
func (CheckRequestValidationError) Error ¶
func (e CheckRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CheckRequestValidationError) ErrorName ¶
func (e CheckRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CheckRequestValidationError) Field ¶
func (e CheckRequestValidationError) Field() string
Field function returns field value.
func (CheckRequestValidationError) Key ¶
func (e CheckRequestValidationError) Key() bool
Key function returns key value.
func (CheckRequestValidationError) Reason ¶
func (e CheckRequestValidationError) Reason() string
Reason function returns reason value.
type CheckResponse ¶
type CheckResponse struct { Decision Decision `protobuf:"varint,1,opt,name=decision,proto3,enum=clutch.authz.v1.Decision" json:"decision,omitempty"` // contains filtered or unexported fields }
func (*CheckResponse) Descriptor
deprecated
func (*CheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.
func (*CheckResponse) GetDecision ¶
func (x *CheckResponse) GetDecision() Decision
func (*CheckResponse) ProtoMessage ¶
func (*CheckResponse) ProtoMessage()
func (*CheckResponse) ProtoReflect ¶
func (x *CheckResponse) ProtoReflect() protoreflect.Message
func (*CheckResponse) Reset ¶
func (x *CheckResponse) Reset()
func (*CheckResponse) String ¶
func (x *CheckResponse) String() string
func (*CheckResponse) Validate ¶
func (m *CheckResponse) Validate() error
Validate checks the field values on CheckResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CheckResponse) ValidateAll ¶
func (m *CheckResponse) ValidateAll() error
ValidateAll checks the field values on CheckResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CheckResponseMultiError, or nil if none found.
type CheckResponseMultiError ¶
type CheckResponseMultiError []error
CheckResponseMultiError is an error wrapping multiple validation errors returned by CheckResponse.ValidateAll() if the designated constraints aren't met.
func (CheckResponseMultiError) AllErrors ¶
func (m CheckResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CheckResponseMultiError) Error ¶
func (m CheckResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CheckResponseValidationError ¶
type CheckResponseValidationError struct {
// contains filtered or unexported fields
}
CheckResponseValidationError is the validation error returned by CheckResponse.Validate if the designated constraints aren't met.
func (CheckResponseValidationError) Cause ¶
func (e CheckResponseValidationError) Cause() error
Cause function returns cause value.
func (CheckResponseValidationError) Error ¶
func (e CheckResponseValidationError) Error() string
Error satisfies the builtin error interface
func (CheckResponseValidationError) ErrorName ¶
func (e CheckResponseValidationError) ErrorName() string
ErrorName returns error name.
func (CheckResponseValidationError) Field ¶
func (e CheckResponseValidationError) Field() string
Field function returns field value.
func (CheckResponseValidationError) Key ¶
func (e CheckResponseValidationError) Key() bool
Key function returns key value.
func (CheckResponseValidationError) Reason ¶
func (e CheckResponseValidationError) Reason() string
Reason function returns reason value.
type Decision ¶
type Decision int32
func (Decision) Descriptor ¶
func (Decision) Descriptor() protoreflect.EnumDescriptor
func (Decision) EnumDescriptor
deprecated
func (Decision) Number ¶
func (x Decision) Number() protoreflect.EnumNumber
func (Decision) Type ¶
func (Decision) Type() protoreflect.EnumType
type Subject ¶
type Subject struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Groups []string `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` // contains filtered or unexported fields }
func (*Subject) Descriptor
deprecated
func (*Subject) ProtoMessage ¶
func (*Subject) ProtoMessage()
func (*Subject) ProtoReflect ¶
func (x *Subject) ProtoReflect() protoreflect.Message
func (*Subject) Validate ¶
Validate checks the field values on Subject with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Subject) ValidateAll ¶
ValidateAll checks the field values on Subject with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubjectMultiError, or nil if none found.
type SubjectMultiError ¶
type SubjectMultiError []error
SubjectMultiError is an error wrapping multiple validation errors returned by Subject.ValidateAll() if the designated constraints aren't met.
func (SubjectMultiError) AllErrors ¶
func (m SubjectMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SubjectMultiError) Error ¶
func (m SubjectMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SubjectValidationError ¶
type SubjectValidationError struct {
// contains filtered or unexported fields
}
SubjectValidationError is the validation error returned by Subject.Validate if the designated constraints aren't met.
func (SubjectValidationError) Cause ¶
func (e SubjectValidationError) Cause() error
Cause function returns cause value.
func (SubjectValidationError) Error ¶
func (e SubjectValidationError) Error() string
Error satisfies the builtin error interface
func (SubjectValidationError) ErrorName ¶
func (e SubjectValidationError) ErrorName() string
ErrorName returns error name.
func (SubjectValidationError) Field ¶
func (e SubjectValidationError) Field() string
Field function returns field value.
func (SubjectValidationError) Key ¶
func (e SubjectValidationError) Key() bool
Key function returns key value.
func (SubjectValidationError) Reason ¶
func (e SubjectValidationError) Reason() string
Reason function returns reason value.
type UnimplementedAuthzAPIServer ¶
type UnimplementedAuthzAPIServer struct { }
UnimplementedAuthzAPIServer should be embedded to have forward compatible implementations.
func (UnimplementedAuthzAPIServer) Check ¶
func (UnimplementedAuthzAPIServer) Check(context.Context, *CheckRequest) (*CheckResponse, error)
type UnsafeAuthzAPIServer ¶
type UnsafeAuthzAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAuthzAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthzAPIServer will result in compilation errors.