-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Certs track 2 API design #5601
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
Merged
Merged
Certs track 2 API design #5601
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
94d5b27
initial
samvaity d7e18cd
first draft design
samvaity 9a66173
updating type hints
samvaity 2903319
Merge branch 'master' into certs-track-2
samvaity 5742be3
replace method fillings with pass
samvaity a49dac0
Merge branch 'master' into certs-track-2
samvaity 9392295
adding changes to models
samvaity 5708f82
making generator iterator
samvaity 1776d64
Merge branch 'master' into certs-track-2
samvaity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 27 additions & 1 deletion
28
sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/__init__.py
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,31 @@ | ||
| # ------------------------------------------------------------------------- | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See LICENSE.txt in the project root for | ||
| # license information. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| from ._client import CertificateClient | ||
| from ._models import ( | ||
| Certificate, | ||
| CertificateBase, | ||
| DeletedCertificate, | ||
| CertificateOperation, | ||
| CertificatePolicy, | ||
| Contact, | ||
| Issuer, | ||
| IssuerBase, | ||
| LifetimeAction, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "CertificateClient", | ||
| "CertificateBase", | ||
| "Certificate", | ||
| "DeletedCertificate", | ||
| "CertificatePolicy", | ||
| "Issuer", | ||
| "IssuerBase", | ||
| "Contact", | ||
| "CertificateOperation", | ||
| "LifetimeAction" | ||
| ] |
177 changes: 177 additions & 0 deletions
177
sdk/keyvault/azure-security-keyvault/azure/security/keyvault/certificates/_client.py
This file contains hidden or 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,177 @@ | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See LICENSE.txt in the project root for | ||
| # license information. | ||
| # -------------------------------------------------------------------------- | ||
| from typing import Any, Dict, Mapping, Optional, Iterator, List | ||
| from datetime import datetime | ||
| from .._generated.v7_0 import models | ||
| from .._internal import _KeyVaultClientBase | ||
| from ._models import ( | ||
| Certificate, | ||
| CertificateBase, | ||
| DeletedCertificate, | ||
| CertificatePolicy, | ||
| Issuer, | ||
| IssuerBase, | ||
| Contact, | ||
| CertificateOperation, | ||
| ) | ||
|
|
||
|
|
||
| class CertificateClient(_KeyVaultClientBase): | ||
|
|
||
| def create_certificate(self, name, policy, enabled=None, not_before=None, expires=None, tags=None, **kwargs): | ||
| # type: (str, models.CertificatePolicy, Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> CertificateOperation | ||
| pass | ||
|
|
||
| def get_certificate(self, name, version=None, **kwargs): | ||
| # type: (str, Optional[str], Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def delete_certificate(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> DeletedCertificate | ||
| pass | ||
|
|
||
| def get_deleted_certificate(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> DeletedCertificate | ||
| pass | ||
|
|
||
| def purge_deleted_certificate(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> None | ||
| pass | ||
|
|
||
| def recover_deleted_certificate(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def import_certificate( | ||
| self, | ||
| name, | ||
| base64_encoded_certificate, | ||
| password=None, | ||
| policy=None, | ||
| enabled=None, | ||
| not_before=None, | ||
| expires=None, | ||
| tags=None, | ||
| **kwargs | ||
| ): | ||
| # type: (str, str, Optional[str], Optional[models.CertificatePolicy], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def get_certificate_policy(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> CertificatePolicy | ||
| pass | ||
|
|
||
| def update_certificate_policy(self, name, policy, enabled=None, not_before=None, expires=None, tags=None, **kwargs): | ||
| # type: (str, models.CertificatePolicy, Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> CertificatePolicy | ||
| pass | ||
|
|
||
| def update_certificate(self, name, version, not_before=None, expires=None, enabled=None, tags=None, **kwargs): | ||
| # type: (str, str, Optional[datetime], Optional[datetime], Optional[bool], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def merge_certificate( | ||
| self, name, x509_certificates, enabled=True, not_before=None, expires=None, tags=None, **kwargs | ||
| ): | ||
| # type: (str, List[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def backup_certificate(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> bytes | ||
| pass | ||
|
|
||
| def restore_certificate(self, backup, **kwargs): | ||
| # type: (bytes, Mapping[str, Any]) -> Certificate | ||
| pass | ||
|
|
||
| def list_deleted_certificates(self, include_pending=None, **kwargs): | ||
| # type: (Optional[bool], Mapping[str, Any]) -> Iterator[DeletedCertificate] | ||
| pass | ||
|
|
||
| def list_certificates(self, include_pending=None, **kwargs): | ||
| # type: (Optional[bool], Mapping[str, Any]) -> Iterator[CertificateBase] | ||
| pass | ||
|
|
||
| def list_certificate_versions(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> Iterator[CertificateBase] | ||
| pass | ||
|
|
||
| def create_contacts(self, contacts, **kwargs): | ||
| # type: (Iterator[Contact], Mapping[str, Any]) -> Iterator[Contact] | ||
| # TODO: rest api includes an id should it be returned? | ||
| pass | ||
|
|
||
| def list_contacts(self, **kwargs): | ||
| # type: (Mapping[str, Any]) -> Iterator[Contact] | ||
| pass | ||
|
|
||
| def delete_contacts(self, **kwargs): | ||
samvaity marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # type: (Mapping[str, Any]) -> Iterator[Contact] | ||
| pass | ||
|
|
||
| def get_certificate_operation(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> CertificateOperation | ||
| pass | ||
|
|
||
| def delete_certificate_operation(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> CertificateOperation | ||
| pass | ||
|
|
||
| def cancel_certificate_operation(self, name, cancellation_requested, **kwargs): | ||
| # type: (str, bool, Mapping[str, Any]) -> CertificateOperation | ||
| pass | ||
|
|
||
| def get_pending_certificate_signing_request(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> str | ||
| pass | ||
|
|
||
| def get_issuer(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> Issuer | ||
| pass | ||
|
|
||
| def create_issuer( | ||
| self, | ||
| name, | ||
| provider, | ||
| account_id=None, | ||
| password=None, | ||
| organization_id=None, | ||
| admin_details=None, | ||
| enabled=None, | ||
| not_before=None, | ||
| expires=None, | ||
| tags=None, | ||
| **kwargs | ||
| ): | ||
| # type: (str, str, Optional[str], Optional[str], Optional[str], Optional[List[models.AdministratorDetails]], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Issuer | ||
| pass | ||
|
|
||
| def update_issuer( | ||
| self, | ||
| name, | ||
| provider=None, | ||
| account_id=None, | ||
| password=None, | ||
| organization_id=None, | ||
| first_name=None, | ||
| last_name=None, | ||
| email=None, | ||
| phone=None, | ||
| enabled=True, | ||
| not_before=None, | ||
| expires=None, | ||
| tags=None, | ||
| **kwargs | ||
| ): | ||
| # type: (str, Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[str], Optional[bool], Optional[datetime], Optional[datetime], Optional[Dict[str, str]], Mapping[str, Any]) -> Issuer | ||
| pass | ||
|
|
||
| def delete_issuer(self, name, **kwargs): | ||
| # type: (str, Mapping[str, Any]) -> Issuer | ||
| pass | ||
|
|
||
| def list_issuers(self, **kwargs): | ||
| # type: (Mapping[str, Any]) -> Iterator[IssuerBase] | ||
| pass | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
not_beforeaboolean? Or is the#typeannotation out-of-date?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.