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
OpenFGA\Models
AssertionTupleKeyInterfaceJsonSerializableModelInterface
- AssertionTupleKeyInterface (interface)
| Name | Value | Description |
|---|---|---|
OPENAPI_MODEL |
AssertionTupleKey |
public function getObject(): stringGet 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.
string — The object identifier being tested
public function getRelation(): stringGet 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.
string — The relation name being tested
public function getUser(): stringGet 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.
string — The user identifier being tested
public function jsonSerialize(): arrayarray
Implements Models\AssertionTupleKeyInterface
public function schema(): SchemaInterfaceGet 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.
SchemaInterface — The schema definition containing validation rules and property specifications for this model