Skip to content

Commit 1e356ea

Browse files
authored
Add --no-sts to CLI (#2855)
* Add --no-sts to CLI Following up on #2672, add new `--no-sts` option to CLI to allow configuring `stsUnavailable` in `AwsStorageConfigInfo`
1 parent 9dff4f9 commit 1e356ea

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

client/python/cli/command/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def options_get(key, f=lambda x: x):
6969
endpoint=options_get(Arguments.ENDPOINT),
7070
endpoint_internal=options_get(Arguments.ENDPOINT_INTERNAL),
7171
sts_endpoint=options_get(Arguments.STS_ENDPOINT),
72+
sts_unavailable=options_get(Arguments.STS_UNAVAILABLE),
7273
path_style_access=options_get(Arguments.PATH_STYLE_ACCESS),
7374
catalog_connection_type=options_get(Arguments.CATALOG_CONNECTION_TYPE),
7475
catalog_authentication_type=options_get(Arguments.CATALOG_AUTHENTICATION_TYPE),

client/python/cli/command/catalogs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class CatalogsCommand(Command):
6767
endpoint: str
6868
endpoint_internal: str
6969
sts_endpoint: str
70+
sts_unavailable: bool
7071
path_style_access: bool
7172
catalog_connection_type: str
7273
catalog_authentication_type: str
@@ -131,7 +132,8 @@ def validate(self):
131132
f" {Argument.to_flag_name(Arguments.USER_ARN)},"
132133
f" {Argument.to_flag_name(Arguments.ENDPOINT)},"
133134
f" {Argument.to_flag_name(Arguments.ENDPOINT_INTERNAL)},"
134-
f" {Argument.to_flag_name(Arguments.STS_ENDPOINT)}, and"
135+
f" {Argument.to_flag_name(Arguments.STS_ENDPOINT)},"
136+
f" {Argument.to_flag_name(Arguments.STS_UNAVAILABLE)}, and"
135137
f" {Argument.to_flag_name(Arguments.PATH_STYLE_ACCESS)}"
136138
)
137139
elif self.storage_type == StorageType.AZURE.value:
@@ -185,6 +187,7 @@ def _build_storage_config_info(self):
185187
endpoint=self.endpoint,
186188
endpoint_internal=self.endpoint_internal,
187189
sts_endpoint=self.sts_endpoint,
190+
sts_unavailable=self.sts_unavailable,
188191
path_style_access=self.path_style_access,
189192
)
190193
elif self.storage_type == StorageType.AZURE.value:

client/python/cli/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class Arguments:
176176
ENDPOINT = "endpoint"
177177
ENDPOINT_INTERNAL = "endpoint_internal"
178178
STS_ENDPOINT = "sts_endpoint"
179+
STS_UNAVAILABLE = "no_sts"
179180
PATH_STYLE_ACCESS = "path_style_access"
180181
CATALOG_CONNECTION_TYPE = "catalog_connection_type"
181182
CATALOG_AUTHENTICATION_TYPE = "catalog_authentication_type"
@@ -251,6 +252,9 @@ class Create:
251252
STS_ENDPOINT = (
252253
"(Only for S3) The STS endpoint to use when connecting to STS"
253254
)
255+
STS_UNAVAILABLE = (
256+
"(Only for S3) Indicates that Polaris should not use STS (e.g. if STS is not available)"
257+
)
254258
PATH_STYLE_ACCESS = "(Only for S3) Whether to use path-style-access for S3"
255259

256260
TENANT_ID = "(Required for Azure) A tenant ID to use when connecting to Azure Storage"

client/python/cli/options/option_tree.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def get_tree() -> List[Option]:
119119
Argument(Arguments.ENDPOINT, str, Hints.Catalogs.Create.ENDPOINT),
120120
Argument(Arguments.ENDPOINT_INTERNAL, str, Hints.Catalogs.Create.ENDPOINT_INTERNAL),
121121
Argument(Arguments.STS_ENDPOINT, str, Hints.Catalogs.Create.STS_ENDPOINT),
122+
Argument(Arguments.STS_UNAVAILABLE, bool, Hints.Catalogs.Create.STS_UNAVAILABLE),
122123
Argument(Arguments.PATH_STYLE_ACCESS, bool, Hints.Catalogs.Create.PATH_STYLE_ACCESS),
123124
Argument(Arguments.ALLOWED_LOCATION, str, Hints.Catalogs.Create.ALLOWED_LOCATION,
124125
allow_repeats=True),

0 commit comments

Comments
 (0)