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

Denylist PlayWeb configuration names with undefined config keys. Fixes #57 #58

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion scala/SnykSbtPlugin-0.1x.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.json4s._

object SnykSbtPlugin extends AutoPlugin {
val ConfigBlacklist: Set[String] =
Set("windows", "universal", "universal-docs", "debian", "rpm", "universal-src", "docker", "linux")
Set("windows", "universal", "universal-docs", "debian", "rpm", "universal-src", "docker", "linux", "web-assets", "web-plugin", "web-assets-test")

case class SnykModuleInfo(version: String, configurations: Set[String])

Expand Down
2 changes: 1 addition & 1 deletion scala/SnykSbtPlugin-1.2x.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sjsonnew.support.scalajson.unsafe.PrettyPrinter

object SnykSbtPlugin extends AutoPlugin {
val ConfigBlacklist: Set[String] =
Set("windows", "universal", "universal-docs", "debian", "rpm", "universal-src", "docker", "linux")
Set("windows", "universal", "universal-docs", "debian", "rpm", "universal-src", "docker", "linux", "web-assets", "web-plugin", "web-assets-test")

case class SnykModuleInfo(version: String, configurations: Set[String])
case class SnykProjectData(
Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/testproj-play-scala-seed-1.2.8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
logs
target
/.idea
/.idea_modules
/.classpath
/.project
/.settings
/RUNNING_PID
17 changes: 17 additions & 0 deletions test/fixtures/testproj-play-scala-seed-1.2.8/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name := """testproj-play-scala-seed-1.2.8"""
organization := "com.example"

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.13.0"

libraryDependencies += guice
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3" % Test

// Adds additional packages into Twirl
//TwirlKeys.templateImports += "com.example.controllers._"

// Adds additional packages into conf/routes
// play.sbt.routes.RoutesKeys.routesImport += "com.example.binders._"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.2.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.3")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
14 changes: 14 additions & 0 deletions test/system/plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,17 @@ test('run inspect() on 1.2.8 with custom-plugin', async (t) => {
'1.4',
'correct version found');
});

test('run inspect() on play-scala-seed 1.2.8 with custom-plugin', async (t) => {
const result: any = await plugin.inspect(path.join(__dirname, '..', 'fixtures'),
'testproj-play-scala-seed-1.2.8/build.sbt', {'sbt-graph': true});
t.equal(result.plugin.name, 'snyk:sbt', 'correct handler');

t.equal(result.package.packageFormatVersion, 'mvn:0.0.1', 'correct package format version');
t.equal(result.package
.dependencies['com.typesafe.play:play-guice_2.13']
.dependencies['com.typesafe.play:play_2.13']
.dependencies['com.fasterxml.jackson.datatype:jackson-datatype-jsr310'].version,
'2.9.8',
'correct version found');
});