[MOSIP-37808] Updated DB attributes of keymanager#552
Conversation
Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>
WalkthroughDatabase deployment automation updated to accept parameterized database name and database user role at deploy-time. Hardcoded ChangesDatabase deployment parameterization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@db_scripts/mosip_keymgr/deploy.sh`:
- Line 31: The psql invocation currently embeds the DBUSER_PWD with escaped
single quotes and leaves shell variables unquoted; update the psql command to
quote all shell expansions (e.g. use "$SU_USER_PWD", "$SU_USER", "$DB_SERVERIP",
"$DB_PORT", "$DEFAULT_DB_NAME", "$DBUSER_PWD", "$DB_UNAME") to avoid
word-splitting/pathname expansion, and pass the password into the SQL using SQL
literal quoting (use -v dbuserpwd="$DBUSER_PWD" in the psql args and reference
it inside role_dbuser.sql as :'dbuserpwd') so single quotes and special
characters in the password are handled safely.
In `@db_scripts/mosip_keymgr/drop_db.sql`:
- Line 1: The DROP statement uses an unquoted psql variable (:mosipdbname) which
does raw text substitution and can break for special characters; update the
identifier usage to the psql identifier-quoted form by replacing occurrences of
:mosipdbname with the identifier-quoted variable (use :"mosipdbname") so the
database name is safely quoted when executing DROP DATABASE IF EXISTS.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 437c6be6-91d6-4024-8433-f32e279a74cb
📒 Files selected for processing (9)
db_scripts/mosip_keymgr/db.sqldb_scripts/mosip_keymgr/ddl.sqldb_scripts/mosip_keymgr/deploy.propertiesdb_scripts/mosip_keymgr/deploy.shdb_scripts/mosip_keymgr/dml.sqldb_scripts/mosip_keymgr/drop_db.sqldb_scripts/mosip_keymgr/drop_role.sqldb_scripts/mosip_keymgr/grants.sqldb_scripts/mosip_keymgr/role_dbuser.sql
Summary by CodeRabbit