PHPackages                             sunkan/aws-auth-policy - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sunkan/aws-auth-policy

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sunkan/aws-auth-policy
======================

Library to help with generating auth policies for AWS Gateway API Authorizers

1.0.0(2y ago)09.7k↓44.6%MITPHPPHP ^8.2

Since Jul 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sunkan/aws-auth-policy)[ Packagist](https://packagist.org/packages/sunkan/aws-auth-policy)[ RSS](/packages/sunkan-aws-auth-policy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Aws Auth Policy
===============

[](#aws-auth-policy)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c3eb0440609eb98be3775873a07e02ab36940b998ba2265e7ce4dc12199ee1ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756e6b616e2f6177732d617574682d706f6c6963792e737667)](https://packagist.org/packages/sunkan/aws-auth-policy)[![Software License](https://camo.githubusercontent.com/d7276aba406df67997874c0a606d342ff8ede619060ed5e30d7961b23b514a49/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73756e6b616e2f6177732d617574682d706f6c6963792e737667)](LICENSE)[![Build Status](https://github.com/sunkan/aws-auth-policy/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sunkan/aws-auth-policy/actions/workflows/unit-test.yml)[![Coverage Status](https://camo.githubusercontent.com/a5f952f7ea4ab5215e829dde9329ed04aca6190706c440175b2184a32a95de56/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73756e6b616e2f6177732d617574682d706f6c6963792f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/sunkan/aws-auth-policy?branch=main)

Installation
------------

[](#installation)

```
$ composer require sunkan/aws-auth-policy

```

Usage
-----

[](#usage)

```
use Sunkan\AwsAuthPolicy\AuthPolicy;

$policy = new AuthPolicy(
    'me',
    '50505050',
    [
        'region' => 'eu-west-1',
        'stage' => 'prod',
    ],
);

$policy->allowAll();

echo json_encode($policy->build());
```

Usage with Bref
---------------

[](#usage-with-bref)

```
use Bref\Context\Context;
use Bref\Event\Handler;
use Sunkan\AwsAuthPolicy\AuthPolicy;

final class AuthorizerAction implements Handler
{
    public function handle($event, Context $context)
    {
        $policy = AuthPolicy::fromMethodArn($event['methodArn']);
        // validate $event['authorizationToken']
        if ($validToken) {
            $policy->allowAll();
        }
        else {
            $policy->denyAll();
        }

        return $policy;
    }
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~235 days

Total

5

Last Release

827d ago

Major Versions

0.4.0 → 1.0.02024-02-12

PHP version history (2 changes)0.1.0PHP ^8.0

1.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce9d40996574fd1f18f69556c872c6eb94e59977c5f0b33c9df541d82fbb3800?d=identicon)[sunkan](/maintainers/sunkan)

---

Top Contributors

[![sunkan](https://avatars.githubusercontent.com/u/568492?v=4)](https://github.com/sunkan "sunkan (17 commits)")

---

Tags

awsAuthPolicy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sunkan-aws-auth-policy/health.svg)

```
[![Health](https://phpackages.com/badges/sunkan-aws-auth-policy/health.svg)](https://phpackages.com/packages/sunkan-aws-auth-policy)
```

###  Alternatives

[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[pmill/aws-cognito

A PHP client for AWS Cognito user pools

74266.0k3](/packages/pmill-aws-cognito)[pallant/laravel-aws-cognito-auth

An authentication driver for Laravel for authenticating users in AWS Cognito User Pools

777.7k](/packages/pallant-laravel-aws-cognito-auth)[customergauge/cognito

AWS Cognito provider for Laravel Authentication

2247.8k](/packages/customergauge-cognito)[anthonymartin/aws_acl_fail2ban

This package includes a script and fail2ban configuration that allows you to use fail2ban when utilizing AWS elastic load balancer (ELB) and an apache webserver.

3414.2k](/packages/anthonymartin-aws-acl-fail2ban)

PHPackages © 2026

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