Skip to content

Commit

Permalink
Merge branch 'main' into update/major
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone authored Jul 2, 2024
2 parents 91cb519 + ae22613 commit 7efe927
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
10 changes: 5 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -107,15 +107,15 @@ 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"

// 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,
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
30.16.2
30.17.1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 7efe927

Please sign in to comment.