[자유게시판] Our API Server

2024.03.27 00:10

졸리운_곰 조회 수:126

[자유게시판] Our API Server 

 

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

 

Our API Server


Summary

Our API Server is a tool for create a REST service interface for our projects. The main objective of the project is the creation of a Standard Tool with supports for many existing projects, including Wordpress, Drupal or annother project. Also does not limit to Mysql data source, it can be widely extended with the use of plugins.
 
Features:
 
  • Creating APIs faster than any other system.
  • Modify URL request structure.
  • Make requests in any possible format (GET,POST,PUT,DELETE).
  • Making and versioning APIs.
  • Great graphical stats.
  • Logs for each API requests.
  • Utilization of plugins to extend server functionalities:
    • Four TYPES of plugins (SOURCE, SECURITY, ENCRYPTION, OUTPUT).
    • Five OUTPUTS plugins (XML, JSON , YAML, SERIALIZE, SIMPLE) or create your OWN.
    • Five ACTION plugins (MYSQL, ODBC, SQLITE, PRINTER, EXECUTE) or create your OWN.
    • Two security plugins (MYSQL, MANUAL) or create your OWN.
    • Five encryption plugins (MD5, WORDPRESS, PLAIN, DRUPAL, SHA1) or create your OWN.
  • Full Cache Support.
  • Exhaustive documentation (samples, howtos and tutorials included);

Table of contents

Setup

Requirements

  • Apache2
    • mod_rewrite
  • PHP 5.3.x
    • php_sqlite

Installation

Just copy the project to the folder 'www' of Apache2.
 

Configuration

The config of the projects is located on config.ini.
 
  • ROOT : URLwhere the project RUN.
  • USER : admin user of the Project.
  • PASS : pass for the USER.
     
    leave in blank both (USER and PASS) for public access.

User Interface

The user interface is basically an API editor where you can perform the following actions:
 

Add

Add new APIs.
 

Edit

Edit a previously added API.
 

Delete

Delete created APIs.
 

Clone

Make an exact copy of any API.
 

Export

Exports any API.
 

Stats

Logs and graphical stats for the API's requests.
 

Import

Imports a APIs that have been previously exported.
 

How it works

  1. Mapped all API
  2. Upon receiving a request, if it matches the url mapped to the path, the class runs.
  3. It checks whether the mapping coincides with the method defined in the API.
  4. Security Checks.
  5. Executes the Action.
  6. Execute the Output.

Making an API

To create an API must provide certain information to the system, as the name, the description, the route… In short you need to implement a REST service in our web interface.
 

API Basic

In this section we define the basic parameters of the API, which described below:
 

Name

Friendly name of the api that is creating
 

Description

Description of the API does (be explicit).
 

Path

Path to access its api. This path is relative to the main path. Important:The path must start with "/"
 
Path Example:
[SERVER_ROOT]/[API_PATH]
 
The following path are used by the server to manage the GUI and testing.
 
* [SERVER_ROOT]/
 
 
* [SERVER_ROOT]/simple/*
 
Important: Do not use any of the routes listed above.
 

Cache

Time in seconds that the system cache the result of the API Incomings Request. Can be used to limit the amount of new requests in a time.
 
Example Cache:
If you need that users can only make 60 requests in one hour then you must put the cache in 60 …
 

Method

Method to be used in the request. The system supports all methods although you can specify whether to connect via GET, POST, PUT, DELETE.
 

Ouput

Output to be used to print the data. By default the server comes with four output plugins JSON, XML, YAML y SERIALIZE.
 

Arguments

List of dynamic parameters that must be provided by the user order to obtain an output.
 
Example Login:
If you add the parameter user_loginas an argument, the route to be provide the user to access the service would be as follows:
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]
 
where USER_SUPPLIED_VALUEis the value that the user must supply to get data.
 

API Source

In this section we define the source from which the data were taken. The type of data source is pluggeable and by default the server has 4 types of sources:
 

MySQL

To access data from a server must meet the parameters Mysql Connection:
 
  1. host:Server path
  2. port:Server port (usually 3306 for mysql server)
  3. dbname:The database to which the connection will be established.
  4. user, pass:The credentials to connect to server.

Sqlite

The configuration to connect to a sqlite database is simpler, only requires a parameter:
 
  1. dbname:Address of the database to which the connection will be established.

ODBC

To connect to an ODBC resource you need to set the following parameters:
 
  1. dsn:ODBC Resource.
  2. user, pass:The credentials to use the resource, if necessary.

Printer

The printer does not need additional configuration. Just print the text in the Action option.
 

Execute

Operative System Sentence for Execute.
 

API Action

The action is executed on the server to provide an output in the selected format.
 
For Example if you want to run a simple mysql action:
 
SELECT * FROM `wp_terms` LIMIT 30
 
In case the action need of additional parameters :
 
SELECT user_login,user_nicename,user_email,user_registered
 
 
FROM `wp_users` WHERE user_login = :user_login LIMIT 30
 
In this case user_loginshould have been defined as an argument in the section API basicand shall be provided by the user in the request to the server, to be used in the execution of the action.
 
The action Printerprinted in the output the data used in the field action in the selected format.
 
For Example if in the action field is written Test printerthe result to the output in JSON format would:
 
[ "Test printer" ]
 
Both ODBC as sqlite actions are similar to the mysql action.
 

API Security

You can also add security to your REST Service. By default, the server includes three plugins for applying security:
 

Manual

The data source for credentials manually defined, to provide a simple authentication.
 
Example Route:
If in the field useris written user1and passwrite 1234all users in the request MUST provide values user1and 1234and would be as follows in the API (this example for GET Method):
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]&__user=user1&__pass=1234
 

Mysql

The data source for credentials, is a Mysql database. Of course you have to configure the connection parameters and define actions to execute, to obtain credentials (_user y _pass)
 
Example User and Password:
If you would like to select user_login from table wp_userswould be as follows: `SELECT user_login FROM wp_users WHERE user_login = :user_login `
 
If you would like to select user_pass from table wp_userswould be as follows: `SELECT user_pass FROM wp_users WHERE user_login = :user_login `
 
which would remain in the path of API:
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]&__user=[USER_VALUE]
 
 
&__pass=[PASS_VALUE]
 
In this case the user must provide wordpress credentials in the values USER_VALUEand PASS_VALUE, while the security plugin is responsible for comparing the valuesobtained with the execution of the security action, with the valuesprovided by the user and being equal continue the execution of the action that retrieves the print data, see API actionfor more information.
 

None

Without security.
 

Encryptation

The type of encryption complements and extends the security capabilities, the server includes 3 types of encryption MD5, WORDPRESS, PLAIN, DRUPAL, SHA1 and is used to compare the data extracted from the database with user-supplied.
 

Example

To conclude this tutorial we leave this example which is included by default in the server:
 

Basic

  • [Name] : wp_user
  • [Description] : Get User Data from WordPress in JSON Format with WordPress Authentication
  • [Path] : /wp/user
  • [Cache] : 0;
  • [Method] : GET
  • [Output] : JSON
  • [Arguments] : user_login

Source

  • [Type] : MYSQL
    • host : [localhost]
    • port : [3306]
    • dbname : wordpress_db
    • user : [wordpress_db_admin]
    • pass : [wordpress_db_pass]
  • [Action] :

Security

  • [Type] : MYSQL
    • host : [localhost]
    • port : [3306]
    • dbname : wordpress_db
    • user : [wordpress_db_admin]
    • pass : [wordpress_db_pass]
  • [User] :
  • [Password] :
  • [Encryptation] : WORDPRESS
as a result the API request would be as follows:
 
[SERVER_ROOT]/wp/user&user_login=[VALUE_USER_LOGIN]&__user=[USER_VALUE]
 
 
&__pass=[PASS_VALUE]
 

ChangeLog

Version 1.2
 
  • Add methods PUT and DELETE.
  • Add Logs for each API 's Request.
  • Add Graphical Stats.
Version 1.1
 
  • Help for Actions Sentence.
  • Refactorizing Store Method.
Version 1.0
 
  • Initial release.

Sources and Credits

We user the following files or proyects from 3rdparty:
 
  • Restler
  • Symfony
  • Boostrap-3.0.0
  • Jquery
  • Wordpress
  • Rickshaw
  • Fat-Free Framework

Our API Server v1.2

 
 

우리의 API 서버


요약

우리의 API 서버는 프로젝트를 위한 REST 서비스 인터페이스를 생성하기 위한 도구입니다. 프로젝트의 주요 목표는 Wordpress, Drupal 또는 다른 프로젝트를 포함한 많은 기존 프로젝트를 지원하는 표준 도구를 만드는 것입니다. 또한 MySQL 데이터 소스에 국한되지 않으며 플러그인을 사용하여 광범위하게 확장할 수 있습니다.
 
특징:
 
  • 다른 어떤 시스템보다 빠르게 API를 생성합니다.
  • URL 요청 구조를 수정합니다.
  • 가능한 모든 형식(GET, POST, PUT, DELETE)으로 요청하세요.
  • API를 만들고 버전을 관리합니다.
  • 훌륭한 그래픽 통계.
  • 각 API 요청에 대한 로그입니다.
  • 서버 기능 확장을 위한 플러그인 활용:
    • 4가지 유형의 플러그인(소스, 보안, 암호화, 출력).
    • 5개의 OUTPUTS 플러그인(XML, JSON, YAML, SERIALIZE, SIMPLE)을 사용하거나 직접 생성하세요.
    • 5개의 ACTION 플러그인(MYSQL, ODBC, SQLITE, PRINTER, EXECUTE)을 사용하거나 자신만의 고유한 플러그인을 생성하세요.
    • 두 개의 보안 플러그인(MYSQL, MANUAL)을 사용하거나 자신만의 고유한 플러그인을 만드세요.
    • 5개의 암호화 플러그인(MD5, WORDPRESS, PLAIN, DRUPAL, SHA1)을 사용하거나 나만의 고유한 플러그인을 만드세요.
  • 전체 캐시 지원.
  • 철저한 문서(샘플, 방법 및 튜토리얼 포함)

목차

설정

요구사항

  • 아파치2
    • mod_rewrite
  • PHP 5.3.x
    • php_sqlite

설치

프로젝트를 Apache2의 'www' 폴더에 복사하면 됩니다.
 

구성

프로젝트 구성은 에 있습니다 config.ini.
 
  • ROOT : 프로젝트가 실행되는 URL입니다 .
  • USER : 프로젝트의 관리자입니다.
  • PASS: USER에게 전달됩니다 .
     
    공개 액세스를 위해 둘 다(USER 및 PASS)를 공백으로 둡니다.

사용자 인터페이스

사용자 인터페이스는 기본적으로 다음 작업을 수행할 수 있는 API 편집기입니다.
 

추가하다

새로운 API를 추가하세요.
 

편집하다

이전에 추가된 API를 편집합니다.
 

삭제

생성된 API를 삭제합니다.
 

클론

모든 API의 정확한 사본을 만드세요.
 

내보내다

모든 API를 내보냅니다.
 

통계

API 요청에 대한 로그 및 그래픽 통계입니다.
 

수입

이전에 내보낸 API를 가져옵니다.
 

작동 원리

  1. 모든 API를 매핑했습니다.
  2. 요청을 받으면 경로에 매핑된 URL과 일치하면 클래스가 실행됩니다.
  3. 매핑이 API에 정의된 메소드와 일치하는지 확인합니다.
  4. 보안 점검.
  5. 작업을 실행합니다.
  6. 출력을 실행합니다.

API 만들기

API를 생성하려면 이름, 설명, 경로 등 특정 정보를 시스템에 제공해야 합니다. 즉, 웹 인터페이스에서 REST 서비스를 구현해야 합니다.
 

API 기본

이 섹션에서는 아래에 설명된 API의 기본 매개변수를 정의합니다.
 

이름

생성 중인 API의 이름
 

설명

API에 대한 설명은 명시적입니다.
 

해당 API에 액세스하는 경로입니다. 이 경로는 기본 경로를 기준으로 합니다. 중요:경로는 "/"로 시작해야 합니다.
 
경로 예:
[SERVER_ROOT]/[API_PATH]
 
다음 경로는 서버에서 GUI 및 테스트를 관리하는 데 사용됩니다.
 
* [SERVER_ROOT]/
 
 
* [SERVER_ROOT]/simple/*
 
중요:위에 나열된 경로는 사용하지 마십시오.
 

은닉처

시스템이 API 수신 요청 결과를 캐시하는 시간(초)입니다. 한 번에 새로운 요청의 양을 제한하는 데 사용할 수 있습니다.
 
예시 캐시:
If you need that users can only make 60 requests in one hour then you must put the cache in 60 …
 

방법

요청에 사용할 방법입니다. GET, POST, PUT, DELETE를 통해 연결할지 여부를 지정할 수 있지만 시스템은 모든 방법을 지원합니다.
 

출력

데이터를 인쇄하는 데 사용되는 출력입니다. 기본적으로 서버에는 JSON, XML, YAML, SERIALIZE의 네 가지 출력 플러그인이 함께 제공됩니다.
 

인수

출력을 얻기 위해 사용자 주문에서 제공해야 하는 동적 매개변수 목록입니다.
 
예시 로그인:
user_login매개변수를 인수로 추가하면 서비스에 액세스하기 위해 사용자에게 제공되는 경로는 다음과 같습니다.
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]
 
여기서 USER_SUPPLIED_VALUE는사용자가 데이터를 가져오기 위해 제공해야 하는 값입니다.
 

API 소스

이 섹션에서는 데이터를 가져온 소스를 정의합니다. 데이터 소스 유형은 연결 가능하며 기본적으로 서버에는 4가지 유형의 소스가 있습니다.
 

MySQL

서버의 데이터에 액세스하려면 MySQL 연결 매개변수를 충족해야 합니다.
 
  1. 호스트:서버 경로
  2. port:서버 포트(mysql 서버의 경우 일반적으로 3306)
  3. dbname:연결이 설정될 데이터베이스입니다.
  4. user, pass:서버에 연결하기 위한 자격 증명입니다.

SQLite

sqlite 데이터베이스에 연결하기 위한 구성은 더 간단하며 매개변수만 필요합니다.
 
  1. dbname:연결이 설정될 데이터베이스의 주소입니다.

ODBC

ODBC 리소스에 연결하려면 다음 매개변수를 설정해야 합니다.
 
  1. dsn:ODBC 리소스.
  2. user, pass:필요한 경우 리소스를 사용하기 위한 자격 증명입니다.

인쇄기

프린터에는 추가 구성이 필요하지 않습니다. Action 옵션에서 텍스트를 인쇄하기만 하면 됩니다.
 

실행하다

실행을 위한 수술 시스템 문장.
 

API 작업

선택한 형식으로 출력을 제공하기 위해 작업이 서버에서 실행됩니다.
 
예를 들어 간단한 mysql 작업을 실행하려는 경우:
 
SELECT * FROM `wp_terms` LIMIT 30
 
추가 매개변수가 필요한 경우:
 
SELECT user_login,user_nicename,user_email,user_registered
 
 
FROM `wp_users` WHERE user_login = :user_login LIMIT 30
 
이 경우 user_login은 API 기본섹션의 인수로 정의되어야 하며 작업 실행에 사용되도록 서버에 대한 요청 시 사용자가 제공해야 합니다.
 
액션 프린터는선택한 형식의 필드 액션에 사용된 데이터를 출력에 인쇄합니다.
 
예를 들어 작업 필드에 테스트 프린터가작성된 경우 JSON 형식의 출력 결과는 다음과 같습니다.
 
[ "Test printer" ]
 
sqlite 작업인 ODBC는 모두 mysql 작업과 유사합니다.
 

API 보안

REST 서비스에 보안을 추가할 수도 있습니다. 기본적으로 서버에는 보안 적용을 위한 세 가지 플러그인이 포함되어 있습니다.
 

수동

간단한 인증을 제공하기 위해 수동으로 정의된 자격 증명의 데이터 소스입니다.
 
예시 경로:
필드에서 사용자가작성되고 user1쓰기 를 통과하는1234경우 요청의 모든 사용자는 값을 제공해야 하며 user1API 1234에서 다음과 같습니다(GET 메소드의 예).
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]&__user=user1&__pass=1234
 

MySQL

자격 증명의 데이터 소스는 Mysql 데이터베이스입니다. 물론 자격 증명을 얻으려면 연결 매개 변수를 구성하고 실행할 작업을 정의해야 합니다( _user y_pass).
 
사용자 및 비밀번호 예시:
wp_users테이블에서 user_login을 선택하려면 다음과 같이 하십시오: `SELECT user_login FROM wp_users WHERE user_login = :user_login `
 
wp_users테이블에서 user_pass를 선택하려면 다음과 같이 하십시오: `SELECT user_pass FROM wp_users WHERE user_login = :user_login `
 
이는 API 경로에 남아 있습니다.
 
[SERVER_ROOT]/[API_PATH]?user_login=[USER_SUPPLIED_VALUE]&__user=[USER_VALUE]
 
 
&__pass=[PASS_VALUE]
 
이 경우 사용자는 USER_VALUE 및 PASS_VALUE 값에 WordPress 자격 증명을 제공해야 하며 , 보안 플러그인은 보안 작업 실행으로 얻은 값과 사용자가 제공한 값을 비교하고 인쇄 데이터를 검색하는 작업 실행을 계속합니다. 자세한 내용은 API 작업을 참조하세요.
 

없음

보안이 없습니다.
 

암호화

암호화 유형은 보안 기능을 보완하고 확장합니다. 서버에는 MD5, WORDPRESS, PLAIN, DRUPAL, SHA1의 3가지 암호화 유형이 포함되어 있으며 데이터베이스에서 추출된 데이터와 사용자 제공 데이터를 비교하는 데 사용됩니다.
 

이 튜토리얼을 마무리하기 위해 서버에 기본적으로 포함된 다음 예제를 남겨둡니다.
 

기초적인

  • [이름] :wp_user
  • [설명] :Get User Data from WordPress in JSON Format with WordPress Authentication
  • [길] :/wp/user
  • [캐시] : 0;
  • [방법] :GET
  • [출력] :JSON
  • [인수] :user_login

원천

  • [유형] :MYSQL
    • 주인 :[localhost]
    • 포트 :[3306]
    • 데이터베이스 이름 :wordpress_db
    • 사용자 :[wordpress_db_admin]
    • 통과하다 :[wordpress_db_pass]
  • [행동] :

보안

  • [유형] :MYSQL
    • 주인 :[localhost]
    • 포트 :[3306]
    • 데이터베이스 이름 :wordpress_db
    • 사용자 :[wordpress_db_admin]
    • 통과하다 :[wordpress_db_pass]
  • [사용자] :
  • [비밀번호] :
  • [암호화] :WORDPRESS
결과적으로 API 요청은 다음과 같습니다.
 
[SERVER_ROOT]/wp/user&user_login=[VALUE_USER_LOGIN]&__user=[USER_VALUE]
 
 
&__pass=[PASS_VALUE]
 

변경 로그

버전 1.2
 
  • PUT 및 DELETE 메소드를 추가합니다.
  • 각 API의 요청에 대한 로그를 추가합니다.
  • 그래픽 통계를 추가합니다.
버전 1.1
 
  • 액션 문장에 대한 도움말입니다.
  • 저장 방법을 리팩터링합니다.
버전 1.0
 
  • 초판.

소스 및 크레딧

우리는 제3자의 다음 파일이나 프로젝트를 사용합니다.
 
  • 레슬러
  • 심포니
  • 부스트랩-3.0.0
  • 제이쿼리
  • 워드프레스
  • 인력거
  • 무지방 프레임워크

API 서버 v1.2

 
 
 
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
127 [자유게시판] 힘이나는 명언 100가지 준비했습니다 오늘 하루 마무리 잘하시길 바랍니다 졸리운_곰 2026.03.22 89
126 [자유게시판][알아봅시다] USB 용량은 차지하는데 파일 안보임 현상 해결방법 !! file 졸리운_곰 2025.07.11 355
125 [자유게시판] [알아봅시다] ChatGPT로 그림 그리기 & Stable Diffusion 활용법 file 졸리운_곰 2025.06.09 117
124 [자유게시판] PC정비사 단답형 기출문제 모음집 (4~5년치 완벽 정리) file 졸리운_곰 2025.01.19 166
123 [자유게시판] 엑셀(Excel)에서 CSV 파일 한글 깨짐 해결하기 file 졸리운_곰 2025.01.10 193
122 [자유게시판] 마이크 잡음 제거하기 (windows 녹음기 10/11) file 졸리운_곰 2025.01.09 195
121 [자유게시판] PPT 글꼴 한번에 바꾸기 폰트 적용 방법 가이드 file 졸리운_곰 2024.12.22 344
120 [자유게시판] 윈도우에서 대량의 파일이 들어있는 폴더 빠르게 삭제하기 졸리운_곰 2024.12.18 106
119 [자유게시판] 워드 | 열기 암호, 쓰기 암호 설정하는 방법 file 졸리운_곰 2024.12.06 125
118 [자유게시판] powermockup비활성화시 활성화시키는법, powermockup 탭사라졌을 때 복원, 파워목업 오류, 초기화 file 졸리운_곰 2024.10.31 204
117 [자유게시판] 치매 장모님 유품 정리하다 '기억의 처절한 몸부림'을 보았다 file 졸리운_곰 2024.09.07 153
116 [자유게시판] 공부 대신 춤추러 다니던 서울대생 "한우물 파라? 다빈치도 N잡러였어요" file 졸리운_곰 2024.08.26 151
115 [자유게시판] 크몽 계약취소 악용 file 졸리운_곰 2024.08.08 401
114 [자유게시판] [컴퓨터게임스토리] 적군일까? 아군일까? file 졸리운_곰 2024.06.14 146
113 [자유게시판] Selenium과 함께 AutoIT 사용법 file 졸리운_곰 2024.04.23 185
112 [자유게시판] 피벗테이블 범위 조정하기 file 졸리운_곰 2024.04.17 651
111 [자유게시판] 피벗에서 피벗에서 행 레이블의 표현을 각각 품목과 품목번호로 만들 수 있는 방법은 없을까요? 졸리운_곰 2024.04.17 144
» [자유게시판] Our API Server 졸리운_곰 2024.03.27 126
109 [자유게시판] [IT/컴퓨터] 워드(Word) - 원고지 설정 및 줄 공책 양식 설정 file 졸리운_곰 2024.02.10 565
108 [자유게시판] 한컴오피스 한글 줄 노트 양식 만드는 방법 file 졸리운_곰 2024.02.10 1876
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED