diff --git a/CHANGELOG.md b/CHANGELOG.md index cdae215dbe..4aa09643ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [30.17.1](https://github.com/dasch-swiss/dsp-api/compare/v30.17.0...v30.17.1) (2024-07-01) + + +### Bug Fixes + +* The GroupIri should allow "knora-admin:" prefixed iris and expand it ([#3301](https://github.com/dasch-swiss/dsp-api/issues/3301)) ([9a91759](https://github.com/dasch-swiss/dsp-api/commit/9a917592c7e1655d8cca642e1df26e5bc14c0fe2)) + +## [30.17.0](https://github.com/dasch-swiss/dsp-api/compare/v30.16.2...v30.17.0) (2024-06-28) + + +### Maintenance + +* Add IRI to error message when a Group IRI is invalid. ([#3296](https://github.com/dasch-swiss/dsp-api/issues/3296)) ([923a7b0](https://github.com/dasch-swiss/dsp-api/commit/923a7b01e035b791d4f37baa5e348d3510ffc588)) + + +### Enhancements + +* Add 'keepAssets' query param to erase project endpoint ([#3294](https://github.com/dasch-swiss/dsp-api/issues/3294)) ([23292ff](https://github.com/dasch-swiss/dsp-api/commit/23292ffb9d41cf500396abb466552ea5dd57fdc8)) + + +### Bug Fixes + +* Smaller granularity for Grafana fuseki durations (DEV-3776) ([#3297](https://github.com/dasch-swiss/dsp-api/issues/3297)) ([a53fe34](https://github.com/dasch-swiss/dsp-api/commit/a53fe34c2cc605f34b9361cb8c95ca1d68906eff)) + ## [30.16.2](https://github.com/dasch-swiss/dsp-api/compare/v30.16.1...v30.16.2) (2024-06-24) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index e18a62fcd0..82cd64faee 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -18,7 +18,7 @@ object Dependencies { val ScalaVersion = "3.3.3" - val PekkoActorVersion = "1.0.2" + val PekkoActorVersion = "1.0.3" val PekkoHttpVersion = "1.0.1" val JenaVersion = "5.0.0" val Rdf4jVersion = "5.0.0" @@ -29,7 +29,7 @@ object Dependencies { val ZioMetricsConnectorsVersion = "2.3.1" val ZioPreludeVersion = "1.0.0-RC27" val ZioSchemaVersion = "0.2.0" - val ZioVersion = "2.1.3" + val ZioVersion = "2.1.5" // ZIO val zio = "dev.zio" %% "zio" % ZioVersion @@ -80,7 +80,7 @@ object Dependencies { val jwtSprayJson = "com.github.jwt-scala" %% "jwt-zio-json" % "10.0.1" // jwtSprayJson -> 9.0.2 is the latest version that's compatible with spray-json; if it wasn't for spray, this would be Scala 3 compatible val springSecurityCore = - "org.springframework.security" % "spring-security-core" % "6.3.0" exclude ( + "org.springframework.security" % "spring-security-core" % "6.3.1" exclude ( "commons-logging", "commons-logging", ) exclude ("org.springframework", "spring-aop") @@ -107,7 +107,7 @@ object Dependencies { val pekkoHttpTestkit = "org.apache.pekko" %% "pekko-http-testkit" % PekkoHttpVersion val pekkoStreamTestkit = "org.apache.pekko" %% "pekko-stream-testkit" % PekkoActorVersion val pekkoTestkit = "org.apache.pekko" %% "pekko-testkit" % PekkoActorVersion - val scalaTest = "org.scalatest" %% "scalatest" % "3.2.18" + val scalaTest = "org.scalatest" %% "scalatest" % "3.2.19" val testcontainers = "org.testcontainers" % "testcontainers" % "1.19.8" val wiremock = "org.wiremock" % "wiremock" % "3.6.0" @@ -115,7 +115,7 @@ object Dependencies { // found/added by the plugin but deleted anyway val commonsLang3 = "org.apache.commons" % "commons-lang3" % "3.14.0" - val tapirVersion = "1.10.9" + val tapirVersion = "1.10.10" val tapir = Seq( "com.softwaremill.sttp.tapir" %% "tapir-pekko-http-server" % tapirVersion, diff --git a/project/plugins.sbt b/project/plugins.sbt index 23edfd3f1d..eafb72441f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,7 @@ resolvers ++= Seq( addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0") addSbtPlugin("io.kamon" % "sbt-aspectj-runner" % "1.1.2") -addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.5") +addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.7") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0") addSbtPlugin("com.github.sbt" % "sbt-javaagent" % "0.1.8") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12") diff --git a/version.txt b/version.txt index 07583dce84..d02ab0f54c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -30.16.2 +30.17.1 diff --git a/webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraGroup.scala b/webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraGroup.scala index 0ecdc83cdd..d74e085c78 100644 --- a/webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraGroup.scala +++ b/webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraGroup.scala @@ -103,9 +103,10 @@ object GroupIri extends StringValueCompanion[GroupIri] { private def isBuiltInGroupIri(iri: String): Boolean = BuiltInGroups.contains(iri) def from(value: String): Either[String, GroupIri] = value match { - case _ if value.isEmpty => Left("Group IRI cannot be empty.") - case _ if isGroupIriValid(value) => Right(GroupIri(value)) - case v => Left(s"Group IRI is invalid: $v") + case _ if value.isEmpty => Left("Group IRI cannot be empty.") + case _ if value.startsWith("knora-admin:") => from(value.replace("knora-admin:", KnoraAdminPrefixExpansion)) + case _ if isGroupIriValid(value) => Right(GroupIri(value)) + case v => Left(s"Group IRI is invalid: $v") } /** diff --git a/webapi/src/test/scala/org/knora/webapi/slice/admin/domain/model/GroupIriSpec.scala b/webapi/src/test/scala/org/knora/webapi/slice/admin/domain/model/GroupIriSpec.scala index 1e145981a3..b8100713c8 100644 --- a/webapi/src/test/scala/org/knora/webapi/slice/admin/domain/model/GroupIriSpec.scala +++ b/webapi/src/test/scala/org/knora/webapi/slice/admin/domain/model/GroupIriSpec.scala @@ -5,17 +5,27 @@ package org.knora.webapi.slice.admin.domain.model +import zio.Chunk import zio.test.Gen import zio.test.Spec import zio.test.ZIOSpecDefault import zio.test.assertTrue import zio.test.check +import org.knora.webapi.messages.OntologyConstants.KnoraAdmin.KnoraAdminPrefixExpansion + object GroupIriSpec extends ZIOSpecDefault { override val spec: Spec[Any, Nothing] = suite("GroupIri should")( test("not be created from an empty value") { assertTrue(GroupIri.from("") == Left("Group IRI cannot be empty.")) }, + test("allow prefixed builtin GroupIris") { + val builtIn = Chunk("UnknownUser", "KnownUser", "Creator", "ProjectMember", "ProjectAdmin", "SystemAdmin") + .map("knora-admin:" + _) + check(Gen.fromIterable(builtIn)) { it => + assertTrue(GroupIri.from(it).map(_.value) == Right(it.replace("knora-admin:", KnoraAdminPrefixExpansion))) + } + }, test("be created from a valid value") { val validIris = Gen.fromIterable( Seq(