Skip to content

Commit

Permalink
feat: Added the handling of paged results from Azure Key Vault for re…
Browse files Browse the repository at this point in the history
…active version of services. (#6)
  • Loading branch information
antoniotarricone authored May 31, 2024
1 parent dc303ee commit c45b198
Show file tree
Hide file tree
Showing 9 changed files with 996 additions and 460 deletions.
386 changes: 200 additions & 186 deletions dep-sha256.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- Quarkus version -->
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.10.1</quarkus.platform.version>
<quarkus.platform.version>3.11.0</quarkus.platform.version>
<!-- Plugins version -->
<compiler-plugin.version>3.12.1</compiler-plugin.version>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,14 @@
@RegisterRestClient(configKey = "azure-key-vault-keys")
public interface AzureKeyVaultKeysClient {
/**
* <p>
* Creates a new key, stores it, then returns key parameters and attributes to the client.
* </p>
* <p>
* The create key operation can be used to create any key type in Azure Key Vault.
* </p>
* <p>
* If the named key already exists, Azure Key Vault creates a new version of the key.
* </p>
* <p>
* It requires the keys/create permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/create-key/create-key?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
* Azure Documentation</a>
*
* @param accessToken
* @param keyName
* <p>
* The name for the new key.
* </p>
* <p>
* The system will generate the version name for the new key.
* </p>
* <p>
* The value you provide may be copied globally for the purpose of
* running the service.
* </p>
* <p>
* The value provided should not include personally identifiable or
* sensitive information.
* </p>
* <p>
* Regex pattern: ^[0-9a-zA-Z-]+$
* </p>
* @param keyName The name for the new key. Regex pattern: ^[0-9a-zA-Z-]+$
* @param keyCreateParameters
* @return
*/
Expand All @@ -84,23 +56,7 @@ KeyBundle createKey(
KeyCreateParameters keyCreateParameters);

/**
* <p>
* List keys in the specified vault.
* </p>
* <p>
* Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public
* part of a stored key.
* </p>
* <p>
* The LIST operation is applicable to all key types, however only the base key identifier,
* attributes, and tags are provided in the response.
* </p>
* <p>
* Individual versions of a key are not listed in the response.
* </p>
* <p>
* This operation requires the keys/list permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/get-keys/get-keys?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand All @@ -118,28 +74,15 @@ KeyBundle createKey(
KeyListResult getKeys(@NotBody String accessToken);

/**
* <p>
* Gets the public part of a stored key.
* </p>
* <p>
* The get key operation is applicable to all key types.
* </p>
* <p>
* If the requested key is symmetric, then no key material is released in the response.
* </p>
* <p>
* This operation requires the keys/get permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/get-key/get-key?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
* Azure Documentation</a>
*
* @param accessToken
* @param keyName The name of the key to get.
* @param keyVersion Adding the version parameter retrieves a specific version of a key. This URI
* fragment is optional. If not specified, the latest version of the key is
* returned.
* @param keyVersion The version of the key.
* @return
*/
@Path("/keys/{keyName}/{keyVersion}")
Expand All @@ -153,15 +96,7 @@ KeyBundle getKey(
@PathParam("keyVersion") String keyVersion);

/**
* <p>
* Retrieves a list of individual key versions with the same key name.
* </p>
* <p>
* The full key identifier, attributes, and tags are provided in the response.
* </p>
* <p>
* This operation requires the keys/list permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/get-key/get-key?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand All @@ -182,16 +117,7 @@ KeyListResult getKeyVersions(
@PathParam("keyName") String keyName);

/**
* <p>
* Creates a signature from a digest using the specified key.
* </p>
* <p>
* The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since
* this operation uses the private portion of the key.
* </p>
* <p>
* This operation requires the keys/sign permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/sign/sign?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand All @@ -216,21 +142,7 @@ KeyOperationResult sign(
KeySignParameters keySignParameters);

/**
* <p>
* Verifies a signature using a specified key.
* </p>
* <p>
* The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault.
* </p>
* <p>
* VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature
* verification can be performed using the public portion of the key but this operation is supported
* as a convenience for callers that only have a key-reference and not the public portion of the
* key.
* </p>
* <p>
* This operation requires the keys/verify permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/verify/verify?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand All @@ -255,28 +167,7 @@ KeyVerifyResult verify(
KeyVerifyParameters keyVerifyParameters);

/**
* <p>
* Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.
* </p>
* <p>
* The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is
* stored in Azure Key Vault.
* </p>
* <p>
* Note that the ENCRYPT operation only supports a single block of data, the size of which is
* dependent on the target key and the encryption algorithm to be used.
* </p>
* <p>
* The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault
* since protection with an asymmetric key can be performed using public portion of the key.
* </p>
* <p>
* This operation is supported for asymmetric keys as a convenience for callers that have a
* key-reference but do not have access to the public key material.
* </p>
* <p>
* This operation requires the keys/encrypt permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/encrypt/encrypt?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand All @@ -300,24 +191,7 @@ KeyOperationResult encrypt(
KeyOperationParameters keyOperationParameters);

/**
* <p>
* Decrypts a single block of encrypted data.
* </p>
* <p>
* The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key
* and specified algorithm.
* </p>
* <p>
* This operation is the reverse of the ENCRYPT operation; only a single block of data may be
* decrypted, the size of this block is dependent on the target key and the algorithm to be used.
* </p>
* <p>
* The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it
* uses the private portion of the key.
* </p>
* <p>
* This operation requires the keys/decrypt permission.
* </p>
*
* @see <a href=
* "https://learn.microsoft.com/en-us/rest/api/keyvault/keys/decrypt/decrypt?view=rest-keyvault-keys-7.4&tabs=HTTP">Microsoft
Expand Down
Loading

0 comments on commit c45b198

Please sign in to comment.