承接 evansims/openfga-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

evansims/openfga-php

最新稳定版本:v1.6.0

Composer 安装命令:

composer require evansims/openfga-php

包简介

Stop writing authorization logic. Start asking questions. OpenFGA high performance relationship-based access control for PHP.

README 文档

README

OpenFGA PHP SDK

codecov Psalm Type Coverage

Stop writing authorization logic. Start asking questions.

composer require evansims/openfga-php


Every app needs permissions. Most developers end up with authorization logic scattered across controllers, middleware, and business logic. Changes break things. New features require touching dozens of files.

OpenFGA solves this. Define your authorization rules once, query them anywhere. This SDK provides a modern PHP interface to OpenFGA and Auth0 FGA.


Installation

composer require evansims/openfga-php


Quickstart

use OpenFGA\Client;
use function OpenFGA\{allowed, tuple};

$client = new Client(url: 'http://localhost:8080');

// Instead of scattered if statements in your controllers:
if ($user->isAdmin() || $user->owns($document) || $user->team->canEdit($document)) {
    // ...
}

// Ask OpenFGA:
$canEdit = allowed(
    client: $client,
    store: 'my-store',
    model: 'my-model',
    tuple: tuple('user:alice', 'editor', 'document:readme')
);

// Zero business logic coupling. Pure authorization.

See the documentation to get started.


Contributing

Contributions are welcome—have a look at our contributing guidelines.

统计信息

  • 总下载量: 14.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-12-05