-
Notifications
You must be signed in to change notification settings - Fork 162
feat(jans-pycloudlib): add support for connecting to cloudsql via cloud auth proxy #12788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 16 commits
e2408a1
99fa5aa
edf7edf
f541b16
e9c2187
f75e2b3
a7dba0f
5343272
16ba36d
6a7305c
f86e7bc
7ef8dc8
717fb68
04be023
be95dc6
01995d3
9489a96
4506c30
cff424d
df2f7d1
b68323d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ RUN mkdir -p /etc/jans/conf \ | |
| /usr/share/java \ | ||
| /opt/jans/bin | ||
|
|
||
| ENV JANS_SOURCE_VERSION=4cf1bf2085bbdeab678e51ab3aff34d4c48be96b | ||
| ENV JANS_SOURCE_VERSION=be95dc67a0f482b417aaab2e13ff9bde09f8d7ad | ||
| ARG JANS_SETUP_DIR=jans-linux-setup/jans_setup | ||
| ARG JANS_CONFIG_API_RESOURCES=jans-config-api/server/src/main/resources | ||
|
|
||
|
|
@@ -232,8 +232,18 @@ LABEL org.opencontainers.image.url="ghcr.io/janssenproject/jans/config-api" \ | |
| org.opencontainers.image.title="Janssen Config API" \ | ||
| org.opencontainers.image.description="" | ||
|
|
||
| # =========== | ||
| # Custom libs | ||
| # =========== | ||
|
|
||
| ARG CLOUDSQL_SOCKET_FACTORY_VERSION=1.27.0 | ||
|
|
||
| # Download Cloud SQL JDBC Socket Factory JARs directly to custom/libs (always available) | ||
| RUN mkdir -p ${JETTY_BASE}/jans-config-api/custom/libs \ | ||
| && wget -q https://repo1.maven.org/maven2/com/google/cloud/sql/mysql-socket-factory-connector-j-8/${CLOUDSQL_SOCKET_FACTORY_VERSION}/mysql-socket-factory-connector-j-8-${CLOUDSQL_SOCKET_FACTORY_VERSION}.jar -P ${JETTY_BASE}/jans-config-api/custom/libs/ \ | ||
| && wget -q https://repo1.maven.org/maven2/com/google/cloud/sql/postgres-socket-factory/${CLOUDSQL_SOCKET_FACTORY_VERSION}/postgres-socket-factory-${CLOUDSQL_SOCKET_FACTORY_VERSION}.jar -P ${JETTY_BASE}/jans-config-api/custom/libs/ | ||
|
||
|
|
||
| RUN mkdir -p /etc/certs \ | ||
| ${JETTY_BASE}/jans-config-api/custom/libs \ | ||
| ${JETTY_BASE}/jans-config-api/custom/config/adminUI \ | ||
| ${JETTY_BASE}/jans-config-api/logs \ | ||
| ${JETTY_BASE}/common/libs \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| db.schema.name=%(rdbm_schema)s | ||
|
|
||
| connection.uri=jdbc:postgresql://%(rdbm_host)s:%(rdbm_port)s/%(rdbm_db)s | ||
| connection.uri=%(rdbm_connection_uri)s | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find files related to database connection URI construction
find . -type f -name "*.py" -o -name "*.properties" | head -20Repository: JanssenProject/jans Length of output: 1028 🏁 Script executed: # Search for rdbm_connection_uri construction
rg "rdbm_connection_uri" --type-list | head -20Repository: JanssenProject/jans Length of output: 452 🏁 Script executed: # Search for where connection URIs are built
rg "connection\.uri" -A 3 -B 3 --type propertiesRepository: JanssenProject/jans Length of output: 97 🏁 Script executed: # Find references to pg8000 and cloud-sql-python-connector
rg "pg8000|cloud.sql.python.connector|cloud-sql-python-connector" -iRepository: JanssenProject/jans Length of output: 2981 🏁 Script executed: # Look for PostgreSQL connection configuration
rg "postgresql|postgres" -i --type properties --type python -B 2 -A 2 | head -50Repository: JanssenProject/jans Length of output: 149 🏁 Script executed: # Search for rdbm_connection_uri in all file types
rg "rdbm_connection_uri"Repository: JanssenProject/jans Length of output: 1475 🏁 Script executed: # Find jans-config-api related files
find . -path "*/docker-jans-config-api/*" -type f | grep -E "\.(py|sh|properties)$" | head -30Repository: JanssenProject/jans Length of output: 590 🏁 Script executed: # Look at jans-pgsql.properties and surrounding configuration
find . -name "jans-pgsql.properties" -o -name "jans-mysql.properties"Repository: JanssenProject/jans Length of output: 928 🏁 Script executed: # Search for how these template properties are used/interpolated
rg "rdbm_host|rdbm_port|rdbm_db" -A 2 -B 2 | head -80Repository: JanssenProject/jans Length of output: 6568 🏁 Script executed: # Look for entrypoint or configuration scripts in docker-jans-config-api
find ./docker-jans-config-api -type f \( -name "*.py" -o -name "*.sh" \) | head -20Repository: JanssenProject/jans Length of output: 476 🏁 Script executed: # Find the _build_jdbc_connection_uri function
rg "_build_jdbc_connection_uri" -A 20 -B 2Repository: JanssenProject/jans Length of output: 4210 🏁 Script executed: # Look at the entire sql.py file to understand the context
cat jans-pycloudlib/jans/pycloudlib/persistence/sql.py | head -200Repository: JanssenProject/jans Length of output: 7552 🏁 Script executed: # Get more of the sql.py file focusing on the URI building logic
rg "def _build_jdbc_connection_uri" -A 30Repository: JanssenProject/jans Length of output: 3055 🏁 Script executed: # Get the complete function implementation
rg "def _build_jdbc_connection_uri" -A 60Repository: JanssenProject/jans Length of output: 5694 🏁 Script executed: # Check if there are separate SSL properties for PostgreSQL in the templates
cat ./docker-jans-config-api/templates/jans-pgsql.propertiesRepository: JanssenProject/jans Length of output: 1275 🏁 Script executed: # Compare with old PostgreSQL templates to see how SSL was handled before
cat ./jans-linux-setup/jans_setup/templates/jans-pgsql.propertiesRepository: JanssenProject/jans Length of output: 1472 Missing SSL/TLS configuration for standard PostgreSQL connections. The template migration removed critical SSL/TLS driver properties ( The Ensure that SSL/TLS settings are either:
🤖 Prompt for AI Agents |
||
|
|
||
| # Prefix connection.driver-property.key=value will be coverterd to key=value JDBC driver properties | ||
| #connection.driver-property.driverProperty=driverPropertyValu | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.