Home  >  Article  >  Backend Development  >  How to design openAPI program developed in php

How to design openAPI program developed in php

WBOY
WBOYOriginal
2016-07-11 10:21:241580browse
  1. I want to build an API management platform (The function is similar to Sina Weibo’s openAPI. The function is not as powerful as Weibo’s openAPI)

  2. Call the interface and you need authorization. After authorization, the user will get the username, token and other authorization information

  3. The user calls the interface parameters including: user name token or signature and other interface parameters

  4. You can set the expiration time of the token and the limit on the number of token calls

  5. Can record the number of calls made by each user Call record

My idea is:
Use mysql to store user name, signature, token, authorization date, user permissions and other information
Use redis string to store user call records
After receiving the request from the user Use the token to verify whether the call is legal. Use the user name to verify whether he has the authority to call this interface, whether the number of times has been exceeded, the frequency limit has been exceeded, and other information

SF friends, do you have any good ideas or similar open source programs to recommend? Thanks

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn