承接 da/api-server-bundle 相关项目开发

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

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

da/api-server-bundle

Composer 安装命令:

composer require da/api-server-bundle

包简介

DaApiServerBundle is a Symfony2's bundle allowing to provide a REST API in a simple and secure way

README 文档

README

DaApiServerBundle is a Symfony2's bundle allowing to provide a REST API in a simple and secure way.

Installation

Installation is a quick 2 steps process.

Step 1: Add in composer

Add the bundle in the composer.json file:

// composer.json

"require": {
    // ...
    "da/auth-common-bundle": "dev-master",
    "da/api-server-bundle": "dev-master"
},

And update your vendors:

composer update      # WIN
composer.phar update # LINUX

Step 2: Declare in the kernel

Declare the bundle in your kernel:

// app/AppKernel.php

$bundles = array(
    // ...
    new Da\AuthCommonBundle\DaAuthCommonBundle(),
    new Da\ApiServerBundle\DaApiServerBundle(),
);

Check the client API key

If you want to check the API token of a client of your API for a route pattern, you must specify it in your security.yml:

# app/config/security.yml
security:
    firewalls:
    	#...

        api:
            pattern:   ^/api
            da_api:    true
            stateless: true

The URLs under /api will authenticate a client of your API with the API token send with the request. For the time being, the API token must be send in the HTTP header "X-API-Security-Token".

Check a given oauth token

If you want to check an oauth token given in the Authorization header of the request (Bearer token), you can specify it like this:

# app/config/security.yml
security:
    firewalls:
        #...

        api_user:
            pattern:   ^/api/user
            da_oauth:  true
            stateless: true

Remote checking

If your API is not at the same place as your SSO server (with oauth, ...), just follow these step:

Add the bundle in the composer.json file:

// composer.json

"require": {
    // ...
    "da/api-client-bundle": "dev-master"
},

And update your vendors:

composer update      # WIN
composer.phar update # LINUX

Then, set the config:

# app/config/config.yml

# DaApiClient Configuration
da_api_client:
    api:
        sso_user:
            endpoint_root:  %api.sso.endpoint_root%
            security_token: %api.sso.security_token%
            client:
                service: da_api_server.user_manager.http
        sso_client:
            endpoint_root:  %api.sso.endpoint_root%
            security_token: %api.sso.security_token%
            client:
                service: da_api_server.client_manager.http

# DaApiServer Configuration
da_api_server:
    user_manager: da_api_client.api.sso_user
    client_manager: da_api_client.api.sso_client

Finally, set the corresponding parameters:

# app/config/parameters.yml and app/config/parameters.yml.dist

parameters:
    # ...
    api.sso.endpoint_root: 'http://my-domain.com/api'
    api.sso.security_token: 3jgwm1izbse884cwskk00c0o4ww8kg08gsgc4o808gsssw4

Documentation

This bundle have some other features that can help you to develop a REST API documented here.

What about the API client side?

Take a look at the DaApiClientBundle!

da/api-server-bundle 适用场景与选型建议

da/api-server-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 84.3k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2013 年 07 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「api」 「bundle」 「server」 「da」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 da/api-server-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 da/api-server-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 da/api-server-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 84.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-07-30