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.
OpenFGA\Repositories
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.
Name | Type | Description |
---|---|---|
$authorizationModelId |
string |
The authorization model ID containing assertions |
Failure
| Success
| SuccessInterface
— Success with assertions collection, or Failure with error details
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.
Name | Type | Description |
---|---|---|
$authorizationModelId |
string |
The authorization model ID to update |
$assertions |
AssertionsInterface |
The assertions to write |
Failure
| Success
| SuccessInterface
— Success if written, or Failure with error details