PHPackages                             ryo88c/bear.authority - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. ryo88c/bear.authority

ActiveLibrary[Framework](/categories/framework)

ryo88c/bear.authority
=====================

An authority for BEAR.Sunday

v1.0.14(5y ago)620.6k2[1 issues](https://github.com/ryo88c/BEAR.Authority/issues)MITPHPPHP &gt;=7.1.0CI failing

Since Jan 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ryo88c/BEAR.Authority)[ Packagist](https://packagist.org/packages/ryo88c/bear.authority)[ RSS](/packages/ryo88c-bearauthority/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (10)Versions (16)Used By (0)

BEAR.Authority
==============

[](#bearauthority)

BEAR.Sunday 用認証ライブラリです。

使い方
---

[](#使い方)

認証をかけたいリソースオブジェクトのメソッドに `Ryo88c\Authority\Auth` アノテーションを指定します。 `@Auth(allow="admin")` と指定すれば `role` に `admin` が設定されてるオーディエンスのアクセスが認可されます。

カスタマイズ
------

[](#カスタマイズ)

認証方法を変えたい場合は `Authorization` を参考に `AuthorizationInterface` を実装してください。 `Authorization` クラスでは OAuth 2.0 Bearer と JSON Web Token を組み合わせて使っています。

認証方法を変えたい場合は `Authentication` を参考に `AuthenticationInterface` を実装してください。 `Authentication` クラスでは [JWT の RFC（RFC7519）](https://tools.ietf.org/html/rfc7519#section-4.1) に定義されてる `AudienceInterface` を承認の対象としてます。 役割の評価以外の承認方法を実装したい場合や、オーディエンスのデータ定義を変えたい場合は `AuthenticationInterface` や `AudienceInterface` を実装してください。

尚、`Audience` や `Payload` はバリューオブジェクトの性質をもたせるため、意図的に依存性を注入せず `new` しています。

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 56.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~156 days

Total

15

Last Release

2022d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7781d5f67f862fcb820109feedb72517e21c8776d80b15872ec10801379fa50a?d=identicon)[ryo88c](/maintainers/ryo88c)

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (29 commits)")[![ryo88c](https://avatars.githubusercontent.com/u/77841?v=4)](https://github.com/ryo88c "ryo88c (22 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ryo88c-bearauthority/health.svg)

```
[![Health](https://phpackages.com/badges/ryo88c-bearauthority/health.svg)](https://phpackages.com/packages/ryo88c-bearauthority)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[bear/package

BEAR.Sunday application framework package

30527.9k23](/packages/bear-package)[bear/skeleton

Skeleton application for BEAR.Sunday

1315.6k1](/packages/bear-skeleton)[vesp/core

Vesp core library to make backend simple

243.8k5](/packages/vesp-core)[forumify/forumify-platform

121.8k11](/packages/forumify-forumify-platform)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
