mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-15 03:18:07 +00:00
Provide the ability to create a new cli application registration (#236)
This commit is contained in:
@ -65,6 +65,7 @@ from registration import (
|
||||
assign_scaleset_role,
|
||||
authorize_application,
|
||||
get_application,
|
||||
OnefuzzAppRole,
|
||||
register_application,
|
||||
update_pool_registration,
|
||||
)
|
||||
@ -230,7 +231,7 @@ class Client:
|
||||
password = add_application_password(object_id)
|
||||
if password:
|
||||
return password
|
||||
if count > timeout_seconds/wait:
|
||||
if count > timeout_seconds / wait:
|
||||
raise Exception("creating password failed, trying again")
|
||||
|
||||
def setup_rbac(self):
|
||||
@ -260,19 +261,19 @@ class Client:
|
||||
app_roles = [
|
||||
AppRole(
|
||||
allowed_member_types=["Application"],
|
||||
display_name="CliClient",
|
||||
display_name=OnefuzzAppRole.CliClient.value,
|
||||
id=str(uuid.uuid4()),
|
||||
is_enabled=True,
|
||||
description="Allows access from the CLI.",
|
||||
value="CliClient",
|
||||
value=OnefuzzAppRole.CliClient.value,
|
||||
),
|
||||
AppRole(
|
||||
allowed_member_types=["Application"],
|
||||
display_name="ManagedNode",
|
||||
display_name=OnefuzzAppRole.ManagedNode.value,
|
||||
id=str(uuid.uuid4()),
|
||||
is_enabled=True,
|
||||
description="Allow access from a lab machine.",
|
||||
value="ManagedNode",
|
||||
value=OnefuzzAppRole.ManagedNode.value,
|
||||
),
|
||||
]
|
||||
|
||||
@ -340,7 +341,9 @@ class Client:
|
||||
"Could not find the default CLI application under the current "
|
||||
"subscription, creating a new one"
|
||||
)
|
||||
app_info = register_application("onefuzz-cli", self.application_name)
|
||||
app_info = register_application(
|
||||
"onefuzz-cli", self.application_name, OnefuzzAppRole.CliClient
|
||||
)
|
||||
self.cli_config = {
|
||||
"client_id": app_info.client_id,
|
||||
"authority": app_info.authority,
|
||||
|
Reference in New Issue
Block a user