Giter Site home page Giter Site logo

amiv-eth / amivapi Goto Github PK

View Code? Open in Web Editor NEW
30.0 30.0 6.0 3.21 MB

The REST API behind most of AMIV's web services.

Home Page: http://api.amiv.ethz.ch/docs

License: GNU Affero General Public License v3.0

Python 95.62% HTML 2.92% CSS 1.19% Dockerfile 0.19% JavaScript 0.08%

amivapi's People

Contributors

ahirsch-dev avatar alexander-schoch-linuxdays avatar amiv avatar cburchert avatar d-portenier avatar dependabot[bot] avatar emorbach avatar gartens avatar hermannsblum avatar i98 avatar ianbo98 avatar kunerj avatar lujobi avatar mat-pa avatar moschn avatar notspecial avatar sel3ne avatar tar-tarus avatar temparus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

amivapi's Issues

Unit tests for Authentification

This should check at least:

  • Can a user login(receives a token and it is correctly added to database)
  • Do all kinds of passwords work as intended(unicode, chinese weird characters, shellcodes)
  • Does a user get admin access (g.resource_admin_access) correctly based on his permissions and the requested resource(or because he is root)
  • Is the correct user logged in (g.logged_in_user)
  • Can a user change his password with PATCH
  • Can a newly created user log in(does his password hash correctly?)
  • Is the _author field correctly set for all items
  • Does a GET request by an owner return the correct dataset
  • Does a GET request by an owner return the correct dataset for an indirect owner(via relationship)
  • Does a POST request by a future owner work
  • Does a POST request by an indirect owner work

Revert actions

There should be a possibility to revert actions as DELETE and PATCH when they change information which may have taken a lot of work to do. This could be achived by archiving stuff or by versioning. Discussion?

Mailinglist backend

Changes to the forwards resource should propagate into the filesystem, where they are read by the mailserver. For every forward there should be a file ~/.forward+<address_to_forward>, which contains one address per line and can have comments prepended with '#'.
For example the list "[email protected]" with the addresses "[email protected]" and "[email protected]" should have a file ~/.forward+helfer with the contents:

# Maintained by amivapi, changes are overwritten

[email protected]
[email protected]

LDAP importer

Implement functionality to import users from LDAP and to update account information.

OP log

All requests should be logged including their query strings(except passwords). This should vastly improve bug detection.

Yes we scan.

Clean up setup procedure

Sort an clean all functions necessary to configure the api.

One single setup would be optimal.

Extract information of permission_matrix

It should be possible to get what roles exist and which permissions they grant via the API to display those informations to a user, when he is performing administrative tasks.

Documentation: File interface

Describe how the file interface can be used in the User Guide.
Also describe implementation details in the Developer Guide.

Studydocument file association

Associate files with studydocuments and update the association on changes to the studydocument. Remove the file when it is not needed anymore.

File resource can be created without file; breaks everything

It is possible to create the file resource without sending a file, but this will break all GET requests that try to access the resource.

What needs to be done

  • file is required to create /files item!
  • fix mediastorage anyway so it doesn't break

LDAP Synchronisation

There should be a feature, that accounts are updated from LDAP at regular intervalls. This needs a mechanism to schedule task to run at a regular interval(cron interface).

Document permissions

  • Document /permissions resource
  • Document permission system (root account, role based admin system, affected_user and owner system)

API Version

The API should send a version string, which can be used to provide backwards compatibility when the API is changed.

Deleting things returns 400

When deleting anything which is referenced by a ForeignKey which can not be nulled, 400 will be returned. We need hooks which handle this before the action is performed.
Same problem for puts.

File upload

Make it possible to upload files to the /files resource, retrive the metainfo or the content

LDAP Login

Implement to reroute the login to LDAP and when credentials match there login the user without local password check.

API Documentation

A documentation of all resources with their methods, their fields and the possible value ranges should be available.

Document session management

  • Create a tutorial how to login and send the token to authorize requests.
  • Write API documentation of /sessions resource
  • Document token, password hash method, security details

Exception Log

Log all exceptions with relevant information to fix bugs. The log should be informative enough to reproduce the situation where it occured.

Data Relationships

Need to implement a correct mapping between different resources

  • GET requests on e.g. /users should show groups
  • POST/PUT on e.g. /groupmemberships should make a new mapping between an user and a group
  • POST/PUT on /users doesn't assign any relationships
  • DELETE on a user should also delete all relationships

Files can't be uploaded

The 'with' block in utils.parse_data() closes any files sent before they reach the point at which they are written to the disk.

This causes an I/O error.

Document introduction

Should include somehow:

  • What is REST
  • How to send requests
  • Response format(meta fields)
  • Pagination
  • Where clauses
  • etag

Advanced:

  • Bulk insert
  • Projection

Do we want Multilanguage support?

Regarding or master students and general API viability, I would like to implement support for english and german.

This is a minor change in the model - does anything speak against it?

validate prices in /events

prices are stored as string because sqlalchemy does not support decimal-objects
Therefore they need to be validated by a schema

MySQL backend

The app will run on MySQL in production, so add support for it. Since we are already using SQLAlchemy for the data layer, adding MySQL support is as simple as switching the SQLALCHEMY_DATABASE_URI setting to a MySQL URI. The real issue is to support multiple instances running seperated from each other on the same database, e.g. when running the test suite on the developer machine (or even multiple test suites in parallel).

In short: Make sure the tests create their own (preferably random) database "on-the-fly".

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.