API Repositories HttpAssertionRepository - evansims/openfga-php GitHub Wiki

HTTP implementation of assertion repository for OpenFGA API communication. This repository handles assertion operations by communicating with the OpenFGA HTTP API. It transforms business operations into HTTP requests and responses, handling serialization, deserialization, and error management.

Table of Contents


Namespace

OpenFGA\Repositories


Source

View source code


Implements


Methods

read

public function read(
    string $authorizationModelId,
): OpenFGA\Results\Failure|OpenFGA\Results\Success|OpenFGA\Results\SuccessInterface

Read assertions from an authorization model. Retrieves all test assertions defined for the specified authorization model. Assertions validate that the model behaves correctly for specific scenarios.

View source


Parameters

Name Type Description
$authorizationModelId string The authorization model ID containing assertions

Returns

Failure | Success | SuccessInterface — Success with assertions collection, or Failure with error details


write

public function write(
    string $authorizationModelId,
    OpenFGA\Models\Collections\AssertionsInterface $assertions,
): OpenFGA\Results\Failure|OpenFGA\Results\Success|OpenFGA\Results\SuccessInterface

Write assertions to an authorization model. Updates the test assertions for the specified authorization model. This replaces any existing assertions with the provided collection.

View source


Parameters

Name Type Description
$authorizationModelId string The authorization model ID to update
$assertions AssertionsInterface The assertions to write

Returns

Failure | Success | SuccessInterface — Success if written, or Failure with error details

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