Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b2d7579
Adapted configuration file to support Instance Registry
Aug 7, 2018
59c21b6
Added synk badge to README
bhermann Aug 11, 2018
778090d
Extracting source object from es response
Aug 14, 2018
957bbaf
Changes for instance registry
24santoshr Sep 5, 2018
ca82795
Changes for Instance Registry
24santoshr Sep 5, 2018
ca17f1f
Changes for Instance registry
24santoshr Sep 8, 2018
5546b31
Changes for Instance registry
24santoshr Sep 10, 2018
989e425
Merge branch 'feature/adapt-swagger-model' into feature/instanceregistry
Sep 11, 2018
593ff35
Merge pull request #21 from delphi-hub/develop
24santoshr Sep 11, 2018
fab695a
Instance Registry changes
24santoshr Sep 12, 2018
f56a54d
Update InstanceRegistry.scala
24santoshr Sep 16, 2018
6297abe
Bumped akka-http version b/c of CVE-2018-16131
bhermann Sep 17, 2018
657bda4
Instance Registry changes for WebApi
24santoshr Oct 3, 2018
c2488e0
Instance Registry changes for WebApi
24santoshr Oct 3, 2018
a9f8b2e
Changes for Instance Registry
24santoshr Oct 3, 2018
388ddaf
Added elastic actor test
Oct 4, 2018
55b14a8
Updated elastic actor test with mock data
Oct 4, 2018
045d075
Merge branch 'develop' into RetrieveEndpoint/15
hariharansrc Oct 4, 2018
4743fac
Moved ElasticActorTest to integration test
Oct 5, 2018
f0fa33e
Reverting to latest akka http version
Oct 5, 2018
ee037e9
Merge pull request #25 from delphi-hub/RetrieveEndpoint/15
bhermann Oct 8, 2018
cdad67c
Merge branch 'develop' into feature/instanceregistry
bhermann Oct 9, 2018
1677b67
Merge pull request #20 from delphi-hub/feature/instanceregistry
bhermann Oct 9, 2018
d47316d
Implementation of functions with respect to the new API. Other funtio…
Ayybeeshafi Oct 16, 2018
e4bf21c
Implementation and testing of functions with respect to new API refs #23
Ayybeeshafi Oct 18, 2018
6ce7899
Merge branch 'develop' into newInstanceRegistry
Oct 18, 2018
28c6187
Merge pull request #26 from delphi-hub/newInstanceRegistry
bhermann Oct 21, 2018
af5371e
Removing incorrectly copied subproject
bhermann Oct 22, 2018
ed80dcf
Added Licenses and reorganized imports
bhermann Oct 22, 2018
f014bf0
Renamed fields to conform to coding style
bhermann Oct 22, 2018
bf2c78a
Reorganized imports
bhermann Oct 22, 2018
2324c22
Added support for system termination (issue #22)
bhermann Oct 22, 2018
3fbbc6b
Pinned jackson-databind version
bhermann Oct 22, 2018
cbd5d6b
Added statistics endpoint.
bhermann Oct 25, 2018
c06b77c
Reimplemented `retrieve` endpoint
bhermann Oct 27, 2018
4638cd6
Fixed termination inside of sbt console
bhermann Oct 27, 2018
35f7ca5
Changed prettyPrint to sortedPrint
bhermann Oct 27, 2018
76ec751
Took feature list now directly from index mapping
bhermann Oct 27, 2018
06bb1a9
Reformatted and added pretty printing to the statistics endpoint
bhermann Oct 27, 2018
dd3d624
Implemented search endpoing
bhermann Oct 27, 2018
d27a248
Gave sense to the test
bhermann Oct 27, 2018
3b1587a
Organized imports
bhermann Oct 27, 2018
7b26a4f
Added `-` to syntax as a valid character in field references
bhermann Oct 28, 2018
40ed0fa
Refactorings
bhermann Oct 30, 2018
78b3a2d
Refactorings
bhermann Oct 30, 2018
cb1bb23
Better error messages
bhermann Oct 30, 2018
f0408a3
Changed query interface to accomodate for new parameters
bhermann Oct 30, 2018
9aa80bc
Refactorings
bhermann Oct 30, 2018
529e954
Changed scalastyle configuration
bhermann Oct 30, 2018
f9a4c32
Fixed logging
bhermann Oct 30, 2018
e91fd60
Organized dependencies
bhermann Oct 30, 2018
7b5e1f2
Fixed retrieve query
bhermann Nov 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ The web API implementation for the Delphi platform.
We are currently in pre-alpha state! There is no release and the code in
this repository is purely experimental!

|branch | status | codacy |
| :---: | :---: | :---: |
| master | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=master)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540)](https://www.codacy.com/app/delphi-hub/delphi-webapi?utm_source=github.com&utm_medium=referral&utm_content=delphi-hub/delphi-webapi&utm_campaign=Badge_Grade)|
| develop | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=develop)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540?branch=develop)](https://www.codacy.com/app/delphi-hub/delphi-webapi?branch=develop&utm_source=github.com&utm_medium=referral&utm_content=delphi-hub/delphi-webapi&utm_campaign=Badge_Grade) |
|branch | status | codacy | snyk |
| :---: | :---: | :---: | :---: |
| master | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=master)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540)](https://www.codacy.com/app/delphi-hub/delphi-webapi?utm_source=github.com&utm_medium=referral&utm_content=delphi-hub/delphi-webapi&utm_campaign=Badge_Grade)| [![Known Vulnerabilities](https://snyk.io/test/github/delphi-hub/delphi-webapi/badge.svg?targetFile=build.sbt)](https://snyk.io/test/github/delphi-hub/delphi-webapi/?targetFile=build.sbt) |
| develop | [![Build Status](https://travis-ci.org/delphi-hub/delphi-webapi.svg?branch=develop)](https://travis-ci.org/delphi-hub/delphi-webapi) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8ebe27850ffb4139af6280fd1cd6d540?branch=develop)](https://www.codacy.com/app/delphi-hub/delphi-webapi?branch=develop&utm_source=github.com&utm_medium=referral&utm_content=delphi-hub/delphi-webapi&utm_campaign=Badge_Grade) | [![Known Vulnerabilities](https://snyk.io/test/github/delphi-hub/delphi-webapi/develop/badge.svg?targetFile=build.sbt)](https://snyk.io/test/github/delphi-hub/delphi-webapi/develop/?targetFile=build.sbt) |

## What is the Delphi Web API?

Expand Down
48 changes: 31 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,42 @@ version := "1.0.0-SNAPSHOT"

scalaVersion := "2.12.4"

libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
libraryDependencies += "com.typesafe.akka" %% "akka-http" % "10.0.11"
libraryDependencies += "com.typesafe.akka" %% "akka-stream" % "2.5.12"
libraryDependencies += "com.typesafe.akka" %% "akka-http-spray-json" % "10.1.1"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.3"
libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % "test"
val akkaVersion = "2.5.14"
libraryDependencies ++= Seq (
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion
)

val akkaHttpVersion = "10.1.5"
libraryDependencies ++= Seq (
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion
)

val elastic4sVersion = "6.3.0"
libraryDependencies ++= Seq(
"com.sksamuel.elastic4s" %% "elastic4s-core" % elastic4sVersion,

// for the http client
"com.sksamuel.elastic4s" %% "elastic4s-http" % elastic4sVersion,

// if you want to use reactive streams
"com.sksamuel.elastic4s" %% "elastic4s-http-streams" % elastic4sVersion,

// testing
"com.sksamuel.elastic4s" %% "elastic4s-testkit" % elastic4sVersion % "test",
"com.sksamuel.elastic4s" %% "elastic4s-embedded" % elastic4sVersion % "test"
)

libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.4"
libraryDependencies += "io.spray" %% "spray-json" % "1.3.3"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.4"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.4" % "it,test"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" % Runtime

lazy val webapi = (project in file(".")).
//https://www.scala-sbt.org/1.x/docs/Testing.html
configs(IntegrationTest).
settings(
Defaults.itSettings,
).
enablePlugins(JavaAppPackaging).
enablePlugins(DockerPlugin).
enablePlugins(ScalastylePlugin).
settings (
settings(
dockerBaseImage := "openjdk:jre-alpine"
).
enablePlugins(AshScriptPlugin).
Expand All @@ -44,3 +50,11 @@ lazy val webapi = (project in file(".")).
)

scalastyleConfig := baseDirectory.value / "project" / "scalastyle-config.xml"

// Pinning secure versions of insecure transitive libraryDependencies
// Please update when updating dependencies above (including Play plugin)
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % "2.9.7"
)

trapExit := false
4 changes: 2 additions & 2 deletions project/scalastyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</check>
<check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
<parameters>
<parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
<parameter name="header"><![CDATA[// Copyright (C) 2018 The Delphi Team.
// See the LICENCE file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
28 changes: 28 additions & 0 deletions src/it/scala/de/upb/cs/swt/delphi/webapi/FeatureQueryCheck.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (C) 2018 The Delphi Team.
// See the LICENCE file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package de.upb.cs.swt.delphi.webapi

import org.scalatest.{FlatSpec, Matchers}

class FeatureQueryCheck extends FlatSpec with Matchers {
"FeatureExtractor" should "provide a list of features" in {
val configuration = new Configuration()
val featureList = new FeatureQuery(configuration).featureList

featureList.size should be > 0
}
}
32 changes: 32 additions & 0 deletions src/it/scala/de/upb/cs/swt/delphi/webapi/SearchQueryTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (C) 2018 The Delphi Team.
// See the LICENCE file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package de.upb.cs.swt.delphi.webapi

import de.upb.cs.swt.delphi.webapi.search.{QueryRequest, SearchQuery}
import org.scalatest.{FlatSpec, Matchers}

import scala.util.Success

class SearchQueryTest extends FlatSpec with Matchers {
"Search query" should "check for fields" in {
val configuration = new Configuration()
val q = new SearchQuery(configuration, new FeatureQuery(configuration))

val response = q.search(QueryRequest("[if_icmpeq (opcode:159)]>1"))
response shouldBe a [Success[_]]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.upb.cs.swt.delphi.webapi

import org.scalatest.{FlatSpec, Matchers}

class StatisticsQueryCheck extends FlatSpec with Matchers {
"Statics" should "be retrievable" in {
val configuration = new Configuration()
val stats = new StatisticsQuery(configuration)
println(stats.retrieveStandardStatistics)
}
}
27 changes: 9 additions & 18 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
es-priority-mailbox {
mailbox-type = "de.upb.cs.swt.delphi.webapi.ElasticPriorityMailbox"
}

akka.actor.deployment {
/espriomailboxactor {
mailbox = es-priority-mailbox
}

}

akka {

loggers = ["akka.event.slf4j.Slf4jLogger"]
logLevel = "INFO"
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
log-dead-letters = 0
log-dead-letters-during-shutdown = off
log-config-on-start = off

http {
server {
remote-address-header = on
}
}
}

# Use this dispatcher for actors that make blocking calls to the Elasticsearch database
elasticsearch-handling-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 4
# This thread pool is intended for development purposes, and should be increased for production
}
throughput = 1
}
36 changes: 36 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
<configuration>

<!--<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />-->

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home:-.}/logs/application.log</file>
<encoder>
<pattern>[%level] [%date] from %logger in %thread - %message%n%xException</pattern>
</encoder>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%date] %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>

<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>

<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>

<logger name="de.upb.cs.swt.delphi" level="INFO" />
<logger name="application" level="DEBUG" />


<root level="WARN">
<!--<appender-ref ref="ASYNCFILE" />-->
<appender-ref ref="ASYNCSTDOUT" />
</root>

</configuration>

This file was deleted.

Loading