Skip to content

Commit 61b714f

Browse files
committed
Rename ScrubUserMappingSecrets to RedactUserMappingSecrets; fix style
1 parent 747b2e4 commit 61b714f

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

pg_lake_iceberg/include/pg_lake/rest_catalog/rest_catalog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,6 @@ extern PGDLLEXPORT RestCatalogRequest * GetRemoveSnapshotCatalogRequest(List *re
131131
/* ProcessUtility handlers */
132132
/* iceberg_catalog server DDL validation */
133133
extern PGDLLEXPORT bool ValidateIcebergCatalogServerDDL(ProcessUtilityParams * processUtilityParams, void *arg);
134+
134135
/* scrubs user mapping secrets in-place */
135-
extern PGDLLEXPORT bool RedactRestCatalogUserMappingSecrets(ProcessUtilityParams *processUtilityParams, void *arg);
136+
extern PGDLLEXPORT bool RedactRestCatalogUserMappingSecrets(ProcessUtilityParams * processUtilityParams, void *arg);

pg_lake_iceberg/src/rest_catalog/rest_catalog.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,22 @@ IsIcebergCatalogServer(const char *serverName)
243243

244244

245245
/*
246-
* ScrubUserMappingSecrets overwrites secret option values in the query
246+
* RedactUserMappingSecrets overwrites secret option values in the query
247247
* string in-place with asterisks.
248248
*
249249
* In-place mutation is essential: pg_stat_statements captures the queryString
250250
* pointer before calling prev_ProcessUtility, then stores it after the call
251251
* returns. A copy with pstrdup would be invisible to pg_stat_statements
252252
* because its local pointer still references the original memory. By
253253
* overwriting the original buffer, every holder of that pointer — including
254-
* pg_stat_statements — sees the scrubbed version.
254+
* pg_stat_statements — sees the redacted version.
255255
*
256256
* The actual DDL execution is unaffected because CREATE/ALTER USER MAPPING
257257
* reads option values from the parse tree (DefElem nodes), not from
258258
* queryString.
259259
*/
260260
static void
261-
ScrubUserMappingSecrets(const char *queryString, List *options)
261+
RedactUserMappingSecrets(const char *queryString, List *options)
262262
{
263263
const char *secret_options[] = {"client_id", "client_secret", NULL};
264264
ListCell *lc;
@@ -339,7 +339,7 @@ RedactRestCatalogUserMappingSecrets(ProcessUtilityParams * processUtilityParams,
339339
if (!IsIcebergCatalogServer(serverName))
340340
return false;
341341

342-
ScrubUserMappingSecrets(processUtilityParams->queryString, options);
342+
RedactUserMappingSecrets(processUtilityParams->queryString, options);
343343

344344
return false;
345345
}
@@ -655,13 +655,14 @@ GetRestCatalogOptionsFromCatalog(const char *catalog)
655655
}
656656

657657
/*
658-
* User mapping has highest priority — overrides everything above
659-
* Can only be set for user-created servers
658+
* User mapping has highest priority — overrides everything above Can
659+
* only be set for user-created servers
660660
*/
661661
if (server != NULL)
662662
{
663663
List *umOptions = LookupUserMappingOptions(server->serverid);
664664
ListCell *lc;
665+
665666
foreach(lc, umOptions)
666667
{
667668
DefElem *def = (DefElem *) lfirst(lc);

0 commit comments

Comments
 (0)