承接 native-network/social_json_api 相关项目开发

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

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

native-network/social_json_api

Composer 安装命令:

composer require native-network/social_json_api

包简介

This module enables a JSON API for your Open Social site.

README 文档

README

Social JSON API provides an API which can be used with the following entities:

  • comment
  • event_enrollment
  • file
  • group
  • group_content
  • node
  • post
  • profile
  • taxonomy_term
  • user

It works out of the box for these entities. However you'll need to do some configuration to access the API (authentication and authorization).

Installation

  1. Enable this module and all its dependencies.
  2. The module will automatically create a folder outside your docroot (web/html) directory where you can store the public and private key combination. By default this is: private://oauth_api_keys/.
  3. If your site has a sitemanager role it will automatically assign a bunch of permissions to this role.
  4. Check if all the right entities are enabled in social_json_api_entity_type_alter().

Configuration

The API System which is implemented has multiple authentication grants available. These are all allowed in Open Social by default.

To determine which grant is applicable for your use-case please read the oauth2 documentation For demo purposes we assume you'll want the password grant, which means that you'll login with account details of a given user.

  1. Go to /admin/config/people/simple_oauth and configure the OAuth settings to your needs. Double check the expiration times and if the keys exist. During development you can set the access token expiration time on a higher value. Usually this should be below 300 seconds.
  2. Create a consumer on /admin/config/services/consumer/add
  3. Fill in at least:
    • Label: The label for your consumer (e.g. My CRM system)
    • User: leave this empty
    • New secret: Generate a secure string here (e.g. using Lastpass, but do remember this, you'll need this later)
    • Is confidential: yes
    • Is this consumer 3rd party?: yes
    • Redirect URL: leave empty
    • Scopes: select the roles you want to use here, e.g. Sitemanager (this determines the permissions for the API)
  4. After saving the consumer you'll go to the consumer overview where you can see the consumer uuid.

Authentication

Now you can get access to the API by doing a POST Request on /oauth/token with the following body:

grant_type:password
client_id:uuid
client_secret:secret
username:test
password:test

Just fill in the client_id, client_secret, username and password accordingly. You will receive an access_token and refresh_token which you can use in subsequent requests, e.g. in refresh_token requests or you can use the same access_token during the expire time.

More info here: http://oauth2.thephpleague.com/authorization-server/resource-owner-password-credentials-grant/

Documentation

Some more information is available on your site on: /admin/config/opensocial/social-json-api

You will also find a link to the documentation for your API there. The documentation is automatically generated and displayed with ReDoc.

native-network/social_json_api 适用场景与选型建议

native-network/social_json_api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 native-network/social_json_api 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2019-06-14