From bbf73c434b1a8b43ba43b20eee521c41378d81d2 Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Tue, 15 Oct 2024 23:43:24 -0700 Subject: [PATCH 1/6] feat: add lock ldp --- .../org/openmbee/flexo/mms/Conditions.kt | 5 +++ .../org/openmbee/flexo/mms/routes/Locks.kt | 44 +++++++++++++++++++ .../flexo/mms/routes/ldp/LockWrite.kt | 1 + 3 files changed, 50 insertions(+) diff --git a/src/main/kotlin/org/openmbee/flexo/mms/Conditions.kt b/src/main/kotlin/org/openmbee/flexo/mms/Conditions.kt index 7a10640..badbfe2 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/Conditions.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/Conditions.kt @@ -150,6 +150,11 @@ val LOCK_CRUD_CONDITIONS = REPO_CRUD_CONDITIONS.append { } } +val LOCK_UPDATE_CONDITIONS = LOCK_CRUD_CONDITIONS.append { + // require that the user has the ability to update locks on a lock-level scope + permit(Permission.UPDATE_LOCK, Scope.LOCK) +} + enum class ConditionType { INSPECT, REQUIRE, diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt index 582a6a6..1e4bf22 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt @@ -1,6 +1,9 @@ package org.openmbee.flexo.mms.routes import io.ktor.server.routing.* +import org.openmbee.flexo.mms.LOCK_UPDATE_CONDITIONS +import org.openmbee.flexo.mms.guardedPatch +import org.openmbee.flexo.mms.reindent import org.openmbee.flexo.mms.routes.ldp.createOrReplaceLock import org.openmbee.flexo.mms.routes.ldp.deleteLock import org.openmbee.flexo.mms.routes.ldp.getLocks @@ -22,6 +25,16 @@ fun Route.crudLocks() { } } + // state of a lock + head { + headLocks(true) + } + + // get all locks + get { + getLocks(true) + } + // create new lock post { slug -> // set policy id on context @@ -30,6 +43,9 @@ fun Route.crudLocks() { // create new lock createOrReplaceLock() } + + // method not allowed + otherwiseNotAllowed("locks") } // specific lock @@ -57,9 +73,37 @@ fun Route.crudLocks() { createOrReplaceLock() } + // update lock metadata + patch { + // build conditions + val localConditions = LOCK_UPDATE_CONDITIONS.append { + // enforce preconditions if present + appendPreconditions { values -> + """ + graph m-graph:Cluster { + morl: mms:etag ?__mms_etag . + + ${values.reindent(6)} + } + """ + } + } + + // handle all varieties of accepted PATCH request formats + guardedPatch( + updateRequest = it, + objectKey = "morl", + graph = "m-graph:Cluster", + preconditions = localConditions, + ) + } + // delete a lock delete { deleteLock() } + + // method not allowed + otherwiseNotAllowed("lock") } } diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt index 8948466..9f7ed6a 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt @@ -6,6 +6,7 @@ import org.apache.jena.vocabulary.RDF import org.openmbee.flexo.mms.* import org.openmbee.flexo.mms.server.LdpDcLayer1Context import org.openmbee.flexo.mms.server.LdpMutateResponse +import org.openmbee.flexo.mms.server.LdpPatchResponse // require that the given lock does not exist (before attempting to create it) From bbcb58983f1de546aa5fc3f245627ee45a59a5bf Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Wed, 16 Oct 2024 07:50:13 -0700 Subject: [PATCH 2/6] fix: use metadata graph --- src/main/kotlin/org/openmbee/flexo/mms/General.kt | 14 ++++++++++++++ .../org/openmbee/flexo/mms/routes/Branches.kt | 14 +++++++++++++- .../kotlin/org/openmbee/flexo/mms/routes/Locks.kt | 4 ++-- .../org/openmbee/flexo/mms/routes/ldp/LockWrite.kt | 2 +- .../kotlin/org/openmbee/flexo/mms/LockLdpDc.kt | 4 +++- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 src/main/kotlin/org/openmbee/flexo/mms/General.kt diff --git a/src/main/kotlin/org/openmbee/flexo/mms/General.kt b/src/main/kotlin/org/openmbee/flexo/mms/General.kt new file mode 100644 index 0000000..744c9dd --- /dev/null +++ b/src/main/kotlin/org/openmbee/flexo/mms/General.kt @@ -0,0 +1,14 @@ +package org.openmbee.flexo.mms + +import io.ktor.http.* +import io.ktor.server.response.* +import org.openmbee.flexo.mms.server.GenericResponse +import org.openmbee.flexo.mms.server.LdpDcLayer1Context + +suspend fun LdpDcLayer1Context.notImplemented() { + call.respondText( + "That operation is not yet implemented", + ContentType.Text.Plain, + HttpStatusCode.NotImplemented + ) +} diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/Branches.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/Branches.kt index e450271..27f6246 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/Branches.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/Branches.kt @@ -3,6 +3,7 @@ package org.openmbee.flexo.mms.routes import io.ktor.server.routing.* import org.openmbee.flexo.mms.BRANCH_UPDATE_CONDITIONS import org.openmbee.flexo.mms.guardedPatch +import org.openmbee.flexo.mms.notImplemented import org.openmbee.flexo.mms.routes.ldp.createBranch import org.openmbee.flexo.mms.routes.ldp.getBranches import org.openmbee.flexo.mms.routes.ldp.headBranches @@ -44,6 +45,9 @@ fun Route.crudBranches() { // create new branch createBranch(usedPost=true) } + + // method not allowed + otherwiseNotAllowed() } // specific branch @@ -80,5 +84,13 @@ fun Route.crudBranches() { preconditions = BRANCH_UPDATE_CONDITIONS, ) } + + // delete not yet implemented + delete { + notImplemented() + } + + // method not allowed + otherwiseNotAllowed() } -} \ No newline at end of file +} diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt index 1e4bf22..303af20 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt @@ -80,7 +80,7 @@ fun Route.crudLocks() { // enforce preconditions if present appendPreconditions { values -> """ - graph m-graph:Cluster { + graph mor-graph:Metadata { morl: mms:etag ?__mms_etag . ${values.reindent(6)} @@ -93,7 +93,7 @@ fun Route.crudLocks() { guardedPatch( updateRequest = it, objectKey = "morl", - graph = "m-graph:Cluster", + graph = "mor-graph:Metadata", preconditions = localConditions, ) } diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt index 9f7ed6a..45ac308 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/ldp/LockWrite.kt @@ -181,7 +181,7 @@ suspend fun LdpDcLayer1Context Date: Thu, 17 Oct 2024 14:31:25 -0700 Subject: [PATCH 3/6] fix: add test cases for locks --- deploy/src/main.ts | 17 ++++--- .../org/openmbee/flexo/mms/Namespaces.kt | 20 ++++++-- .../org/openmbee/flexo/mms/BranchUpdate.kt | 35 ++++++++++++- .../kotlin/org/openmbee/flexo/mms/LockAny.kt | 4 +- .../kotlin/org/openmbee/flexo/mms/LockRead.kt | 50 +++++++++++++++++++ .../org/openmbee/flexo/mms/LockWrite.kt | 24 +++++++++ 6 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt diff --git a/deploy/src/main.ts b/deploy/src/main.ts index 31b9ee4..41300bd 100644 --- a/deploy/src/main.ts +++ b/deploy/src/main.ts @@ -427,6 +427,13 @@ ds_writer.write({ Repo: { crud: { ...H_CRUD_DEFAULT, + Update: { + implies: [ + 'ReadRepo', + 'UpdateBranch', // PATCH for updating repo metadata + 'UpdateLock', // PATCH for updating repo metadata + ], + }, Delete: { implies: [ 'UpdateRepo', @@ -446,13 +453,7 @@ ds_writer.write({ }, Lock: { - crud: { - Create: {}, - Read: {}, - Delete: { - implies: ['ReadLock'], - }, - }, + crud: H_CRUD_DEFAULT, }, AccessControlAny: { @@ -521,4 +522,4 @@ ds_writer.write({ }), }, }, -}) \ No newline at end of file +}) diff --git a/src/main/kotlin/org/openmbee/flexo/mms/Namespaces.kt b/src/main/kotlin/org/openmbee/flexo/mms/Namespaces.kt index 35286d6..66b3213 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/Namespaces.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/Namespaces.kt @@ -156,6 +156,9 @@ fun prefixesFor( ) } } + else { + add("morl" to MMS_URNS.never) + } if(null !== diffId) { with("$this/diffs/$diffId") { @@ -164,6 +167,9 @@ fun prefixesFor( ) } } + else { + add("morl" to MMS_URNS.never) + } if(null != lockId) { with("$this/locks/$lockId") { @@ -172,6 +178,9 @@ fun prefixesFor( ) } } + else { + add("morl" to MMS_URNS.never) + } if(null != commitId) { with("$this/commits/$commitId") { @@ -181,6 +190,9 @@ fun prefixesFor( ) } } + else { + add("morl" to MMS_URNS.never) + } } } } @@ -202,7 +214,7 @@ fun prefixesFor( object MMS { private val BASE = SPARQL_PREFIXES["mms"]!! val uri = BASE - + private fun res(id: String): Resource { return ResourceFactory.createResource("${BASE}${id}") } @@ -234,7 +246,7 @@ object MMS { // object properties val id = ResourceFactory.createProperty(BASE, "id") - + private fun prop(id: String): Property { return ResourceFactory.createProperty(BASE, id) } @@ -343,6 +355,8 @@ object MMS_OBJECT { object MMS_URNS { private val mms = "urn:mms" + val never = "$mms:never" + object SUBJECT { val aggregator = "$mms:aggregator" val auth = "$mms:auth" @@ -354,4 +368,4 @@ object MMS_URNS { val pass = "$mms:pass" val policy = "$mms:policy" } -} \ No newline at end of file +} diff --git a/src/test/kotlin/org/openmbee/flexo/mms/BranchUpdate.kt b/src/test/kotlin/org/openmbee/flexo/mms/BranchUpdate.kt index 01fd619..ae85ccc 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/BranchUpdate.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/BranchUpdate.kt @@ -1,6 +1,7 @@ package org.openmbee.flexo.mms +import io.ktor.http.* import org.apache.jena.sparql.vocabulary.FOAF import org.apache.jena.vocabulary.DCTerms import org.apache.jena.vocabulary.RDF @@ -13,14 +14,18 @@ class BranchUpdate : RefAny() { withTest { httpPatch(demoBranchPath) { - setSparqlUpdateBody(withAllTestPrefixes(""" + setSparqlUpdateBody( + withAllTestPrefixes( + """ insert { <> foaf:homepage . } where { <> dct:title "$demoBranchName"@en . } - """.trimIndent())) + """.trimIndent() + ) + ) }.apply { response includesTriples { subject(localIri(demoBranchPath)) { @@ -35,5 +40,31 @@ class BranchUpdate : RefAny() { } } } + + "all branches rejects other methods" { + createBranch(demoRepoPath, "master", demoBranchId, demoBranchName) + + withTest { + onlyAllowsMethods("$demoRepoPath/branches", setOf( + HttpMethod.Head, + HttpMethod.Get, + HttpMethod.Post, + )) + } + } + + "branch rejects other methods" { + createBranch(demoRepoPath, "master", demoBranchId, demoBranchName) + + withTest { + onlyAllowsMethods(demoBranchPath, setOf( + HttpMethod.Head, + HttpMethod.Get, + HttpMethod.Put, + HttpMethod.Patch, + HttpMethod.Delete, + )) + } + } } } diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt index 7d115ea..3d2acb2 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt @@ -11,13 +11,13 @@ import org.openmbee.flexo.mms.util.startsWith import org.slf4j.LoggerFactory // validates response triples for a lock -fun TriplesAsserter.validateLockTriples(lockId: String, etag: String) { +fun TriplesAsserter.validateLockTriples(lockId: String, etag: String?=null) { // lock triples subjectTerse("mor-lock:$lockId") { exclusivelyHas( RDF.type exactly MMS.Lock, MMS.id exactly lockId, - MMS.etag exactly etag, + if(etag != null) MMS.etag exactly etag else MMS.etag startsWith "", MMS.commit startsWith model.expandPrefix("mor-commit:").iri, MMS.snapshot startsWith model.expandPrefix("mor-snapshot:Model.").iri, MMS.createdBy exactly model.expandPrefix("mu:").iri, diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt index ddb0fcb..b29cd2e 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt @@ -1,6 +1,7 @@ package org.openmbee.flexo.mms +import io.kotest.matchers.shouldBe import io.ktor.http.* import org.openmbee.flexo.mms.util.* @@ -9,6 +10,8 @@ class LockRead : LockAny() { listOf( "head", "get", + "patch", + "delete", ).forEach { method -> "$method non-existent lock" { withTest { @@ -25,6 +28,7 @@ class LockRead : LockAny() { withTest { httpHead(demoLockPath) {}.apply { response shouldHaveStatus HttpStatusCode.NoContent + response.content.shouldBe(null) } } } @@ -41,5 +45,51 @@ class LockRead : LockAny() { } } } + + "lock other methods not allowed" { + withTest { + onlyAllowsMethods(demoLockPath, setOf( + HttpMethod.Head, + HttpMethod.Get, + HttpMethod.Put, + HttpMethod.Patch, + HttpMethod.Delete, + )) + } + } + + "head all locks" { + createLock(demoRepoPath, masterBranchPath, demoLockId) + + withTest { + httpHead("$demoRepoPath/locks") {}.apply { + response shouldHaveStatus HttpStatusCode.NoContent + response.content.shouldBe(null) + } + } + } + + "get all locks" { + createLock(demoRepoPath, masterBranchPath, demoLockId) + + withTest { + httpGet("$demoRepoPath/locks") {}.apply { + response shouldHaveStatus HttpStatusCode.OK + response includesTriples { + validateLockTriples(demoLockId) + } + } + } + } + + "all locks other methods not allowed" { + withTest { + onlyAllowsMethods("$demoRepoPath/locks", setOf( + HttpMethod.Head, + HttpMethod.Get, + HttpMethod.Post, + )) + } + } } } diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt new file mode 100644 index 0000000..abf4408 --- /dev/null +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt @@ -0,0 +1,24 @@ +package org.openmbee.flexo.mms + +import io.kotest.matchers.shouldBe +import io.ktor.http.* +import org.openmbee.flexo.mms.util.* + + +class LockWrite : LockAny() { + init { + "patch lock" { + createLock(demoRepoPath, masterBranchPath, demoLockId) + + withTest { + httpPatch(demoLockPath) { + setTurtleBody(withAllTestPrefixes(""" + <> rdfs:comment "foo" . + """.trimIndent())) + }.apply { + response shouldHaveStatus HttpStatusCode.OK + } + } + } + } +} From bfd33daebff1cad13da36e59c3a76b243c947f0b Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Tue, 22 Oct 2024 14:01:31 -0700 Subject: [PATCH 4/6] tests: patch lock --- .../kotlin/org/openmbee/flexo/mms/LockAny.kt | 12 ++++--- .../org/openmbee/flexo/mms/LockWrite.kt | 34 +++++++++++++++++-- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt index 3d2acb2..c3648cb 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockAny.kt @@ -4,14 +4,15 @@ import io.kotest.matchers.string.shouldNotBeBlank import io.ktor.http.* import io.ktor.server.testing.* import org.apache.jena.vocabulary.RDF -import org.openmbee.flexo.mms.util.TriplesAsserter -import org.openmbee.flexo.mms.util.exactly -import org.openmbee.flexo.mms.util.iri -import org.openmbee.flexo.mms.util.startsWith +import org.openmbee.flexo.mms.util.* import org.slf4j.LoggerFactory // validates response triples for a lock -fun TriplesAsserter.validateLockTriples(lockId: String, etag: String?=null) { +fun TriplesAsserter.validateLockTriples( + lockId: String, + etag: String?=null, + extraPatterns: List = listOf() +) { // lock triples subjectTerse("mor-lock:$lockId") { exclusivelyHas( @@ -21,6 +22,7 @@ fun TriplesAsserter.validateLockTriples(lockId: String, etag: String?=null) { MMS.commit startsWith model.expandPrefix("mor-commit:").iri, MMS.snapshot startsWith model.expandPrefix("mor-snapshot:Model.").iri, MMS.createdBy exactly model.expandPrefix("mu:").iri, + *extraPatterns.toTypedArray(), ) } } diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt index abf4408..b9e0878 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockWrite.kt @@ -1,22 +1,50 @@ package org.openmbee.flexo.mms -import io.kotest.matchers.shouldBe import io.ktor.http.* +import org.apache.jena.vocabulary.DCTerms import org.openmbee.flexo.mms.util.* class LockWrite : LockAny() { init { - "patch lock" { + "patch lock with TTL" { createLock(demoRepoPath, masterBranchPath, demoLockId) withTest { httpPatch(demoLockPath) { setTurtleBody(withAllTestPrefixes(""" - <> rdfs:comment "foo" . + <> dct:description "foo" . """.trimIndent())) }.apply { response shouldHaveStatus HttpStatusCode.OK + + response includesTriples { + validateLockTriples(demoLockId, null, listOf( + DCTerms.description exactly "foo" + )) + } + } + } + } + + "patch lock with SPARQL UPDATE" { + createLock(demoRepoPath, masterBranchPath, demoLockId) + + withTest { + httpPatch(demoLockPath) { + setSparqlUpdateBody(withAllTestPrefixes(""" + insert data { + <> dct:description "foo" . + } + """.trimIndent())) + }.apply { + response shouldHaveStatus HttpStatusCode.OK + + response includesTriples { + validateLockTriples(demoLockId, null, listOf( + DCTerms.description exactly "foo" + )) + } } } } From 98c6c7269520d6d57ccc4e7f42549d9ba86cc4e8 Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Wed, 30 Oct 2024 16:52:21 -0700 Subject: [PATCH 5/6] fix: patch non-existent lock test --- src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt index b29cd2e..bcc2f14 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt @@ -3,6 +3,7 @@ package org.openmbee.flexo.mms import io.kotest.matchers.shouldBe import io.ktor.http.* +import io.ktor.server.request.* import org.openmbee.flexo.mms.util.* class LockRead : LockAny() { @@ -15,7 +16,12 @@ class LockRead : LockAny() { ).forEach { method -> "$method non-existent lock" { withTest { - httpRequest(HttpMethod(method.uppercase()), demoLockPath) {}.apply { + httpRequest(HttpMethod(method.uppercase()), demoLockPath) { + // PATCH request + if(method == "patch") { + addHeader("Content-Type", RdfContentTypes.Turtle.toString()) + } + }.apply { response shouldHaveStatus HttpStatusCode.NotFound } } From c94090ab3a06853094f16f562ff3449723a16e04 Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Wed, 30 Oct 2024 17:37:58 -0700 Subject: [PATCH 6/6] fix: make delete lock throw not implemented --- src/main/kotlin/org/openmbee/flexo/mms/Errors.kt | 4 ++++ src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt | 4 +++- src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/org/openmbee/flexo/mms/Errors.kt b/src/main/kotlin/org/openmbee/flexo/mms/Errors.kt index f4956bf..64c4549 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/Errors.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/Errors.kt @@ -81,3 +81,7 @@ open class Http500Excpetion(msg: String): HttpException(msg, HttpStatusCode.Inte class ServerBugException(msg: String?=null): Http500Excpetion("Possible server implementation bug: ${msg?: "(no description)"}") + +open class Http501Exception(msg: String): HttpException(msg, HttpStatusCode.NotImplemented) + +class NotImplementedException(msg: String): Http501Exception("That action is not yet implemented. $msg") diff --git a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt index 303af20..2a42a46 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/routes/Locks.kt @@ -2,6 +2,7 @@ package org.openmbee.flexo.mms.routes import io.ktor.server.routing.* import org.openmbee.flexo.mms.LOCK_UPDATE_CONDITIONS +import org.openmbee.flexo.mms.NotImplementedException import org.openmbee.flexo.mms.guardedPatch import org.openmbee.flexo.mms.reindent import org.openmbee.flexo.mms.routes.ldp.createOrReplaceLock @@ -100,7 +101,8 @@ fun Route.crudLocks() { // delete a lock delete { - deleteLock() +// deleteLock() + throw NotImplementedException("DELETE Lock") } // method not allowed diff --git a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt index bcc2f14..abb718f 100644 --- a/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt +++ b/src/test/kotlin/org/openmbee/flexo/mms/LockRead.kt @@ -12,7 +12,7 @@ class LockRead : LockAny() { "head", "get", "patch", - "delete", +// "delete", ).forEach { method -> "$method non-existent lock" { withTest {