Git Product home page Git Product logo

studip-rest.ip's Introduction

REST.ip

DEPRECATED

Please be aware that Rest.IP has been deprecated for a while and will not be usable in Stud.IP as of version 4.0. Please refer to the Stud.IP core API which can completely replace everything that Rest.IP does.

Description

This plugin is supposed to be a working example of a RESTful webservice implementing authentication by OAuth.

Integration in Stud.IP

Installation

Clone this repository including it's submodules: git clone --recursive [email protected]:studip/studip-rest.ip.git

Create a zip archive of the directory and install it via Stud.IP's plugin manager.

API location

The API is located at installation_url/plugins.php/restipplugin/api for now.

Full german API documentation is available here.

Administration of consumers for root administrators

Root administrators can manage which external apps are allowed to access the api on a new page located in /admin/config.

Applications can be created, updated and deleted there. It is also possible to activate/deactivate a certain app. Access keys are managed here too.

Administration of applications for users

Users can manage which external apps are allowed to access their data on a new page located in /settings/config.

Credits

  • RESTful state is implemented using Slim
  • OAuth is implemented using oauth-php on the server side

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

studip-rest.ip's People

Contributors

aklassen avatar jhwillms avatar krassmus avatar noackorama avatar rockihack avatar tgloeggl avatar tleilax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

studip-rest.ip's Issues

Dont'r return mixed values!

If for example a user has not entered an adress, the api returns null while it returns a string if an adress has been entered.

This should be consistent and thus the api should return an empty string.

Write administration

The administration is written as a Stud.IP plugin.

Root administrators grant, edit or revoke access permissions to specific client applications. This is the only place, client keys and secret are publicly visible.

It is supposed to offer the following functions:

  • Create a new client
  • Update a client
  • Remove a client
  • Block/deactivate a client and unblock/activate it again
  • List all available clients in a reasonable manner

Improve stability

Sometimes the server responds to an request with an 500 error. After this response the server seems to stop working. For about 1 Minute no other request is answered positive, this means 500 error.

Unknown request token ""

Under certain circumstances, the server doesn't seem to issue a request token.

Investigate and fix.

Access administration: Display routes as foldable sections

The more routes the api support, the more confusing the administration page for access settings gets.

The routes should be grouped by the url and should be foldable.

Consideration: Disable /news without disabling all /news/* routes.

Add Skype to Profile

Ob the developer board and also on the stud.ip of the university oldenburg i have seen the skype field in the user profile. It would be nice to provide the username n the profile. In this way the app can allow the current user to call the skype user directly if skype is installed.

New route: Colorscheme of installation

It should be possible to get the colorscheme of an installation. Currently an prototype is developed which can be configured with two base colors (standard:light and darkblue) and one backgroundcolor (standard:gray). This route can help to easily adapt the app to different installations of stud.ip. And also the known color scheme gives the user an warm feeling because he feels at home ;)....

Parameter for time dependent returns

If a consumer request a resource like news it would be nice to define the date from which he would like to get the entries. Idea: Reducing the data traffic by using a paramater.

Adjust route /news

Put a list of comments to every news object that is returned. Compare /courses where a list of teachers, is returned. This is useful to link every comment object to a news in a local database.

Folder list seems to be wrong.

First i request all folders for course 834499e2b8a2cd71637890e5de31cba3 with

GET /trunk/plugins.php/restipplugin/api/documents/834499e2b8a2cd71637890e5de31cba3/folder HTTP/1.1

Return is:

{
"folders":[
...
{
"folder_id":"aa15759a75c167e38425d17539e7a7be",
...
},
...
],
"documents":[

]
}

Next step is to request all files like for folder with ID aa15759a75c167e38425d17539e7a7be with

GET /trunk/plugins.php/restipplugin/api/documents/834499e2b8a2cd71637890e5de31cba3/folder/aa15759a75c167e38425d17539e7a7be HTTP/1.1

Response is:

404: No folder aa15759a75c167e38425d17539e7a7be for range 834499e2b8a2cd71637890e5de31cba3

This is strange.

Another thing is that the request

GET /trunk/plugins.php/restipplugin/api/documents/834499e2b8a2cd71637890e5de31cba3/folder HTTP/1.1

sometimes returns an 500 error from beginning.

Upload documents

Feature request. The UI and business logic inside the app exists i only need an end point in the api. Idea is to upload images, videos oder other kind of documents.

New Parameter for posting messages

While Posting a new message allow the user to send the message as an email and not as an internal message. I found the switch "Nachricht als E-Mail versenden" and want to use a same mechanism.

Extend settings route

Add value for API-Version (usefull for debugging) eg. If a user has problems and send an email to the app-support it would be nice to know which version of the api the selected facility of the user is using.

Show complete example

At the moment, there is no easy way to view an example json response without the neccessity to scroll.

This should be fixed by providing a link to either download the example json, view it in another tab, view it in a lightbox or to expand the element containing the example. Which one it will be, is yet to be decided...

RSS format?

The API could provide an RSS view for custom routes as well.

This comes with some implications.

  • Generic rss template vs routing modifications

Append action to activities

If i got an activity like "Foo has uploaded a file XYZ to Course Bar" it would be nice to get the important informations from the activate without parsing the text. I could image a parameter "action" with a scheme. Facebook does the same:

fb://profile – Open Facebook app to the user’s profile

fb://friends – Open Facebook app to the friends list
fb://notifications – Open Facebook app to the notifications lis
fb://feed – Open Facebook app to the News Feed
fb://events – Open Facebook app to the Events page
fb://requests – Open Facebook app to the Requests list
fb://notes – Open Facebook app to the Notes page
fb://albums – Open Facebook app to Photo Albums lis

Maybe we can find something similar.

Improve routes for documents

  1. The route for documents is not optimal. If i request all the folders or documents the return always contains also the other array. Example: I request folders i get the following return:

{
"folders": [
.....
],
"documents": []
}

So there is also an empty document array. This is not needed in my opinion.

  1. If i request all the folders i have no list of documents, i have to make another call to the server, request the documents and than store this association between the returned documents and the folder. In a normal usecase i would expect that i some request an folder he also wants to know all the containing files. So maybe it would be useful if an "folder"-object also contains a list of document_ids like a course contains an array of participants.
  2. /api/documents/:range_id/folder/<:folder_id> is complicated. I would change it like: /api/documents/folder/:range_id/
    If range_id is a course_id the server could return a folder object array, else if it is an folder_id a single folder object.
  3. Does the server increment the download count of a file if i download it via API?
  4. While testing i received a folder list containing folders with names like "Invisible Folder", "Only readable Folder", ... I would assume that invisible folders should also not be visible inside the app. Do i have to parse the names or is there another way to indicate something like invisible or only readable, maybe a bool value?

New route: Events

It would bei nice to get the upcoming events of a course. It would be also possible if the route returns an ics-calendar-file.

Geolocation (Idea, Future)

Add paramaters for geolocation to every object that has an location like courses, events, address of user.

Localized folder names (Messages)

It should be possible to get localized names for route /api/messages/:box, e.g. "Message Inbox" vs. "Posteingang". This is localized in Stud.IP (other than course names) and should also be localizable in Apps.

New route: /contacts

We need a new route for contacts.

  • /contacts - GET - Get all contact groups (ungrouped entries?)
  • /contacts/:group - GET - Get members of specified group
  • /contacts/:group/:user_id - PUT - Move a contact into a group
  • /contacts/:group/:user_id - DELETE - Remove a contact from a group

Provide default Stud.IP authorization

With a few modifications, Rest.IP could provide default Stud.IP authorization as well, useful for ajax requests amonst other things.

Basically, it's only neccessary to provide a fallback for OAuth::verify().

Improve documentation

This issue is for all problems with the documentation:

/api/courses/:course_id/members/:status <- what does ":status" mean

This is unclear, but from the example code is assume it should be "teachers", "tutors" or "students".

Lose Slim?

As much as I like Slim, it doesn't really fit the needs for this plugin.

I would like to build the route handlers in a way that you'd simply return the values you want to render (thus losing the neccessity to inject the $router function into the handler). This is not possible in Slim (afaik).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.