Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add REST API versioning support (second try) #3408

Merged
merged 9 commits into from
Oct 29, 2018
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