authzv1

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_security_authz_v1_authz_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {

	// Unique name for this authorization configuration instance.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// The type of authorization mechanism.
	// This string MUST match one of the keys of the configuration fields below
	// (e.g., "casbin") or a registered custom authorization mechanism.
	// It acts as a discriminator.
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// Configuration for a Casbin authorizer.
	// Must be present if 'type' is "casbin".
	Casbin *v1.Config `protobuf:"bytes,10,opt,name=casbin,proto3,oneof" json:"casbin,omitempty"`
	// For custom types, the 'type' field will contain the custom name,
	// and this 'customize' field will hold its configuration.
	Customize *structpb.Struct `protobuf:"bytes,100,opt,name=customize,proto3,oneof" json:"customize,omitempty"`
	// contains filtered or unexported fields
}

Authorizer defines the configuration for a single authorization mechanism.

func (*Authorizer) Descriptor deprecated

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

Deprecated: Use Authorizer.ProtoReflect.Descriptor instead.

func (*Authorizer) GetCasbin

func (x *Authorizer) GetCasbin() *v1.Config

func (*Authorizer) GetCustomize

func (x *Authorizer) GetCustomize() *structpb.Struct

func (*Authorizer) GetName

func (x *Authorizer) GetName() string

func (*Authorizer) GetType

func (x *Authorizer) GetType() string

func (*Authorizer) ProtoMessage

func (*Authorizer) ProtoMessage()

func (*Authorizer) ProtoReflect

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

func (*Authorizer) Reset

func (x *Authorizer) Reset()

func (*Authorizer) String

func (x *Authorizer) String() string

func (*Authorizer) Validate

func (m *Authorizer) Validate() error

Validate checks the field values on Authorizer 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 (*Authorizer) ValidateAll

func (m *Authorizer) ValidateAll() error

ValidateAll checks the field values on Authorizer 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 AuthorizerMultiError, or nil if none found.

type AuthorizerMultiError

type AuthorizerMultiError []error

AuthorizerMultiError is an error wrapping multiple validation errors returned by Authorizer.ValidateAll() if the designated constraints aren't met.

func (AuthorizerMultiError) AllErrors

func (m AuthorizerMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthorizerMultiError) Error

func (m AuthorizerMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AuthorizerValidationError

type AuthorizerValidationError struct {
	// contains filtered or unexported fields
}

AuthorizerValidationError is the validation error returned by Authorizer.Validate if the designated constraints aren't met.

func (AuthorizerValidationError) Cause

func (e AuthorizerValidationError) Cause() error

Cause function returns cause value.

func (AuthorizerValidationError) Error

Error satisfies the builtin error interface

func (AuthorizerValidationError) ErrorName

func (e AuthorizerValidationError) ErrorName() string

ErrorName returns error name.

func (AuthorizerValidationError) Field

Field function returns field value.

func (AuthorizerValidationError) Key

Key function returns key value.

func (AuthorizerValidationError) Reason

func (e AuthorizerValidationError) Reason() string

Reason function returns reason value.

type RuleSpec

type RuleSpec struct {

	// The domain or tenant for this rule check. Can be empty for non-multi-tenant models.
	// e.g., "project-a", "tenant-blue-ocean"
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	// The resource being accessed.
	// e.g., "/api/v1/documents/123", "urn:document:456"
	Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
	// The action being performed on the resource.
	// e.g., "read", "write", "edit", "POST"
	Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"`
	// Attributes contains additional, dynamic properties related to this rule check,
	// enabling Attribute-Based Access Control (ABAC).
	// This can include properties of the resource (e.g., {"owner": "user-xyz", "status": "draft"})
	// or the context (e.g., {"ip_address": "192.168.1.100"}).
	Attributes *structpb.Struct `protobuf:"bytes,4,opt,name=attributes,proto3" json:"attributes,omitempty"`
	// contains filtered or unexported fields
}

RuleSpec is the data transfer object for an authorization rule specification. It encapsulates the core components of a rule to be checked against the policy engine.

func (*RuleSpec) Descriptor deprecated

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

Deprecated: Use RuleSpec.ProtoReflect.Descriptor instead.

func (*RuleSpec) GetAction

func (x *RuleSpec) GetAction() string

func (*RuleSpec) GetAttributes

func (x *RuleSpec) GetAttributes() *structpb.Struct

func (*RuleSpec) GetDomain

func (x *RuleSpec) GetDomain() string

func (*RuleSpec) GetResource

func (x *RuleSpec) GetResource() string

func (*RuleSpec) ProtoMessage

func (*RuleSpec) ProtoMessage()

func (*RuleSpec) ProtoReflect

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

func (*RuleSpec) Reset

func (x *RuleSpec) Reset()

func (*RuleSpec) String

func (x *RuleSpec) String() string

func (*RuleSpec) Validate

func (m *RuleSpec) Validate() error

Validate checks the field values on RuleSpec 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 (*RuleSpec) ValidateAll

func (m *RuleSpec) ValidateAll() error

ValidateAll checks the field values on RuleSpec 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 RuleSpecMultiError, or nil if none found.

type RuleSpecMultiError

type RuleSpecMultiError []error

RuleSpecMultiError is an error wrapping multiple validation errors returned by RuleSpec.ValidateAll() if the designated constraints aren't met.

func (RuleSpecMultiError) AllErrors

func (m RuleSpecMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (RuleSpecMultiError) Error

func (m RuleSpecMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type RuleSpecValidationError

type RuleSpecValidationError struct {
	// contains filtered or unexported fields
}

RuleSpecValidationError is the validation error returned by RuleSpec.Validate if the designated constraints aren't met.

func (RuleSpecValidationError) Cause

func (e RuleSpecValidationError) Cause() error

Cause function returns cause value.

func (RuleSpecValidationError) Error

func (e RuleSpecValidationError) Error() string

Error satisfies the builtin error interface

func (RuleSpecValidationError) ErrorName

func (e RuleSpecValidationError) ErrorName() string

ErrorName returns error name.

func (RuleSpecValidationError) Field

func (e RuleSpecValidationError) Field() string

Field function returns field value.

func (RuleSpecValidationError) Key

func (e RuleSpecValidationError) Key() bool

Key function returns key value.

func (RuleSpecValidationError) Reason

func (e RuleSpecValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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