You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2024/12/09 09:51:51 UTC
(sling-org-apache-sling-auth-oauth-client) branch master updated: feat: make Redis support optional at runtime (#3)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-auth-oauth-client.git
The following commit(s) were added to refs/heads/master by this push:
new a420e50 feat: make Redis support optional at runtime (#3)
a420e50 is described below
commit a420e50ed2b4228a800fed83fae6784a297ac533
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Dec 9 10:51:45 2024 +0100
feat: make Redis support optional at runtime (#3)
The Redis persistence is only one variant, let's make it optional. I expect most users to start
with the JCR persistence.
---
README.md | 1 +
bnd.bnd | 3 +++
pom.xml | 4 +---
src/main/features/main.json | 20 ++++----------------
src/main/features/redis.json | 20 ++++++++++++++++++++
5 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/README.md b/README.md
index f0a2cf2..d64fa0d 100644
--- a/README.md
+++ b/README.md
@@ -135,6 +135,7 @@ Validated providers:
### Deployment
A set of dependencies required by this bundle, on top of the Sling Starter ones, is available at `src/main/features/main.json`.
+For the tokens to be stored in Redis ( see [#redis-storage] ) an additional feature with dependencies is found at `src/main/features/redis.json`.
Since the bundle relies on encryption to create and validate the OAuth 2.0 `state` parameter, a `CryptoService` must be configured
diff --git a/bnd.bnd b/bnd.bnd
new file mode 100644
index 0000000..e21fdd9
--- /dev/null
+++ b/bnd.bnd
@@ -0,0 +1,3 @@
+# Make Jedis imports optional, the bundle can work with JCR persistence only
+Import-Package: redis.clients.jedis;resolution:=optional, \
+ *;
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 6a7247f..aa38e37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,8 +68,6 @@
<extensions>true</extensions>
<configuration>
<skipAddFeatureDependencies>true</skipAddFeatureDependencies>
- <skipAddJarToFeature>false</skipAddJarToFeature>
- <jarStartOrder>25</jarStartOrder>
<framework>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
@@ -87,7 +85,7 @@
<aggregates>
<aggregate>
<classifier>app</classifier>
- <filesInclude>*.json</filesInclude>
+ <filesInclude>main.json</filesInclude>
<includeArtifact>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.starter</artifactId>
diff --git a/src/main/features/main.json b/src/main/features/main.json
index 637a790..387aedd 100644
--- a/src/main/features/main.json
+++ b/src/main/features/main.json
@@ -28,22 +28,6 @@
"id":"net.minidev:accessors-smart:2.5.1",
"start-order": 24
},
- {
- "id":"redis.clients:jedis:5.1.5",
- "start-order": 24
- },
- {
- "id": "org.apache.commons:commons-pool2:2.12.0",
- "start-order": 24
- },
- {
- "id": "com.google.code.gson:gson:2.11.0",
- "start-order": 24
- },
- {
- "id": "org.json:json:20231013",
- "start-order": 24
- },
{
"id": "org.apache.sling:org.apache.sling.commons.crypto:1.1.0",
"start-order": 24
@@ -51,6 +35,10 @@
{
"id": "org.apache.servicemix.bundles:org.apache.servicemix.bundles.jasypt:1.9.3_1",
"start-order": 24
+ },
+ {
+ "id": "${project.groupId}:${project.artifactId}:${project.version}",
+ "start-order": 25
}
]
}
\ No newline at end of file
diff --git a/src/main/features/redis.json b/src/main/features/redis.json
new file mode 100644
index 0000000..3931ab3
--- /dev/null
+++ b/src/main/features/redis.json
@@ -0,0 +1,20 @@
+{
+ "bundles": [
+ {
+ "id":"redis.clients:jedis:5.1.5",
+ "start-order": 24
+ },
+ {
+ "id": "org.apache.commons:commons-pool2:2.12.0",
+ "start-order": 24
+ },
+ {
+ "id": "com.google.code.gson:gson:2.11.0",
+ "start-order": 24
+ },
+ {
+ "id": "org.json:json:20231013",
+ "start-order": 24
+ }
+ ]
+}
\ No newline at end of file