Skip to content

Commit

Permalink
[backend] Removing the legacy binary time series access API
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzov committed Sep 4, 2024
1 parent afc4e17 commit b4e214f
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/main/scala/se/lu/nateko/cp/data/routes/CpbFetchRouting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,14 @@ class CpbFetchRouting(

val extractEnvri = UploadRouting.extractEnvriDirective

val route = path("portal" / "tabular"){ //to be removed, for data licence compliance
post{
entity(as[BinTableRequest]){ tableRequest =>
respondWithHeaders(`Access-Control-Allow-Origin`.*){
returnBinary(tableRequest)
}
} ~
gracefulBadReq(s"Expected a proper binary table request")
} ~
options{
respondWithHeaders(
`Access-Control-Allow-Origin`.*,
`Access-Control-Allow-Methods`(HttpMethods.POST),
`Access-Control-Allow-Headers`("Content-Type")
){
complete(StatusCodes.OK)
}
}
} ~ // end of the block to be removed
val route = path("portal" / "tabular"){
complete(
StatusCodes.NotFound -> (
"Legacy binary access has been discontinued. " +
"Please uprade to the latest version of the Python library."
)
)
} ~
pathPrefix("cpb") { extractEnvri{envri ?=>
val ensureReferrerIsOwnApp = RoutingHelper.ensureReferrerIsOwnAppDir(authRouting.conf)
(post & respondWithHeader(`Access-Control-Allow-Credentials`(true))){
Expand Down

0 comments on commit b4e214f

Please sign in to comment.