Skip to content

[ES-2889] [ES-2890] Added enc_public_key_cert column to CREATE query for CLIENT_DETAIL table#1645

Open
Md-Humair-KK wants to merge 2 commits intomosip:developfrom
Infosys:ES-2889
Open

[ES-2889] [ES-2890] Added enc_public_key_cert column to CREATE query for CLIENT_DETAIL table#1645
Md-Humair-KK wants to merge 2 commits intomosip:developfrom
Infosys:ES-2889

Conversation

@Md-Humair-KK
Copy link
Contributor

@Md-Humair-KK Md-Humair-KK commented Feb 19, 2026

Summary by CodeRabbit

  • Infrastructure

    • Database schema updated to add a new field for storing client encryption certificates (requires migration).
  • Chores

    • Minor repository metadata formatting fix (trailing newline).

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Walkthrough

Adds a new column enc_public_key_cert (varchar(4000)) to the client_detail table in the eSignet schema and adds a trailing newline to db_upgrade_script/mosip_esignet/upgrade.properties; no other structural or behavioral changes.

Changes

Cohort / File(s) Summary
Database Schema
db_scripts/mosip_esignet/ddl/esignet-client_detail.sql
Inserted new column enc_public_key_cert varchar(4000) into client_detail, positioned after enc_public_key_hash and before grant_types.
Upgrade Properties
db_upgrade_script/mosip_esignet/upgrade.properties
Added a trailing newline at end-of-file; no property value changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibbled a column into place,

tucked a newline with gentle grace,
between a hash and grant it lay,
whispering certs in a quiet way. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change—adding the enc_public_key_cert column to the CLIENT_DETAIL table's CREATE statement, which aligns with the primary modification in the SQL DDL file.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
db_scripts/mosip_esignet/ddl/esignet-client_detail.sql (2)

30-30: Consider whether varchar(4000) is sufficient for all supported certificate types.

A PEM-encoded RSA-4096 certificate can reach ~3,400–3,600 characters; 4000 may be uncomfortably close to the limit, and certificates with long Subject/SAN fields or additional extensions can exceed it. If RSA-4096 or similar large-key certs are in scope, bumping to varchar(8192) (or using a text column if the DBMS allows it for this table) would provide safe headroom without meaningful storage cost.

🔧 Proposed adjustment
-	enc_public_key_cert varchar(4000),
+	enc_public_key_cert varchar(8192),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@db_scripts/mosip_esignet/ddl/esignet-client_detail.sql` at line 30, The
column enc_public_key_cert currently defined as enc_public_key_cert
varchar(4000) may be too small for large PEM certificates; update its type to a
larger capacity (e.g., varchar(8192) or TEXT depending on DBMS) in the table DDL
so it can safely store RSA-4096 and certificates with long fields/extensions,
and run/confirm any migration scripts for the table and related DB clients to
handle the new size; ensure constraints/indexes referencing enc_public_key_cert
(if any) are reviewed and adjusted accordingly.

41-55: Add a COMMENT ON COLUMN entry for the new enc_public_key_cert column.

All other columns have a corresponding commented-out COMMENT ON COLUMN block, but enc_public_key_cert is missing one. Keeping the comments consistent aids future maintainers.

📝 Proposed addition
 -- COMMENT ON COLUMN client_detail.public_key_hash IS 'Public key hash: SHA-256 hash of some fields of the public key for unique public key check.';
+-- COMMENT ON COLUMN client_detail.enc_public_key_cert IS 'Encryption Public Key Certificate: PEM-encoded X.509 certificate containing the encryption public key.';
 -- COMMENT ON COLUMN client_detail.grant_types IS 'Grant Types: Allowed grant types for the client, comma separated string.';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@db_scripts/mosip_esignet/ddl/esignet-client_detail.sql` around lines 41 - 55,
The file is missing a COMMENT ON COLUMN entry for the new enc_public_key_cert
column in the client_detail table; add a commented-out line similar to the
others: include "COMMENT ON COLUMN client_detail.enc_public_key_cert IS '<short
description>'." Use a concise description matching the style of other comments
(e.g., "Encrypted public key certificate: Base64 or PEM encoded client
certificate used for encryption.") so the enc_public_key_cert column has a
corresponding comment block alongside the rest of client_detail's columns.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@db_scripts/mosip_esignet/ddl/esignet-client_detail.sql`:
- Line 30: The column enc_public_key_cert currently defined as
enc_public_key_cert varchar(4000) may be too small for large PEM certificates;
update its type to a larger capacity (e.g., varchar(8192) or TEXT depending on
DBMS) in the table DDL so it can safely store RSA-4096 and certificates with
long fields/extensions, and run/confirm any migration scripts for the table and
related DB clients to handle the new size; ensure constraints/indexes
referencing enc_public_key_cert (if any) are reviewed and adjusted accordingly.
- Around line 41-55: The file is missing a COMMENT ON COLUMN entry for the new
enc_public_key_cert column in the client_detail table; add a commented-out line
similar to the others: include "COMMENT ON COLUMN
client_detail.enc_public_key_cert IS '<short description>'." Use a concise
description matching the style of other comments (e.g., "Encrypted public key
certificate: Base64 or PEM encoded client certificate used for encryption.") so
the enc_public_key_cert column has a corresponding comment block alongside the
rest of client_detail's columns.

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@db_upgrade_script/mosip_esignet/upgrade.properties`:
- Line 12: The UPGRADE_VERSION property is empty but must be set to a new
migration identifier because this PR adds a schema change (enc_public_key_cert
column); update the UPGRADE_VERSION key in upgrade.properties to the appropriate
next version/migration id used by your upgrade runner (e.g., follow the
project's semantic versioning or migration sequence) so the upgrade will be
detected and recorded, and ensure this matches any migration metadata or
changelog entries referencing the enc_public_key_cert column.

DBUSER_PWD=
CURRENT_VERSION=
UPGRADE_VERSION= No newline at end of file
UPGRADE_VERSION=
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

UPGRADE_VERSION must be set when a schema change is included.

UPGRADE_VERSION= is left blank while this PR introduces a DDL schema change (enc_public_key_cert column). If the upgrade runner relies on this value to gate or record schema migrations, leaving it empty means the upgrade may not be correctly versioned or triggered.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@db_upgrade_script/mosip_esignet/upgrade.properties` at line 12, The
UPGRADE_VERSION property is empty but must be set to a new migration identifier
because this PR adds a schema change (enc_public_key_cert column); update the
UPGRADE_VERSION key in upgrade.properties to the appropriate next
version/migration id used by your upgrade runner (e.g., follow the project's
semantic versioning or migration sequence) so the upgrade will be detected and
recorded, and ensure this matches any migration metadata or changelog entries
referencing the enc_public_key_cert column.

@Md-Humair-KK Md-Humair-KK changed the title [ES-2889] Added enc_public_key_cert column to CREATE query for CLIENT_DETAIL table [ES-2889] [ES-2890] Added enc_public_key_cert column to CREATE query for CLIENT_DETAIL table Feb 20, 2026
Copy link
Contributor

@zesu22 zesu22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants