Skip to content

Commit

Permalink
add high-assurance placeholder option to endpoint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGlobus committed Oct 9, 2024
1 parent 35ddd3e commit 9ee14d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions compute_endpoint/globus_compute_endpoint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ def version_command():
default=False,
help="Configure endpoint as multi-user capable",
)
@click.option(
"--high-assurance",
is_flag=True,
default=False,
help="Configure endpoint as high assurance capable",
)
@click.option(
"--display-name",
help="A human readable display name for the endpoint, if desired",
Expand Down Expand Up @@ -364,6 +370,7 @@ def configure_endpoint(
name: str,
endpoint_config: str | None,
multi_user: bool,
high_assurance: bool,
display_name: str | None,
auth_policy: str | None,
auth_policy_project_id: str | None,
Expand All @@ -387,6 +394,11 @@ def configure_endpoint(
if multi_user and not _has_multi_user:
raise ClickException("multi-user endpoints are not supported on this system")

if high_assurance and not auth_policy and not subscription_id:
raise ClickException(
"high-assurance(HA) endpoints require a HA policy or subscription id"
)

if (
auth_policy_project_id is not None
or auth_policy_display_name != _AUTH_POLICY_DEFAULT_NAME
Expand Down Expand Up @@ -431,6 +443,7 @@ def configure_endpoint(
ep_dir,
endpoint_config,
multi_user,
high_assurance,
display_name,
auth_policy,
subscription_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ class Config(RepresentationMixin):
Designates the endpoint as a multi-user endpoint
Default: None
high_assurance : bool | None
Designates the endpoint as a high-assurance endpoint
Default: None
public : bool | None
Indicates if all users can discover the multi-user endpoint via our web UI and
API. This field is only supported on multi-user endpoints and does not control
Expand Down Expand Up @@ -150,6 +154,7 @@ def __init__(
environment: str | None = None,
local_compute_services: bool = False,
multi_user: bool | None = None,
high_assurance: bool | None = None,
public: bool | None = None,
allowed_functions: list[str] | None = None,
authentication_policy: str | None = None,
Expand Down Expand Up @@ -198,6 +203,7 @@ def __init__(

# Multi-user tuning
self.multi_user = multi_user is True
self.high_assurance = high_assurance is True
self.force_mu_allow_same_user = force_mu_allow_same_user is True
self.mu_child_ep_grace_period_s = mu_child_ep_grace_period_s
self.identity_mapping_config_path = identity_mapping_config_path
Expand Down
8 changes: 8 additions & 0 deletions compute_endpoint/globus_compute_endpoint/endpoint/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def update_config_file(
original_path: pathlib.Path,
target_path: pathlib.Path,
multi_user: bool,
high_assurance: bool,
display_name: str | None,
auth_policy: str | None,
subscription_id: str | None,
Expand All @@ -89,6 +90,9 @@ def update_config_file(
if auth_policy:
config_dict["authentication_policy"] = auth_policy

if high_assurance:
config_dict["high_assurance"] = high_assurance

if multi_user:
config_dict["multi_user"] = multi_user
config_dict.pop("engine", None)
Expand All @@ -109,6 +113,7 @@ def init_endpoint_dir(
endpoint_dir: pathlib.Path,
endpoint_config: pathlib.Path | None = None,
multi_user=False,
high_assurance=False,
display_name: str | None = None,
auth_policy: str | None = None,
subscription_id: str | None = None,
Expand Down Expand Up @@ -143,6 +148,7 @@ def init_endpoint_dir(
endpoint_config,
config_target_path,
multi_user,
high_assurance,
display_name,
auth_policy,
subscription_id,
Expand Down Expand Up @@ -187,6 +193,7 @@ def configure_endpoint(
conf_dir: pathlib.Path,
endpoint_config: str | None,
multi_user: bool = False,
high_assurance: bool = False,
display_name: str | None = None,
auth_policy: str | None = None,
subscription_id: str | None = None,
Expand All @@ -202,6 +209,7 @@ def configure_endpoint(
conf_dir,
templ_conf_path,
multi_user,
high_assurance,
display_name,
auth_policy,
subscription_id,
Expand Down

0 comments on commit 9ee14d7

Please sign in to comment.