Skip to content

Commit

Permalink
Add REST API versioning support (second try) (#3408)
Browse files Browse the repository at this point in the history
* Revert "Add debugging methods to visualize wireframe of buckets (#3402)"

This reverts commit 8238820.

* Revert "fixed bug that selects a just removed layout (#3379)"

This reverts commit 8b16ef3.

* Revert "Added button to revoke admin rights in frontend (#3378)"

This reverts commit 2fc489c.

* Revert "Revert "Add REST API versioning support (#3385)" (#3404)"

This reverts commit 49819b2.

* move /api routes prefix to webknossosApi.routes

* reorganize routing to handle all combinations of local datastore/tracingstore etc

* update migrations
  • Loading branch information
fm3 authored Oct 29, 2018
1 parent 217dc45 commit a1e85f1
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 163 deletions.
1 change: 1 addition & 0 deletions MIGRATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.md).
- There is now a separate module for the tracingstore, the datastore is no longer responsible for saving tracings. This module can run as a standalone application, or as a module of webKnossos locally. It is recommended that you choose the option that was previously also in place for datastores. In case of a standalone datastore, the local one needs to be disabled in application.conf: `tracingstore.enabled = false` and `play.modules.disabled += "com.scalableminds.braingames.datastore.TracingStoreModule` – and in either case, the adress of the tracingstore (localhost or remote) needs to be inserted in the db in `webknossos.tracingStores`.
- The FossilDB version has changed from `0.1.10` to `0.1.14`.
- The FossilDB needs to be run with an additional column family `volumeUpdates`.
- If your setup overwrites the config key `play.http.router` to disable the local datastore, change it to `"noDS.Routes"` (or `"noDS.noTS.Routes"` to also disable the local tracingstore).

#### Postgres Evolutions:
- [027-drop-dataset-name-unique-constraint.sql](conf/evolutions/027-drop-dataset-name-unique-constraint.sql)
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/LegacyApiController.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package controllers

import com.mohiva.play.silhouette.api.Silhouette
import javax.inject.Inject
import oxalis.security.WkEnv
import utils.WkConf

class LegacyApiController @Inject()(conf: WkConf,
sil: Silhouette[WkEnv]) extends Controller {


}
3 changes: 3 additions & 0 deletions conf/noDS.noTS.routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GET /assets/*file controllers.Assets.at(path="/public", file)

-> /api/ webknossos.versioned.Routes
4 changes: 4 additions & 0 deletions conf/noDS.routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GET /assets/*file controllers.Assets.at(path="/public", file)

-> /api/ webknossos.versioned.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes
4 changes: 4 additions & 0 deletions conf/noTS.routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GET /assets/*file controllers.Assets.at(path="/public", file)

-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes
4 changes: 3 additions & 1 deletion conf/routes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-> / webknossos.Routes
GET /assets/*file controllers.Assets.at(path="/public", file)

-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes
161 changes: 161 additions & 0 deletions conf/webknossos.latest.routes

Large diffs are not rendered by default.

162 changes: 0 additions & 162 deletions conf/webknossos.routes

This file was deleted.

13 changes: 13 additions & 0 deletions conf/webknossos.versioned.routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# API versioning is handled here. Higher-Priority routes first

GET /assets/*file controllers.Assets.at(path="/public", file)

# example: assume, the features route has changed, introducing v2. The older v1 needs to be provided in the legacyApiController
#-> /v2/ webknossos.Routes


# GET /v1/features controllers.LegacyApiController.v1features
-> /v1/ webknossos.latest.Routes


-> / webknossos.latest.Routes

0 comments on commit a1e85f1

Please sign in to comment.