wassafr/simple-apikey-authenticator-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

wassafr/simple-apikey-authenticator-bundle

Composer 安装命令:

composer require wassafr/simple-apikey-authenticator-bundle

包简介

Wassa Simple API Key Authenticator Bundle

README 文档

README

The WassaSimpleApiKeyAuthenticatorBundle bundle allows you to add a very simple and light way to authenticate HTTP requests with an API key. It doesn't rely on existing Symfony authentication mechanisms as they require to define some kind of user class to work.

Installation

Require the wassafr/simple-apikey-authenticator-bundle package in your composer.json and update your dependencies.

$ composer require wassafr/simple-apikey-authenticator-bundle

Register the bundle in app/AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Wassa\SimpleApiKeyAuthenticatorBundle\WassaSimpleApiKeyAuthenticatorBundle(),
    );
}

To enable the configuration, edit the config.yml file as follow:

# app/config/config.yml
wassa_simple_api_key_authenticator:
    api_key: <YOUR_API_KEY>
    default_action: check | dont_check
    order: secured,unsecured | unsecured,secured
    secured_patterns:
        - ^\/api\/(?!doc)
    unsecured_patterns:
        - ^\/api\/(?!doc)
        - ^\/admin
        - ^\/bundles
        - ^\/toto

Configuration

  • api_key: pretty straightforward
  • default_action: should the bundle allow or deny access if not API key is configured, if the requested URL doesn't match any configured pattern or when no API key is provided
  • order: the order the request URL will be evaluated against the configured patterns. Pay attention to this as it could lead to unwanted acess or the opposite
  • secured_patterns: URL patterns that will required a valid API key
  • unsecured_patterns: URL patterns that will NOT required a valid API key

Most of the time you won't need to configure both secured_patterns and unsecured_patterns, but who knows.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2016-02-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固