Skip to content

First set of API review feedback - #19164

Merged
Larry Osterman (LarryOsterman) merged 100 commits into
Azure:mainfrom
LarryOsterman:larryo-apireviewfeedback
Jul 2, 2021
Merged

First set of API review feedback#19164
Larry Osterman (LarryOsterman) merged 100 commits into
Azure:mainfrom
LarryOsterman:larryo-apireviewfeedback

Conversation

@LarryOsterman

@LarryOsterman Larry Osterman (LarryOsterman) commented Jun 8, 2021

Copy link
Copy Markdown
Member

This commit represents the first part of the Attestation Service API review. It includes the following changes:

  • Removed the AttestationSigningKey type in favor of keyword arguments.
  • Added a signing_key and signing_certificate parameter to the AttestationAdministrationClient class to simplify the API calling pattern for the policy APIs.
  • Removed the TpmAttestationRequest and TpmAttestationResponse wrapper types.
  • Converted all keys and certificates from DER encoded byte arrays to PEM encoded strings for consistency with other Azure APIs.
  • Removed the AttestationResponse type; Consolidated the attestation policy responses to a single AttestationPolicyResult type.
  • Removed the TokenValidationOptions type, consolidated into the various APIs as keyword args.

@check-enforcer

check-enforcer Bot commented Jun 8, 2021

Copy link
Copy Markdown

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run python - [service] - ci

@LarryOsterman
Larry Osterman (LarryOsterman) marked this pull request as ready for review June 8, 2021 23:13
@LarryOsterman
Larry Osterman (LarryOsterman) requested a review from a team as a code owner June 8, 2021 23:13

@seankane-msft Sean Kane (seankane-msft) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some preliminary feedback

Comment thread sdk/attestation/azure-security-attestation/CHANGELOG.md Outdated
Comment thread sdk/attestation/azure-security-attestation/CHANGELOG.md Outdated
Comment thread sdk/attestation/azure-security-attestation/CHANGELOG.md Outdated
Comment thread sdk/attestation/azure-security-attestation/CHANGELOG.md Outdated
Comment thread sdk/attestation/azure-security-attestation/CHANGELOG.md Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/helpers.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_attestation.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_attestation_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_attestation_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset.py Outdated
@seankane-msft

Copy link
Copy Markdown
Contributor

I would recommend using the black package to format your code or at least the samples. It will make it more readable for end-users. You can use

pip install black
cd sdk/attestation/azure-security-attestation
black . # or whatever directory ie black . samples/
git checkout -- azure/security/attestation/_generated  # dont want to apply to generated code.

@LarryOsterman

Copy link
Copy Markdown
Member Author

I would recommend using the black package to format your code or at least the samples. It will make it more readable for end-users. You can use

pip install black
cd sdk/attestation/azure-security-attestation
black . # or whatever directory ie black . samples/
git checkout -- azure/security/attestation/_generated  # dont want to apply to generated code.

I don't know if it matters, but the JS SDK and REST API SDK both run prettier on the checked in code and fail the CI process if the code doesn't match. It might make sense to do the same for Python, assuming that black generates canonically valid code.

Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_get_set_policy_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/README.md
Comment thread sdk/attestation/azure-security-attestation/samples/README.md
…station/aio/_client_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
…station/aio/_client_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
…station/aio/_client_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
…st_enclave_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
…st_enclave_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
…st_enclave_async.py

Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_attest_enclave_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_client.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_authentication.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_get_set_policy.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_get_set_policy_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/samples/sample_utils.py
Comment thread sdk/attestation/azure-security-attestation/samples/sample_utils.py Outdated
Comment thread sdk/attestation/azure-security-attestation/setup.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/preparers.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/preparers.py
Comment thread sdk/attestation/azure-security-attestation/tests/preparers_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/preparers_async.py
Comment thread sdk/attestation/azure-security-attestation/tests/test_attestation_token.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset_async.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset_async.py Outdated

@laiapat Laia Patiño (laiapat) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Things are looking really good! I think these are the only remaining things that I've noticed

Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_client.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/azure/security/attestation/_models.py Outdated
Comment thread sdk/attestation/azure-security-attestation/tests/test_policy_getset_async.py Outdated

@laiapat Laia Patiño (laiapat) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for all the work on this!

@LarryOsterman

Copy link
Copy Markdown
Member Author

/azp run python - attestation - tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LarryOsterman
Larry Osterman (LarryOsterman) merged commit 680d66f into Azure:main Jul 2, 2021
@LarryOsterman
Larry Osterman (LarryOsterman) deleted the larryo-apireviewfeedback branch July 2, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants