承接 ekreative/redmine_login 相关项目开发

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

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

ekreative/redmine_login

Composer 安装命令:

composer require ekreative/redmine_login

包简介

Login to symfony using redmine as user provider

README 文档

README

Latest Stable Version License Build Status SensioLabsInsight Coverage Status

Install

composer require ekreative/redmine_login

Kernel

new Ekreative\RedmineLoginBundle\EkreativeRedmineLoginBundle()

Parameters

parameters:
    redmine: 'http://www.redmine.org'

Config

ekreative_redmine_login:
    redmine: %redmine%

Routing

ekreative_redmine_login:
    resource: "@EkreativeRedmineLoginBundle/Resources/config/routing.yml"

Security

security:

    providers:
        webservice:
            id: ekreative_redmine_login.provider

    firewalls:
        unsec:
            pattern: ^/login$
            security: false

        secured_area:
            pattern: ^/
            anonymous:
            simple_form:
                authenticator: ekreative_redmine_login.authenticator
                check_path:    login_check
                login_path:    login
                username_parameter: login[username]
                password_parameter: login[password]
            simple_preauth:
                authenticator: ekreative_redmine_login.api_authenticator
            logout:
                path: /logout

    access_control:
        - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: ROLE_REDMINE }

Security

You can secure your own routes using two roles

  • ROLE_REDMINE
  • ROLE_REDMINE_ADMIN

Make Request

$projects = json_decode($this->get('ekreative_redmine_login.client_provider')->get($this->getUser())->get('projects.json')->getBody(), true)['projects']

Login as api user

POST /login HTTP/1.1
Content-Type: application/json

{
    "login": {
        "username": "username",
        "password": "password"
    }
}

Response

200 OK

{
  "user": {
    "id": 1,
    "username": "username",
    "firstName": "Name",
    "lastName": "Last",
    "email": "user@domin.com",
    "createdAt": "2000-01-01T00:00:00+00:00",
    "lastLoginAt": "2000-01-01T00:00:00+00:00",
    "apiKey": "your_api_key",
    "status": 1
  }
}

Logged in:

GET /admin HTTP/1.1
Host: 127.0.0.1:8000
X-API-Key: your_api_key

Custom user class

If you want to use a custom user class then its very easy! There are two ways

  • Either override the parameter ekreative_redmine_login.user.class with the name of your own class that extends RedmineUser.

  • Or override the service ekreative_redmine_login.user_factory with a service that implements RedmineUserFactoryInterface. You will want to do this if you are using Doctrine.

RedmineUser contains all the annotations for use with Doctrine, so its super simple to store users in the database.

Api Doc

If you want the api doc to be listed then use NelmioApiDocBundle

Kernel

new Nelmio\ApiDocBundle\NelmioApiDocBundle()

Routing

NelmioApiDocBundle:
    resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
    prefix:   /api/doc

Security

Replace the standard unsec

unsec:
    pattern: ^/(login$|api/doc)
    security: false

ekreative/redmine_login 适用场景与选型建议

ekreative/redmine_login 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 692 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 06 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 ekreative/redmine_login 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-27