Documentation
¶
Index ¶
Constants ¶
View Source
const ( // OryKetoImage is the Ory Keto Image. OryKetoImage = "oryd/keto:latest" KetoConfiguration = `` /* 194-byte string literal not displayed */ // NamespacesOPL defines all OPL namespaces used by the authorizer tests. // All namespaces and relations that tests reference must be declared here // so that Keto's namespace validation accepts the relation tuples. // // The namespaces model a three-plane authorization structure: // Plane 1 — Data Access: tenancy_access // Plane 2 — Functional Perms: service_tenancy, service_profile // Plane 3 — Resource Access: chat_room, file NamespacesOPL = `` /* 6013-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New() definition.TestResource
func NewWithNamespaces ¶ added in v1.76.2
func NewWithNamespaces( configuration string, namespaceFiles []NamespaceFile, containerOpts ...definition.ContainerOption, ) definition.TestResource
NewWithNamespaces creates a new Keto test resource with OPL namespace files. The configuration string should reference the namespace files via "namespaces: location: file:///path/to/file.ts". When no database dependency is provided, Keto uses in-memory storage with auto-migration, which is required for OPL permit evaluation.
func NewWithOpts ¶ added in v1.54.0
func NewWithOpts( configuration string, containerOpts ...definition.ContainerOption, ) definition.TestResource
NewWithOpts creates a new Keto test resource. The configuration string is the Keto YAML config.
Types ¶
type NamespaceFile ¶ added in v1.76.2
type NamespaceFile struct {
// ContainerPath is the absolute path inside the container (e.g. "/home/ory/namespaces/tenancy.ts").
ContainerPath string
// Content is the OPL TypeScript content.
Content string
}
NamespaceFile represents an OPL namespace file to copy into the Keto container.
func DefaultNamespaceFiles ¶ added in v1.76.5
func DefaultNamespaceFiles() []NamespaceFile
DefaultNamespaceFiles returns the OPL namespace files for test Keto setup.
Click to show internal directories.
Click to hide internal directories.