Skip to content

Commit

Permalink
Merge branch 'master' into pending-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzenklotz committed Jul 10, 2023
2 parents 1c4d8b3 + 1af77c3 commit 3f5bd48
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Added a search feature for segments and segment groups. Listed segments/groups can be searched by id and name. [#7175](https://github.com/scalableminds/webknossos/pull/7175)
- Added support for transformations with thin plate splines. [#7131](https://github.com/scalableminds/webknossos/pull/7131)
- WEBKNOSSOS can now read S3 remote dataset credentials from environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY`. Those will be used, if available, when accessing remote datasets for which no explicit credentials are supplied. [#7170](https://github.com/scalableminds/webknossos/pull/7170)
- Added security.txt according to [RFC 9116](https://www.rfc-editor.org/rfc/rfc9116). The content is configurable and it can be disabled. [#7182](https://github.com/scalableminds/webknossos/pull/7182)

### Changed
- Redesigned the info tab in the right-hand sidebar to be fit the new branding and design language. [#7110](https://github.com/scalableminds/webknossos/pull/7110)
Expand Down
2 changes: 1 addition & 1 deletion app/RequestHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RequestHandler @Inject()(webCommands: WebCommands,
with LazyLogging {

override def routeRequest(request: RequestHeader): Option[Handler] =
if (request.uri.matches("^(/api/|/data/|/tracings/|/swagger).*$")) {
if (request.uri.matches("^(/api/|/data/|/tracings/|/swagger/|/\\.well-known/).*$")) {
super.routeRequest(request)
} else if (request.uri.matches("^(/assets/).*$")) {
val path = request.path.replaceFirst("^(/assets/)", "")
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ class Application @Inject()(multiUserDAO: MultiUserDAO,
} yield Ok
}

def getSecurityTxt: Action[AnyContent] = Action {
addNoCacheHeaderFallback(if (conf.WebKnossos.SecurityTxt.enabled) {
Ok(conf.WebKnossos.SecurityTxt.content)
} else {
NotFound
})
}

}

class ReleaseInformationDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
Expand Down
5 changes: 5 additions & 0 deletions app/utils/WkConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ class WkConf @Inject()(configuration: Configuration) extends ConfigReader with L
val version: Int = get[Int]("webKnossos.termsOfService.version")
}

object SecurityTxt {
val enabled: Boolean = get[Boolean]("webKnossos.securityTxt.enabled")
val content: String = get[String]("webKnossos.securityTxt.content")
}

val operatorData: String = get[String]("webKnossos.operatorData")
val children = List(User, Tasks, Cache, SampleOrganization, FetchUsedStorage, TermsOfService)
}
Expand Down
7 changes: 7 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ webKnossos {
acceptanceDeadline = "2023-01-01T00:00:00Z"
version = 1
}
securityTxt {
enabled = true
content ="""Contact: https://github.com/scalableminds/webknossos/security/advisories/new
Expires: 2024-07-03T10:00:00.000Z
Preferred-Languages: en,de
"""
}
}

singleSignOn {
Expand Down
5 changes: 3 additions & 2 deletions conf/noDS.noTS.routes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-> /api/ webknossos.versioned.Routes
-> /api/ webknossos.versioned.Routes

GET /swagger.json controllers.ApiHelpController.getResources
GET /swagger.json controllers.ApiHelpController.getResources
GET /.well-known/security.txt controllers.Application.getSecurityTxt
7 changes: 4 additions & 3 deletions conf/noDS.routes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-> /api/ webknossos.versioned.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes
-> /api/ webknossos.versioned.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes

GET /swagger.json controllers.ApiHelpController.getResources
GET /swagger.json controllers.ApiHelpController.getResources
GET /.well-known/security.txt controllers.Application.getSecurityTxt
7 changes: 4 additions & 3 deletions conf/noTS.routes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes
-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes

GET /swagger.json controllers.ApiHelpController.getResources
GET /swagger.json controllers.ApiHelpController.getResources
GET /.well-known/security.txt controllers.Application.getSecurityTxt
9 changes: 5 additions & 4 deletions conf/routes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes
-> /api/ webknossos.versioned.Routes
-> /data/ com.scalableminds.webknossos.datastore.Routes
-> /tracings/ com.scalableminds.webknossos.tracingstore.Routes

GET /swagger.json controllers.ApiHelpController.getResources
GET /swagger.json controllers.ApiHelpController.getResources
GET /.well-known/security.txt controllers.Application.getSecurityTxt

0 comments on commit 3f5bd48

Please sign in to comment.