From bcb22c0fc60f7ec6da810bb6336401d731089669 Mon Sep 17 00:00:00 2001 From: mrflick72 Date: Sat, 23 Nov 2024 23:22:00 +0100 Subject: [PATCH] docs --- README.md | 1 + docs/management.md | 15 +++++++++++++++ local-environment/application.yml | 5 ----- .../DatabaseTtlEntryCleanJob.kt | 4 ++-- .../DatabaseTtlEntryCleanJobEndPoint.kt | 2 +- .../DatabaseTtlEntryCleanJobTest.kt | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 docs/management.md rename src/main/kotlin/com/vauthenticator/server/{job => management}/DatabaseTtlEntryCleanJob.kt (96%) rename src/main/kotlin/com/vauthenticator/server/{job => management}/DatabaseTtlEntryCleanJobEndPoint.kt (91%) rename src/test/kotlin/com/vauthenticator/server/{job => management}/DatabaseTtlEntryCleanJobTest.kt (98%) diff --git a/README.md b/README.md index 606ce865..23114124 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Right now it is based, as said before to the latest version on spring oauth2/ope - Post login flow - force to reset password - back/front channel logout +- management api: custom actuator endpoint for more details [look here](local-environment%2Fmanagement.md) **Storage:** diff --git a/docs/management.md b/docs/management.md new file mode 100644 index 00000000..78045d53 --- /dev/null +++ b/docs/management.md @@ -0,0 +1,15 @@ +# Management + +Custom Actuator Endpoint + +## Clean Database Entry with TTL + +Actuator Clean Database enabled for database profile activated + +*URI:* ```Post /actuator/database-clean-up``` + +*Request:* Empty request body + +*Response Status:* ```204 NoContent``` + +``` \ No newline at end of file diff --git a/local-environment/application.yml b/local-environment/application.yml index cd69ae29..fe1a62dc 100644 --- a/local-environment/application.yml +++ b/local-environment/application.yml @@ -2,11 +2,6 @@ endSessionWithoutDiscovery: true oidcEndSessionUrl: ${vauthenticator.host}/oidc/logout auth.oidcIss: ${vauthenticator.host} -scheduled: - database-cleanup: - lock-ttl: 30000 - cron: "0 * * * * *" - event: consumer: enable: diff --git a/src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJob.kt b/src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJob.kt similarity index 96% rename from src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJob.kt rename to src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJob.kt index 9d535c5c..418157a2 100644 --- a/src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJob.kt +++ b/src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJob.kt @@ -1,4 +1,4 @@ -package com.vauthenticator.server.job +package com.vauthenticator.server.management import org.slf4j.LoggerFactory import org.springframework.context.annotation.Bean @@ -54,7 +54,7 @@ class DatabaseTtlEntryCleanJob( } -@Profile("!kms") +@Profile("database") @Configuration(proxyBeanMethods = false) class DatabaseTtlEntryCleanJobConfig() { diff --git a/src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobEndPoint.kt b/src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobEndPoint.kt similarity index 91% rename from src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobEndPoint.kt rename to src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobEndPoint.kt index 20104a4e..c0b846aa 100644 --- a/src/main/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobEndPoint.kt +++ b/src/main/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobEndPoint.kt @@ -1,4 +1,4 @@ -package com.vauthenticator.server.job +package com.vauthenticator.server.management import org.springframework.boot.actuate.endpoint.annotation.Endpoint import org.springframework.boot.actuate.endpoint.annotation.WriteOperation diff --git a/src/test/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobTest.kt b/src/test/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobTest.kt similarity index 98% rename from src/test/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobTest.kt rename to src/test/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobTest.kt index fa8e7a4a..7e7c49ed 100644 --- a/src/test/kotlin/com/vauthenticator/server/job/DatabaseTtlEntryCleanJobTest.kt +++ b/src/test/kotlin/com/vauthenticator/server/management/DatabaseTtlEntryCleanJobTest.kt @@ -1,4 +1,4 @@ -package com.vauthenticator.server.job +package com.vauthenticator.server.management import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.vauthenticator.server.keys.adapter.jdbc.JdbcKeyStorage