Skip to content

Commit cd59302

Browse files
authored
fix: unify bootstrap credentials and standardize POLARIS setup (#1905)
- unified formatting across docker, gradle - reverted secret to s3cr3t - updated docker-compose, README, conftest.py use POLARIS for consistency across docker, gradle and others.
1 parent 793cf08 commit cd59302

File tree

13 files changed

+20
-20
lines changed

13 files changed

+20
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ Apache Polaris is built using Gradle with Java 21+ and Docker 27+.
6767
- `./gradlew build` - To build and run tests. Make sure Docker is running, as the integration tests depend on it.
6868
- `./gradlew assemble` - To skip tests.
6969
- `./gradlew check` - To run all checks, including unit tests and integration tests.
70-
- `./gradlew run` - To run the Polaris server locally; the server is reachable at localhost:8181. This is also suitable for running regression tests, or for connecting with Spark. Set your own credentials by specifying system property `./gradlew run -Dpolaris.bootstrap.credentials=POLARIS,root,secret` where:
70+
- `./gradlew run` - To run the Polaris server locally; the server is reachable at localhost:8181. This is also suitable for running regression tests, or for connecting with Spark. Set your own credentials by specifying system property `./gradlew run -Dpolaris.bootstrap.credentials=POLARIS,root,s3cr3t` where:
7171
- `POLARIS` is the realm
7272
- `root` is the CLIENT_ID
7373
- `secret` is the CLIENT_SECRET
74-
- If credentials are not set, it will use preset credentials `POLARIS,root,secret`
74+
- If credentials are not set, it will use preset credentials `POLARIS,root,s3cr3t`
7575
- `./regtests/run_spark_sql.sh` - To connect from Spark SQL. Here are some example commands to run in the Spark SQL shell:
7676
```sql
7777
create database db1;

client/python/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ services:
2727
AWS_REGION: us-west-2
2828
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
2929
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
30-
POLARIS_BOOTSTRAP_CREDENTIALS: default-realm,root,s3cr3t
31-
polaris.realm-context.realms: default-realm
30+
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t
31+
polaris.realm-context.realms: POLARIS
3232
quarkus.log.file.enable: "false"
3333
quarkus.otel.sdk.disabled: "true"
3434
polaris.features."DROP_WITH_PURGE_ENABLED": "true"

client/python/integration_tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def root_token(
133133
client_id=client_id,
134134
client_secret=client_secret,
135135
grant_type="client_credentials",
136-
_headers={"realm": "default-realm"},
136+
_headers={"realm": "POLARIS"},
137137
)
138138
return token
139139

getting-started/spark/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ services:
2727
AWS_REGION: us-west-2
2828
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
2929
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
30-
POLARIS_BOOTSTRAP_CREDENTIALS: default-realm,root,s3cr3t
31-
polaris.realm-context.realms: default-realm
30+
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t
31+
polaris.realm-context.realms: POLARIS
3232
quarkus.otel.sdk.disabled: "true"
3333
polaris.features."ALLOW_INSECURE_STORAGE_TYPES": "true"
3434
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"

getting-started/spark/notebooks/SparkPolaris.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
" client_id=client_id,\n",
3434
" client_secret=client_secret,\n",
3535
" grant_type='client_credentials',\n",
36-
" _headers={'realm': 'default-realm'})\n"
36+
" _headers={'realm': 'POLARIS'})\n"
3737
]
3838
},
3939
{
@@ -420,7 +420,7 @@
420420
" client_id=engineer_principal.credentials.client_id,\n",
421421
" client_secret=engineer_principal.credentials.client_secret.get_secret_value(),\n",
422422
" grant_type='client_credentials',\n",
423-
" _headers={'realm': 'default-realm'})\n",
423+
" _headers={'realm': 'POLARIS'})\n",
424424
"\n",
425425
"# Now create a catalog client that uses the token in its Authentication header\n",
426426
"client = CatalogApiClient(CatalogApiClientConfiguration(access_token=collado_token.access_token,\n",
@@ -573,7 +573,7 @@
573573
" client_id=reader_principal.credentials.client_id,\n",
574574
" client_secret=reader_principal.credentials.client_secret.get_secret_value(),\n",
575575
" grant_type='client_credentials',\n",
576-
" _headers={'realm': 'default-realm'})\n",
576+
" _headers={'realm': 'POLARIS'})\n",
577577
"\n",
578578
"# Now create a catalog client that uses the token in its Authentication header\n",
579579
"pm_client = IcebergCatalogAPI(CatalogApiClient(CatalogApiClientConfiguration(access_token=pm_token.access_token,\n",
@@ -767,7 +767,7 @@
767767
" client_id=engineer_principal.credentials.client_id,\n",
768768
" client_secret=engineer_principal.credentials.client_secret.get_secret_value(),\n",
769769
" grant_type='client_credentials',\n",
770-
" _headers={'realm': 'default-realm'})\n",
770+
" _headers={'realm': 'POLARIS'})\n",
771771
"\n",
772772
"# The returned token is scoped to _only_ the privileges granted to the ops_engineer role\n",
773773
"# The ops_client fails to do any real damage even though the engineer normally has DROP_TABLE privileges\n",

plugins/spark/v3.5/getting-started/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ services:
2727
AWS_REGION: us-west-2
2828
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
2929
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
30-
POLARIS_BOOTSTRAP_CREDENTIALS: default-realm,root,s3cr3t
31-
polaris.realm-context.realms: default-realm
30+
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t
31+
polaris.realm-context.realms: POLARIS
3232
quarkus.otel.sdk.disabled: "true"
3333
polaris.features."ALLOW_INSECURE_STORAGE_TYPES": "true"
3434
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES": "[\"FILE\",\"S3\",\"GCS\",\"AZURE\"]"

plugins/spark/v3.5/getting-started/notebooks/SparkPolaris.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
" client_id=client_id,\n",
3434
" client_secret=client_secret,\n",
3535
" grant_type='client_credentials',\n",
36-
" _headers={'realm': 'default-realm'})\n"
36+
" _headers={'realm': 'POLARIS'})\n"
3737
]
3838
},
3939
{

plugins/spark/v3.5/regtests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525
- "8182"
2626
environment:
2727
AWS_REGION: us-west-2
28-
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,secret
28+
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t
2929
quarkus.log.file.enable: "false"
3030
quarkus.otel.sdk.disabled: "true"
3131
polaris.features."ALLOW_INSECURE_STORAGE_TYPES": "true"

plugins/spark/v3.5/regtests/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [[ -z "$REGTEST_ROOT_BEARER_TOKEN" ]]; then
4141
if ! output=$(curl -X POST -H "Polaris-Realm: POLARIS" "http://${POLARIS_HOST:-localhost}:8181/api/catalog/v1/oauth/tokens" \
4242
-d "grant_type=client_credentials" \
4343
-d "client_id=root" \
44-
-d "client_secret=secret" \
44+
-d "client_secret=s3cr3t" \
4545
-d "scope=PRINCIPAL_ROLE:ALL"); then
4646
logred "Error: Failed to retrieve bearer token"
4747
exit 1

regtests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
AZURE_TENANT_ID: $AZURE_TENANT_ID
3232
AZURE_CLIENT_ID: $AZURE_CLIENT_ID
3333
AZURE_CLIENT_SECRET: $AZURE_CLIENT_SECRET
34-
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,secret
34+
POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t
3535
quarkus.log.file.enable: "false"
3636
quarkus.otel.sdk.disabled: "true"
3737
polaris.features."DROP_WITH_PURGE_ENABLED": "true"

0 commit comments

Comments
 (0)