-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Kv keys updates #6657
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
Kv keys updates #6657
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
8a1f7f3
API updates
g2vinay 9d757c8
samples update
g2vinay e4dc6ec
API changes
g2vinay 3721edf
sample updates + checkstyle fixes
g2vinay d5ea025
feedback updates
g2vinay 18e1e9a
compile fix
g2vinay 3799f45
feedback update + sans update + checkstyle fixes
g2vinay 82fa343
api updates
g2vinay c1bdc44
feedback updates
g2vinay 2b17a83
feedback updates
g2vinay c4e7d9f
Merge branch 'certificates-api-changes' into certificates-api-consist…
g2vinay 5baf4b9
javadoc update
g2vinay 7efd1d4
checkstyle fix
g2vinay 503b001
Merge branch 'master' into certificates-api-consistency-review-updates
g2vinay 3562382
compile error fix
g2vinay 638a630
code updates
g2vinay 0f8853d
remove package-info file
g2vinay b775b9c
feedback + tests update
0994974
feedback updates
1b98e89
remove unwanted jacoco file
7ed1918
secret version update
6c419ff
Merge remote-tracking branch 'upstream/master' into secrets-version-u…
674859c
version file update
717e226
pom version updates
af3ae7d
add tests
d402d08
tests update
21c1d52
drop codecs dependency
aef7f48
update base 64 usage
698826a
Merge remote-tracking branch 'upstream/master' into kv-keys-updates
20c9239
spotbugs fix
f8c2611
feedback update
6e91dd5
code updates
65de4fd
Merge remote-tracking branch 'upstream/master' into kv-keys-updates
f13b8fd
build ifx
2b16d55
changelog + tests update
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
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
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
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
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
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
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
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
128 changes: 128 additions & 0 deletions
128
...-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/SecretKey.java
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,128 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.security.keyvault.keys.cryptography; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| import java.util.Map; | ||
| import java.util.Objects; | ||
|
|
||
|
|
||
| class SecretKey { | ||
|
|
||
| /* | ||
| * The value of the secret. | ||
| */ | ||
| @JsonProperty(value = "value") | ||
| private String value; | ||
|
|
||
| /* | ||
| * The secret properties. | ||
| */ | ||
| private SecretProperties properties; | ||
|
|
||
| /* | ||
| * Creates an empty instance of the Secret. | ||
| */ | ||
| SecretKey() { | ||
| properties = new SecretProperties(); | ||
| } | ||
|
|
||
| /* | ||
| * Creates a Secret with {@code name} and {@code value}. | ||
| * | ||
| * @param name The name of the secret. | ||
| * @param value the value of the secret. | ||
| */ | ||
| SecretKey(String name, String value) { | ||
| properties = new SecretProperties(name); | ||
| this.value = value; | ||
| } | ||
|
|
||
| /* | ||
| * Get the value of the secret. | ||
| * | ||
| * @return the secret value | ||
| */ | ||
| String getValue() { | ||
| return this.value; | ||
| } | ||
|
|
||
| /* | ||
| * Get the secret identifier. | ||
| * | ||
| * @return the secret identifier. | ||
| */ | ||
| String getId() { | ||
| return properties.getId(); | ||
| } | ||
|
|
||
| /* | ||
| * Get the secret name. | ||
| * | ||
| * @return the secret name. | ||
| */ | ||
| String getName() { | ||
| return properties.getName(); | ||
| } | ||
|
|
||
| /* | ||
| * Get the secret properties | ||
| * @return the Secret properties | ||
| */ | ||
| SecretProperties getProperties() { | ||
| return this.properties; | ||
| } | ||
|
|
||
| /* | ||
| * Set the secret properties | ||
| * @param properties The Secret properties | ||
| * @throws NullPointerException if {@code properties} is null. | ||
| * @return the updated secret key object | ||
| */ | ||
| SecretKey setProperties(SecretProperties properties) { | ||
| Objects.requireNonNull(properties); | ||
| properties.name = this.properties.name; | ||
| this.properties = properties; | ||
| return this; | ||
| } | ||
|
|
||
| @JsonProperty(value = "id") | ||
| private void unpackId(String id) { | ||
| properties.unpackId(id); | ||
| } | ||
|
|
||
| /* | ||
| * Unpacks the attributes json response and updates the variables in the Secret Attributes object. | ||
| * Uses Lazy Update to set values for variables id, tags, contentType, managed and keyId as these variables are | ||
| * part of main json body and not attributes json body when the secret response comes from list Secrets operations. | ||
| * @param attributes The key value mapping of the Secret attributes | ||
| */ | ||
| @JsonProperty("attributes") | ||
| @SuppressWarnings("unchecked") | ||
| private void unpackAttributes(Map<String, Object> attributes) { | ||
| properties.unpackAttributes(attributes); | ||
| } | ||
|
|
||
| @JsonProperty("managed") | ||
| private void unpackManaged(Boolean managed) { | ||
| properties.managed = managed; | ||
| } | ||
|
|
||
| @JsonProperty("kid") | ||
| private void unpackKid(String kid) { | ||
| properties.keyId = kid; | ||
| } | ||
|
|
||
| @JsonProperty("contentType") | ||
| private void unpackContentType(String contentType) { | ||
| properties.contentType = contentType; | ||
| } | ||
|
|
||
| @JsonProperty("tags") | ||
| private void unpackTags(Map<String, String> tags) { | ||
| properties.tags = tags; | ||
| } | ||
| } | ||
|
|
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.
should we remove this library from the external_dependencies.txt too?
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.
need to check if any other SDK still has this dependency.
Best to clean that up in a follow up PR.