Add BigLake configuration validation for catalog creation and updates - #5196
Add BigLake configuration validation for catalog creation and updates#5196davidchaava wants to merge 6 commits into
Conversation
|
Hi @sungwy , We would especially appreciate your feedback from the GCP/BigLake compatibility perspective. Thank you. |
| Pattern.compile("^[A-Za-z0-9._-]+$"); | ||
| private static final Pattern GCS_SERVICE_ACCOUNT_PATTERN = | ||
| Pattern.compile( | ||
| "^[a-z][a-z0-9-]{4,28}[a-z0-9]@[a-z][a-z0-9-]{4,28}[a-z0-9]\\.iam\\.gserviceaccount\\.com$"); |
There was a problem hiding this comment.
This only accepts the user-managed SA form, so it rejects the Compute-default (…-compute@developer.gserviceaccount.com) and App-Engine-default (@appspot.gserviceaccount.com) SAs which are both valid impersonation targets. GCP's generateAccessToken accepts any SA email, and Polaris' own GcpCredentialsStorageIntegration only checks presence, so this check is stricter than both. Could we accept any valid SA email, or, if the restriction's intentional, reword the error (those defaults are Google SA emails)? WDYT
There was a problem hiding this comment.
Good catch! That restriction wasn’t intentional. I’ve relaxed the check so it no longer assumes the user-managed service account format, and added coverage for Compute Engine and App Engine default service accounts. GCP remains the source of truth for whether the account exists and can be impersonated.
Thanks!
5a981c8 to
b9898f5
Compare
Summary
Adds fail-fast validation for BigLake Iceberg REST external catalog configurations during catalog creation and update.
Validation is scoped to GCP-authenticated Iceberg REST catalogs that target the official BigLake endpoint,
https://biglake.googleapis.com/iceberg/v1/restcatalog. Other GCP-authenticated Iceberg REST catalogs retain their existing behavior.Changes
bl://projects/<project-number>/catalogs/<catalog-id>.header.x-goog-user-projectquota-project header.header.x-goog-user-projectinconnectionConfigInfo.propertiesfor new GCP Iceberg REST catalogs.Validation
./gradlew :polaris-runtime-service:test --tests org.apache.polaris.service.admin.BigLakeCatalogValidatorTestpytest tests/test_catalogs_command.py::TestCatalogsCommand::test_external_catalog_gcp -qRelated to #5195