-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from biblibre/NCSU_Propose_API_merged_repo
Add an API to Coral (Issue #7)
- Loading branch information
Showing
13 changed files
with
662 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteRule ^(.*)$ index.php [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The API uses Flight, a fast, simple, extensible framework for PHP. | ||
Just install Flight in this directory, so Flight.php is available like this: resources/api/Flight/flight/Flight.php | ||
|
||
http://flightphp.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Edit resources/admin/configuration.ini and fill apiAuthorizedIP in the [settings] section with the IP address of the client accessing the API: | ||
apiAuthorizedIP="192.168.1.1" | ||
|
||
You can set multiple IPs (comma-separated): | ||
apiAuthorizedIP="192.168.1.1,192.168.2" | ||
|
||
You can also set incomplete IPs so the whole range will be allowed: | ||
apiAuthorizedIP="192.168.1" | ||
(will authorize all IPs from 192.168.1.1 to 192.168.1.255) | ||
|
||
If you are trying to access the API from the machine it is installed on, you can use the loopback interface (127.0.0.1). | ||
|
||
Hint: if you don't know which IP address will be requesting the API, just leave apiAuthorizedIP blank (apiAuthorizedIP="") and access the example form with your browser ( http://yourcoral.tld/resources/api_client/ ), you will get an error like this: | ||
You are not authorized to use this service. | ||
Unauthorized IP: 127.0.0.1 |
Oops, something went wrong.