Skip to content

Commit c43fb2c

Browse files
authored
chore(cloud-native)!: remove spanner support from OCI images (#1881)
Signed-off-by: iromli <[email protected]>
1 parent 8ed3adf commit c43fb2c

File tree

6 files changed

+22
-76
lines changed

6 files changed

+22
-76
lines changed

docker-admin-ui/Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ EXPOSE 8080
2020
# Assets sync
2121
# ===========
2222

23-
ENV JANS_SOURCE_VERSION=d84d8935eaeb252da8f442f4679bedb45c514aa7
23+
ENV JANS_SOURCE_VERSION=6e00e723a99d700a4f82713b0c25b2d6e3ef5775
2424
ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup
2525

2626
# note that as we're pulling from a monorepo (with multiple project in it)
@@ -39,12 +39,11 @@ RUN cd /tmp/jans \
3939
&& cp -R ${JANS_SETUP_DIR}/static/rdbm/sql_data_types.json /app/static/rdbm/ \
4040
&& cp -R ${JANS_SETUP_DIR}/static/rdbm/ldap_sql_data_type_mapping.json /app/static/rdbm/ \
4141
&& cp -R ${JANS_SETUP_DIR}/static/rdbm/opendj_attributes_syntax.json /app/static/rdbm/ \
42-
&& cp -R ${JANS_SETUP_DIR}/static/rdbm/sub_tables.json /app/static/rdbm/ \
4342
&& cp ${JANS_SETUP_DIR}/schema/jans_schema.json /app/schema/ \
4443
&& cp ${JANS_SETUP_DIR}/schema/custom_schema.json /app/schema/ \
4544
&& cp ${JANS_SETUP_DIR}/schema/opendj_types.json /app/schema/
4645

47-
ENV FLEX_SOURCE_VERSION=b9628dc3e63e093e0ac0a5dd7e9295251587ac3d
46+
ENV FLEX_SOURCE_VERSION=55e028960e7548c751387e149eab7774f16c09aa
4847

4948
RUN mkdir -p /app/templates/admin-ui
5049

@@ -148,9 +147,7 @@ ENV CN_PERSISTENCE_TYPE=sql \
148147
CN_COUCHBASE_BUCKET_PREFIX=jans \
149148
CN_COUCHBASE_TRUSTSTORE_ENABLE=true \
150149
CN_COUCHBASE_KEEPALIVE_INTERVAL=30000 \
151-
CN_COUCHBASE_KEEPALIVE_TIMEOUT=2500 \
152-
CN_GOOGLE_SPANNER_INSTANCE_ID="" \
153-
CN_GOOGLE_SPANNER_DATABASE_ID=""
150+
CN_COUCHBASE_KEEPALIVE_TIMEOUT=2500
154151

155152
# ===========
156153
# Generic ENV

docker-admin-ui/README.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following environment variables are supported by the container:
6363
- `CN_TOKEN_SERVER_USERINFO_ENDPOINT`: User info endpoint at token server (default to `/jans-auth/restv1/userinfo`).
6464
- `CN_TOKEN_SERVER_CLIENT_ID`: Client ID registered at token server.
6565
- `CN_TOKEN_SERVER_CERT_FILE`: Path to token server certificate (default to `/etc/certs/token_server.crt`).
66-
- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `sql`, `spanner`, `couchbase`, or `hybrid`; default to `sql`).
66+
- `CN_PERSISTENCE_TYPE`: Persistence backend being used (one of `sql`, `couchbase`, or `hybrid`; default to `sql`).
6767
- `CN_HYBRID_MAPPING`: Specify data mapping for each persistence (default to `"{}"`). Note this environment only takes effect when `CN_PERSISTENCE_TYPE` is set to `hybrid`. See [hybrid mapping](#hybrid-mapping) section for details.
6868
- `CN_COUCHBASE_URL`: Address of Couchbase server (default to `localhost`).
6969
- `CN_COUCHBASE_USER`: Username of Couchbase server (default to `admin`).
@@ -81,12 +81,8 @@ The following environment variables are supported by the container:
8181
- `CN_SQL_DB_PORT`: Port of SQL backend (default to `3306`).
8282
- `CN_SQL_DB_NAME`: Database name (default to `jans`)
8383
- `CN_SQL_DB_USER`: Username to interact with SQL backend (default to `jans`).
84-
- `CN_GOOGLE_SPANNER_INSTANCE_ID`: Instance ID of Google Spanner (default to empty string).
85-
- `CN_GOOGLE_SPANNER_DATABASE_ID`: Database ID of Google Spanner (default to empty string).
8684
- `GOOGLE_PROJECT_ID`: Google Project ID (default to empty string).
8785
- `GOOGLE_PROJECT_ID`: Google Project ID (default to empty string). Used when `CN_CONFIG_ADAPTER` or `CN_SECRET_ADAPTER` set to `google`.
88-
- `CN_GOOGLE_SPANNER_INSTANCE_ID`: Google Spanner instance ID.
89-
- `CN_GOOGLE_SPANNER_DATABASE_ID`: Google Spanner database ID.
9086
- `GLUU_ADMIN_UI_AUTH_METHOD`: Authentication method for admin-ui (default to `basic`). Note, changing the value require restart to jans-config-api.
9187

9288
### Hybrid mapping
@@ -99,12 +95,12 @@ Hybrid persistence supports all available persistence types. To configure hybrid
9995

10096
```
10197
{
102-
"default": "<couchbase|spanner|sql>",
103-
"user": "<couchbase|spanner|sql>",
104-
"site": "<couchbase|spanner|sql>",
105-
"cache": "<couchbase|spanner|sql>",
106-
"token": "<couchbase|spanner|sql>",
107-
"session": "<couchbase|spanner|sql>",
98+
"default": "<couchbase|sql>",
99+
"user": "<couchbase|sql>",
100+
"site": "<couchbase|sql>",
101+
"cache": "<couchbase|sql>",
102+
"token": "<couchbase|sql>",
103+
"session": "<couchbase|sql>",
108104
}
109105
```
110106
@@ -113,10 +109,10 @@ Hybrid persistence supports all available persistence types. To configure hybrid
113109
```
114110
{
115111
"default": "sql",
116-
"user": "spanner",
112+
"user": "sql",
117113
"site": "sql",
118114
"cache": "sql",
119115
"token": "couchbase",
120-
"session": "spanner",
116+
"session": "sql",
121117
}
122118
```

docker-admin-ui/scripts/bootstrap.py

+6-31
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from jans.pycloudlib.persistence.couchbase import CouchbaseClient
1010
from jans.pycloudlib.persistence.couchbase import id_from_dn
1111
from jans.pycloudlib.persistence.couchbase import sync_couchbase_password
12-
from jans.pycloudlib.persistence.spanner import SpannerClient
13-
from jans.pycloudlib.persistence.spanner import sync_google_credentials
1412
from jans.pycloudlib.persistence.sql import doc_id_from_dn
1513
from jans.pycloudlib.persistence.sql import SqlClient
1614
from jans.pycloudlib.persistence.sql import sync_sql_password
@@ -36,9 +34,6 @@ def main():
3634
if "sql" in persistence_groups:
3735
sync_sql_password(manager)
3836

39-
if "spanner" in persistence_groups:
40-
sync_google_credentials(manager)
41-
4237
wait_for_persistence(manager)
4338

4439
render_env_config(manager)
@@ -65,7 +60,6 @@ def __init__(self, manager):
6560

6661
client_classes = {
6762
"couchbase": CouchbaseClient,
68-
"spanner": SpannerClient,
6963
"sql": SqlClient,
7064
}
7165

@@ -175,7 +169,7 @@ def save_config(self):
175169

176170
dn = "ou=admin-ui,ou=configuration,o=jans"
177171

178-
if self.persistence_type in ("sql", "spanner"):
172+
if self.persistence_type == "sql":
179173
dn = doc_id_from_dn(dn)
180174
table_name = "jansAppConf"
181175

@@ -212,30 +206,6 @@ def save_config(self):
212206
rev = entry["jansRevision"] + 1
213207
self.client.exec_query(f"UPDATE {bucket} USE KEYS '{dn}' SET jansConfApp={json.dumps(merged_conf)}, jansRevision={rev}") # nosec: B608
214208

215-
else:
216-
entry = self.client.get(dn)
217-
attrs = entry.entry_attributes_as_dict
218-
219-
try:
220-
conf = attrs.get("jansConfApp", [])[0]
221-
except IndexError:
222-
conf = "{}"
223-
224-
should_update, merged_conf = resolve_conf_app(
225-
json.loads(conf),
226-
json.loads(conf_from_file),
227-
)
228-
229-
if should_update:
230-
logger.info("Updating admin-ui config app")
231-
self.client.modify(
232-
dn,
233-
{
234-
"jansRevision": [(self.client.MODIFY_REPLACE, attrs["jansRevision"][0] + 1)],
235-
"jansConfApp": [(self.client.MODIFY_REPLACE, json.dumps(merged_conf))],
236-
}
237-
)
238-
239209

240210
def resolve_conf_app(old_conf, new_conf):
241211
should_update = False
@@ -315,6 +285,11 @@ def resolve_conf_app(old_conf, new_conf):
315285
old_conf["oidcConfig"]["auiBackendApiClient"][endpoint] = new_conf["oidcConfig"]["auiBackendApiClient"][endpoint]
316286
should_update = True
317287

288+
# add missing config under uiConfig
289+
if "allowSmtpKeystoreEdit" not in old_conf["uiConfig"]:
290+
old_conf["uiConfig"]["allowSmtpKeystoreEdit"] = True
291+
should_update = True
292+
318293
# finalized status and conf
319294
return should_update, old_conf
320295

docker-admin-ui/scripts/upgrade.py

+2-24
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from jans.pycloudlib import get_manager
77
from jans.pycloudlib.persistence import CouchbaseClient
8-
from jans.pycloudlib.persistence import SpannerClient
98
from jans.pycloudlib.persistence import SqlClient
109
from jans.pycloudlib.persistence import PersistenceMapper
1110
from jans.pycloudlib.persistence import doc_id_from_dn
@@ -90,30 +89,9 @@ def modify_entry(self, key, attrs=None, **kwargs):
9089
return status, message
9190

9291

93-
class SpannerBackend:
94-
def __init__(self, manager):
95-
self.manager = manager
96-
self.client = SpannerClient(manager)
97-
self.type = "spanner"
98-
99-
def get_entry(self, key, filter_="", attrs=None, **kwargs):
100-
table_name = kwargs.get("table_name")
101-
entry = self.client.get(table_name, key, attrs)
102-
103-
if not entry:
104-
return None
105-
return Entry(key, entry)
106-
107-
def modify_entry(self, key, attrs=None, **kwargs):
108-
attrs = attrs or {}
109-
table_name = kwargs.get("table_name")
110-
return self.client.update(table_name, key, attrs), ""
111-
112-
11392
BACKEND_CLASSES = {
11493
"sql": SQLBackend,
11594
"couchbase": CouchbaseBackend,
116-
"spanner": SpannerBackend,
11795
}
11896

11997

@@ -136,7 +114,7 @@ def update_web_client(self):
136114
client_id = self.manager.config.get("admin_ui_client_id")
137115
id_ = f"inum={client_id},ou=clients,o=jans"
138116

139-
if self.backend.type in ("sql", "spanner"):
117+
if self.backend.type == "sql":
140118
kwargs = {"table_name": "jansClnt"}
141119
id_ = doc_id_from_dn(id_)
142120
elif self.backend.type == "couchbase":
@@ -214,7 +192,7 @@ def update_backend_client(self):
214192
client_id = self.manager.config.get("token_server_admin_ui_client_id")
215193
id_ = f"inum={client_id},ou=clients,o=jans"
216194

217-
if self.backend.type in ("sql", "spanner"):
195+
if self.backend.type == "sql":
218196
kwargs = {"table_name": "jansClnt"}
219197
id_ = doc_id_from_dn(id_)
220198
elif self.backend.type == "couchbase":

docker-flex-all-in-one/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RUN ln -sf /app/flex_aio/admin_ui/entrypoint.sh /app/bin/admin-ui-entrypoint.sh
6666
# Assets sync
6767
# ===========
6868

69-
ENV JANS_SOURCE_VERSION=d84d8935eaeb252da8f442f4679bedb45c514aa7
69+
ENV JANS_SOURCE_VERSION=6e00e723a99d700a4f82713b0c25b2d6e3ef5775
7070

7171
# note that as we're pulling from a monorepo (with multiple project in it)
7272
# we are using partial-clone and sparse-checkout to get the assets

docker-flex-monolith/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ EXPOSE 443 8080 1636
4242
# flex-linux-setup
4343
# =====================
4444

45-
ENV FLEX_SOURCE_VERSION=969158f9b757291e826cd230db5372cb73918af7
45+
ENV FLEX_SOURCE_VERSION=55e028960e7548c751387e149eab7774f16c09aa
4646
# cleanup
4747
RUN rm -rf /tmp/jans
4848

0 commit comments

Comments
 (0)