pculka/aws4-auth-bundle

允许通过 HTTP 请求检查 AWS4 签名

dev-master 2016-04-21 11:00 UTC

This package is auto-updated.

Last update: 2024-09-11 20:54:23 UTC


README

Build Status

安装

安装是一个快速的五步过程

  1. 下载 AWS4AuthBundle
  2. 在 Kernel 中启用 Bundle
  3. 扩展你的模型类
  4. 配置你的应用的 security.yml
  5. 配置 AWS4AuthBundle

步骤 1: 安装 AWS4AuthBundle

安装此 Bundle 的首选方式是通过 Composer。请在 Packagist 上检查你想要安装的版本,并将其添加到你的 composer.json

{
    "require": {
        // ...
        "pculka/aws4-auth-bundle": "dev-master"
    }
}

步骤 2: 在 Kernel 中启用 Bundle

要在 Kernel 中启用 Bundle,只需将其添加到你的 registerBundles() 函数中

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new PC\Aws4AuthBundle\PCAws4AuthBundle(),
    );
}

步骤 3: 扩展你的模型类

步骤 4: 配置你的应用的 security.yml

此 Bundle 提供了一个安全层。该层作为一个唯一的认证提供者,不能进行链式操作!

创建可链式接口的工作仍在进行中,并计划在未来的版本中实现。

security:
    firewalls:
        aws4fw:
            pattern: ^/amazon-like-api/
            stateless: true
            aws4auth: true

步骤 5: 配置 AWS4AuthBundle

# app/config/config.yml

pc_aws4_auth:
    user_class: \Acme\Bundle\Entity\User