Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sdk/keyvault/azure-keyvault-certificates/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ as certain properties of `Certificate` (such as `version`) have to be accessed
through the `properties` property. See the updated [docs]
(https://azure.github.io/azure-sdk-for-python/ref/azure.keyvault.certificates.html)
for details.
- `update_certificate` has been renamed to `update_certificate_propertie`
- `update_certificate` has been renamed to `update_certificate_properties`
- The `vault_url` parameter of `CertificateClient` has been renamed to `vault_endpoint`
- The property `vault_url` has been renamed to `vault_endpoint` in all models.

## 4.0.0b3 (2019-09-11)
Version 4.0.0b3 is the first preview of our efforts to create a user-friendly and Pythonic client library for Azure Key Vault's certificates.
Expand Down
6 changes: 3 additions & 3 deletions sdk/keyvault/azure-keyvault-certificates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ names):
}
```

> The `"vaultUri"` property is the `vault_url` used by `CertificateClient`
> The `"vaultUri"` property is the `vault_endpoint` used by `CertificateClient`

### Authenticate the client
In order to interact with a Key Vault's certificates, you'll need an instance
Expand Down Expand Up @@ -116,7 +116,7 @@ from azure.keyvault.certificates import CertificateClient
credential = DefaultAzureCredential()

# Create a new certificate client using the default credential
certificate_client = CertificateClient(vault_url=<your-vault-url>, credential=credential)
certificate_client = CertificateClient(vault_endpoint=<your-vault-url>, credential=credential)
```
## Key concepts
With a `CertificateClient` you can get certificates from the vault, create new certificates and
Expand Down Expand Up @@ -278,7 +278,7 @@ file_handler = logging.FileHandler(filename)
logger.addHandler(file_handler)

# Enable network trace logging. Each HTTP request will be logged at DEBUG level.
client = CertificateClient(vault_url=url, credential=credential, logging_enable=True))
client = CertificateClient(vault_endpoint=url, credential=credential, logging_enable=True))
```

Network trace logging can also be enabled for any single operation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"KeyVaultClientBase",
]

_VaultId = namedtuple("VaultId", ["vault_url", "collection", "name", "version"])
_VaultId = namedtuple("VaultId", ["vault_endpoint", "collection", "name", "version"])


def parse_vault_id(url):
Expand All @@ -40,7 +40,7 @@ def parse_vault_id(url):
raise ValueError("'{}' is not not a valid vault url".format(url))

return _VaultId(
vault_url="{}://{}".format(parsed_uri.scheme, parsed_uri.hostname),
vault_endpoint="{}://{}".format(parsed_uri.scheme, parsed_uri.hostname),
collection=path[0],
name=path[1],
version=path[2] if len(path) == 3 else None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _create_config(credential: "TokenCredential", api_version: str = None, **kwa

def __init__(
self,
vault_url: str,
vault_endpoint: str,
credential: "TokenCredential",
transport: AsyncHttpTransport = None,
api_version: str = None,
Expand All @@ -70,10 +70,10 @@ def __init__(
"credential should be an object supporting the TokenCredential protocol, "
"such as a credential from azure-identity"
)
if not vault_url:
raise ValueError("vault_url must be the URL of an Azure Key Vault")
if not vault_endpoint:
raise ValueError("vault_endpoint must be the URL of an Azure Key Vault")

self._vault_url = vault_url.strip(" /")
self._vault_endpoint = vault_endpoint.strip(" /")

client = kwargs.pop("generated_client", None)
if client:
Expand Down Expand Up @@ -109,5 +109,5 @@ def _build_pipeline(config: Configuration, transport: AsyncHttpTransport, **kwar
return AsyncPipeline(transport, policies=policies)

@property
def vault_url(self) -> str:
return self._vault_url
def vault_endpoint(self) -> str:
return self._vault_endpoint
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ def _create_config(credential, api_version=None, **kwargs):

return config

def __init__(self, vault_url, credential, transport=None, api_version=None, **kwargs):
def __init__(self, vault_endpoint, credential, transport=None, api_version=None, **kwargs):
# type: (str, TokenCredential, Optional[HttpTransport], Optional[str], **Any) -> None
if not credential:
raise ValueError(
"credential should be an object supporting the TokenCredential protocol, "
"such as a credential from azure-identity"
)
if not vault_url:
raise ValueError("vault_url must be the URL of an Azure Key Vault")
if not vault_endpoint:
raise ValueError("vault_endpoint must be the URL of an Azure Key Vault")

self._vault_url = vault_url.strip(" /")
self._vault_endpoint = vault_endpoint.strip(" /")

client = kwargs.pop("generated_client", None)
if client:
Expand Down Expand Up @@ -101,6 +101,6 @@ def _build_pipeline(self, config, transport, **kwargs):
return Pipeline(transport, policies=policies)

@property
def vault_url(self):
def vault_endpoint(self):
# type: () -> str
return self._vault_url
return self._vault_endpoint
Loading