resourcePolicy

package
v1.1.68-test Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission string

Permission is a binding permission string (`Joi.string().trim()`). Self-validating via validate.go (was RegisterType(Permission, String().Trim())).

func (Permission) ValidationRule

func (Permission) ValidationRule() *validate.Rule

ValidationRule ports the Permission element rule `Joi.string().trim()`.

type Permissions

type Permissions []Permission

Permissions ports the bindings `permissions` array rule `Joi.array().items(Permission).sort().custom(makeUnique()).required()` — the array- level sort/makeUnique/required live on this nominal type's Validator (validate.go) so the exact Joi op ORDER is preserved; the element trim lives on Permission.

func (Permissions) ValidationRule

func (Permissions) ValidationRule() *validate.Rule

ValidationRule ports the bindings `permissions` array rule `Joi.array().items(Permission).sort().custom(makeUnique()).required()` with the same operation order (sort -> makeUnique -> required); the element trim comes from Permission and the array-level normalization lives here.

type PrincipalLinks []string

PrincipalLinks ports the bindings `principalLinks` array rule `Joi.array().min(1).max(50).items(Joi.string()).sort().custom(makeUnique())` — plain strings (unlike policy, NO LocalLink/toKind). Array-level rules live on this nominal type's Validator (validate.go) to preserve op order.

func (PrincipalLinks) ValidationRule

func (PrincipalLinks) ValidationRule() *validate.Rule

ValidationRule ports the bindings `principalLinks` array rule `Joi.array().min(1).max(50).items(Joi.string()).sort().custom(makeUnique())` with the same operation order (min -> max -> sort -> makeUnique). Plain strings — resource policy principal links are NOT LocalLink/toKind checked (resourcePolicy.ts).

type ResourcePolicy

type ResourcePolicy struct {
	Id           string     `json:"id,omitzero" validate:"uuid"`
	Kind         base.Kind  `json:"kind,omitzero"`
	Version      *float64   `json:"version,omitzero" validate:"positive"`
	Created      string     `json:"created,omitzero" validate:"date"`
	LastModified string     `json:"lastModified,omitzero" validate:"date"`
	Links        base.Links `json:"links,omitzero"`
	// makeUnique() with no `by` is _.uniq — a no-op on distinct object refs.
	Bindings []ResourcePolicyBindings `json:"bindings,omitzero" validate:"max=50"`
}

func (ResourcePolicy) ValidationRule

func (ResourcePolicy) ValidationRule() *validate.Rule

ValidationRule reflects ResourcePolicy — the schema the "resourcepolicy" kind validates against (resourcePolicy.ts:22). No root refine.

type ResourcePolicyBindings

type ResourcePolicyBindings struct {
	Permissions    Permissions    `json:"permissions"`
	PrincipalLinks PrincipalLinks `json:"principalLinks,omitzero"`
}

Jump to

Keyboard shortcuts

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