Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Key Vault Certificate Download and AAD SP Integration #3003

Merged
merged 7 commits into from
Apr 27, 2017

Conversation

devigned
Copy link
Member

@devigned devigned commented Apr 26, 2017

  • Quick update to the docs for --cert
  • Change az keyvault certificate download to better reflect the encoding options (PEM and DER).
$ az keyvault certificate download -h

Command
    az keyvault certificate download: Download a certificate from a KeyVault.

Arguments
    --file -f    [Required]: File to receive the binary certificate contents.
    --name -n    [Required]: Name of the certificate.
    --vault-name [Required]: Name of the key vault.
    --encoding -e          : Encoding of the certificate. DER will create a binary DER formatted
                             x509 certificate, and PEM will create a base64 PEM x509 certificate.
                             Allowed values: DER, PEM.  Default: PEM.
    --version -v           : The certificate version. If omitted, uses the latest version.

Global Arguments
    --debug                : Increase logging verbosity to show all debug logs.
    --help -h              : Show this help message and exit.
    --output -o            : Output format.  Allowed values: json, jsonc, table, tsv.  Default:
                             json.
    --query                : JMESPath query string. See http://jmespath.org/ for more information
                             and examples.
    --verbose              : Increase logging verbosity. Use --debug for full debug logs.

Usage:

$ az keyvault certificate download --vault-name level1osip9 -n sp-cert-level1 -f cert.crt -e DER
$ openssl x509 -in cert.crt -inform DER  -noout -sha1 -fingerprint
SHA1 Fingerprint=B6:5E:A6:A3:F7:19:EB:E8:BD:83:45:3D:A7:16:5C:A9:65:3F:51:5E
$ az keyvault certificate download --vault-name level1osip9 -n sp-cert-level1 -f cert.pem
$ openssl x509 -in cert.pem -inform PEM  -noout -sha1 -fingerprint
SHA1 Fingerprint=B6:5E:A6:A3:F7:19:EB:E8:BD:83:45:3D:A7:16:5C:A9:65:3F:51:5E

@devigned devigned changed the title provide better cert docs Enhanced --cert docs for az ad sp create-for-rbac Apr 26, 2017
Copy link
Contributor

@yugangw-msft yugangw-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the style check error and merge

@devigned devigned changed the title Enhanced --cert docs for az ad sp create-for-rbac Enhanced Key Vault Certificate Download and AAD SP Integration Apr 26, 2017
Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A couple very minor changes but otherwise I think it will be a big improvement.

@@ -6,6 +6,7 @@ Release History
unreleased
++++++++++++++++++++

* Change `az keyvault certificate download` to better reflect the encoding options (PEM and DER).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these options have changed, this is a breaking change, so please label it BC.

@@ -73,6 +73,7 @@ def completer(prefix, action, parsed_args, **kwargs): # pylint: disable=unused-a
json_web_key_op_values = ', '.join([x.value for x in JsonWebKeyOperation])
secret_encoding_values = secret_text_encoding_values + secret_binary_encoding_values
certificate_file_encoding_values = ['binary', 'string']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can delete this since it's no longer used.

@@ -506,7 +513,8 @@ def create_service_principal_for_rbac(
'''create a service principal and configure its access to Azure resources
:param str name: a display name or an app id uri. Command will generate one if missing.
:param str password: the password used to login. If missing, command will generate one.
:param str cert: PEM formatted public certificate. Do not include private key info.
:param str cert: string or @file_path PEM formatted public certificate. Do not include private
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend this for consistency for where this is used elsewhere:

PEM formatted public certificate using JSON string or `@<file path>` to load from a file.

@codecov-io
Copy link

codecov-io commented Apr 27, 2017

Codecov Report

Merging #3003 into master will decrease coverage by 0.07%.
The diff coverage is 46%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3003      +/-   ##
=========================================
- Coverage   63.17%   63.1%   -0.08%     
=========================================
  Files         484     484              
  Lines       27582   27621      +39     
  Branches     4276    4280       +4     
=========================================
+ Hits        17426   17431       +5     
- Misses       9002    9034      +32     
- Partials     1154    1156       +2
Impacted Files Coverage Δ
...e-cli-role/azure/cli/command_modules/role/_help.py 100% <ø> (ø) ⬆️
...cli-role/azure/cli/command_modules/role/_params.py 100% <100%> (ø) ⬆️
...ault/azure/cli/command_modules/keyvault/_params.py 86.15% <100%> (ø) ⬆️
...yvault/azure/cli/command_modules/keyvault/_help.py 100% <100%> (ø) ⬆️
src/azure-cli-core/azure/cli/core/util.py 67.16% <33.33%> (-0.27%) ⬇️
...-cli-role/azure/cli/command_modules/role/custom.py 35.74% <34.28%> (-0.8%) ⬇️
...vault/azure/cli/command_modules/keyvault/custom.py 67.55% <71.42%> (-0.19%) ⬇️
...li-core/azure/cli/core/test_utils/vcr_test_base.py 69.18% <0%> (-1.41%) ⬇️
...torage/azure/cli/command_modules/storage/custom.py 82.2% <0%> (-1.28%) ⬇️
...e/azure/cli/command_modules/storage/_validators.py 54.4% <0%> (-1.13%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d1aafb2...00a4f2d. Read the comment docs.

@tjprescott
Copy link
Member

Still LGTM. Feel free to merge when you are happy 😁

@devigned devigned merged commit 0184a16 into Azure:master Apr 27, 2017
@devigned devigned deleted the ad-sp-doc branch April 27, 2017 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants