Skip to content

Commit

Permalink
Merge pull request #1913 from MAIF/http-wasm
Browse files Browse the repository at this point in the history
Http wasm
  • Loading branch information
Zwiterrion committed May 24, 2024
2 parents 1645462 + c7cefa3 commit b9732b4
Show file tree
Hide file tree
Showing 13 changed files with 1,218 additions and 20 deletions.
1 change: 0 additions & 1 deletion otoroshi/app/el/el.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import otoroshi.utils.http.RequestImplicits._
import kaleidoscope._
import otoroshi.next.extensions.HttpListenerNames
import otoroshi.next.models.NgRoute
import otoroshi.next.plugins.Keys
import otoroshi.utils.{ReplaceAllWith, TypedMap}
import otoroshi.utils.syntax.implicits._

Expand Down
4 changes: 2 additions & 2 deletions otoroshi/app/next/plugins/graphql.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object GraphQLQueryConfig {
"query" -> o.query,
"timeout" -> o.timeout,
"response_path" -> o.responsePath.map(JsString.apply).getOrElse(JsNull).asValue,
"response_filter" -> o.responsePath.map(JsString.apply).getOrElse(JsNull).asValue
"response_filter" -> o.responseFilter.map(JsString.apply).getOrElse(JsNull).asValue
)
}
}
Expand Down Expand Up @@ -1164,7 +1164,7 @@ class GraphQLBackend extends NgBackendCall {
builder = customBuilder,
initialData = config.initialData.map(_.as[JsObject]).getOrElse(JsObject.empty),
maxDepth = config.maxDepth,
variables = (jsonBody \ "variables").asOpt[JsValue].getOrElse(Json.obj()).as[JsObject]
variables = (jsonBody \ "variables").asOpt[JsObject].getOrElse(Json.obj())
)
case None => jsonResponse(400, Json.obj("error" -> "query field missing")).future
}
Expand Down
2 changes: 1 addition & 1 deletion otoroshi/app/wasm/host.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import otoroshi.utils.cache.types.UnboundedTrieMap
import otoroshi.utils.json.JsonOperationsHelper
import otoroshi.utils.syntax.implicits._
import otoroshi.utils.{ConcurrentMutableTypedMap, RegexPool, TypedMap}
import otoroshi.wasm.httpwasm.HttpWasmFunctions
import play.api.Logger
import play.api.libs.json._

Expand Down Expand Up @@ -1225,7 +1226,6 @@ object HostFunctions {
Http.getFunctions(config, attrs) ++
State.getFunctions(config, pluginId) ++
DataStore.getFunctions(config, pluginId)

functions.collect {
case func if func.authorized(config) => func.function
}.toArray
Expand Down
Loading

0 comments on commit b9732b4

Please sign in to comment.