API Models AssertionTupleKey - evansims/openfga-php GitHub Wiki

Represents a tuple key used for testing authorization model assertions. An AssertionTupleKey defines the specific user, relation, and object combination that should be tested in authorization model assertions. This is used to verify that your authorization model behaves correctly by testing whether specific authorization questions return the expected results. Use this when creating test cases to validate your authorization rules and ensure your permission model works as intended.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Constants

Name Value Description
OPENAPI_MODEL AssertionTupleKey


Methods

getObject

public function getObject(): string

Get the object being tested in the assertion. This represents the resource or entity that the assertion is testing access to. In assertion testing, this is the object part of the tuple being validated against the authorization model.

View source


Returns

string — The object identifier being tested


getRelation

public function getRelation(): string

Get the relation being tested in the assertion. This represents the type of relationship or permission being tested in the assertion. It defines what kind of access is being validated between the user and object.

View source


Returns

string — The relation name being tested


getUser

public function getUser(): string

Get the user being tested in the assertion. This represents the subject (user, group, role, etc.) whose access is being tested in the assertion. It's the entity for which we're validating whether they have the specified relation to the object.

View source


Returns

string — The user identifier being tested


jsonSerialize

public function jsonSerialize(): array

View source


Returns

array


schema

Implements Models\AssertionTupleKeyInterface

public function schema(): SchemaInterface

Get the schema definition for this model. This method returns the schema that defines the structure, validation rules, and serialization behavior for this model class. The schema is used for data validation, transformation, and ensuring consistency across API operations with the OpenFGA service. Each model's schema defines: - Required and optional properties - Data types and format constraints - Nested object relationships - Validation rules and business logic constraints The schema system enables the SDK to automatically validate incoming data, transform between different representations, and ensure compliance with the OpenFGA API specification.

View source


Returns

SchemaInterface — The schema definition containing validation rules and property specifications for this model

⚠️ **GitHub.com Fallback** ⚠️