-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TrustedSigning: CLI extension commands (#7418)
* Updated the code * Added tests * Updated the CLI tests * updated * Updated service name * Updated the Readme * Fixed merge conflict * updated service info * Marked validation-id as required * Removed validation-id as required as buils are failing * Removed CP revokeCert and update command files --------- Co-authored-by: Amrita Shanbhag <amritas>
- Loading branch information
Showing
33 changed files
with
5,839 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
1.0.0b1 | ||
++++++ | ||
* Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Azure CLI Trustedsigning Extension # | ||
This is an extension to Azure CLI to manage Trustedsigning resources. | ||
|
||
## How to use ## | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name trustedsigning | ||
``` | ||
|
||
#### Connect to Azure subscription #### | ||
``` | ||
az login | ||
az account set -s {subs_id} | ||
``` | ||
|
||
#### Create a resource group (or use an existing one) #### | ||
``` | ||
az group create -n testrg -l eastus | ||
``` | ||
|
||
### Included Features ### | ||
#### Create a trusted signing account #### | ||
``` | ||
az trustedsigning create -n MyAccount -l westus -g MyResourceGroup -sku Basic | ||
``` | ||
|
||
#### List accounts under a resource group #### | ||
``` | ||
az trustedsigning list -g MyResourceGroup | ||
``` | ||
|
||
#### Get an account #### | ||
``` | ||
az trustedsigning show -n MyAccount -g MyResourceGroup | ||
``` | ||
|
||
#### Update an account #### | ||
``` | ||
az trustedsigning update -n MyAccount -g MyResourceGroup --sku Premium --tags "key1=value1 key2=value2" | ||
``` | ||
|
||
#### Delete an account #### | ||
``` | ||
az trustedsigning delete -n MyAccount -g MyResourceGroup | ||
``` | ||
|
||
#### trustedsigning certificate-profile #### | ||
|
||
#### Create a certificate profile under an account #### | ||
``` | ||
az trustedsigning certificate-profile create -g MyResourceGroup --account-name MyAccount -n MyProfile --profile-type PublicTrust --identity-validation-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
``` | ||
|
||
#### List certificate profiles under an account #### | ||
``` | ||
az trustedsigning certificate-profile list -g MyResourceGroup --account-name | ||
``` | ||
|
||
#### Get a certificate profile #### | ||
``` | ||
az trustedsigning certificate-profile show -n MyAccount -g MyResourceGroup | ||
``` | ||
|
||
#### Delete a certificate profile #### | ||
``` | ||
az trustedsigning certificate-profile delete -g MyResourceGroup --account-name MyAccount -n MyProfile | ||
``` | ||
|
||
#### Check if account name is available #### | ||
``` | ||
az trustedsigning check-name-availability --name MyAccount --type Microsoft.CodeSigning/codeSigningAccounts | ||
``` | ||
|
||
#### Check if certificate profile name is available #### | ||
``` | ||
az trustedsigning check-name-availability --name MyAccount/MyProfile --type Microsoft.CodeSigning/codeSigningAccounts/certificateProfiles | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
from azext_trustedsigning._help import helps # pylint: disable=unused-import | ||
|
||
|
||
class TrustedsigningCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
custom_command_type = CliCommandType( | ||
operations_tmpl='azext_trustedsigning.custom#{}') | ||
super().__init__(cli_ctx=cli_ctx, | ||
custom_command_type=custom_command_type) | ||
|
||
def load_command_table(self, args): | ||
from azext_trustedsigning.commands import load_command_table | ||
from azure.cli.core.aaz import load_aaz_command_table | ||
try: | ||
from . import aaz | ||
except ImportError: | ||
aaz = None | ||
if aaz: | ||
load_aaz_command_table( | ||
loader=self, | ||
aaz_pkg_name=aaz.__name__, | ||
args=args | ||
) | ||
load_command_table(self, args) | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_trustedsigning._params import load_arguments | ||
load_arguments(self, command) | ||
|
||
|
||
COMMAND_LOADER_CLS = TrustedsigningCommandsLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: disable=line-too-long | ||
# pylint: disable=too-many-lines | ||
|
||
from knack.help_files import helps # pylint: disable=unused-import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: disable=too-many-lines | ||
# pylint: disable=too-many-statements | ||
|
||
|
||
def load_arguments(self, _): # pylint: disable=unused-argument | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/trustedsigning/azext_trustedsigning/aaz/latest/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
24 changes: 24 additions & 0 deletions
24
src/trustedsigning/azext_trustedsigning/aaz/latest/trustedsigning/__cmd_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
||
from azure.cli.core.aaz import * | ||
|
||
|
||
@register_command_group( | ||
"trustedsigning", | ||
is_preview=True, | ||
) | ||
class __CMDGroup(AAZCommandGroup): | ||
"""Manage trusted signing account | ||
""" | ||
pass | ||
|
||
|
||
__all__ = ["__CMDGroup"] |
18 changes: 18 additions & 0 deletions
18
src/trustedsigning/azext_trustedsigning/aaz/latest/trustedsigning/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# | ||
# Code generated by aaz-dev-tools | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
# pylint: skip-file | ||
# flake8: noqa | ||
|
||
from .__cmd_group import * | ||
from ._check_name_availability import * | ||
from ._create import * | ||
from ._delete import * | ||
from ._list import * | ||
from ._show import * | ||
from ._update import * | ||
from ._wait import * |
Oops, something went wrong.