-
Notifications
You must be signed in to change notification settings - Fork 4
Added entry parameter for preserving certificate Tags #64
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
Changes from all commits
a808ec9
fad860b
f671487
641b134
6bb0e69
c22733d
cdd4568
ee418c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,8 @@ | |||||||||||||||||||
| using Keyfactor.Orchestrators.Extensions; | ||||||||||||||||||||
| using Microsoft.Extensions.Logging; | ||||||||||||||||||||
| using Keyfactor.Orchestrators.Extensions.Interfaces; | ||||||||||||||||||||
| using System.Collections.Generic; | ||||||||||||||||||||
| using Newtonsoft.Json; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| namespace Keyfactor.Extensions.Orchestrator.AzureKeyVault | ||||||||||||||||||||
| { | ||||||||||||||||||||
|
|
@@ -38,8 +40,18 @@ public JobResult ProcessJob(ManagementJobConfiguration config) | |||||||||||||||||||
| Result = OrchestratorJobStatusJobResult.Failure, | ||||||||||||||||||||
| FailureMessage = "Invalid Management Operation" | ||||||||||||||||||||
| }; | ||||||||||||||||||||
| object tagsObj; | ||||||||||||||||||||
| object preserveTagsObj; | ||||||||||||||||||||
| string tagsJSON; | ||||||||||||||||||||
| bool preserveTags; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| var tagsJSON = config.JobProperties["CertificateTags"]?.ToString(); | ||||||||||||||||||||
| config.JobProperties.TryGetValue("CertificateTags", out tagsObj); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| config.JobProperties.TryGetValue(EntryParameters.PRESERVE_TAGS, out preserveTagsObj); | ||||||||||||||||||||
|
|
||||||||||||||||||||
| preserveTags = (bool)preserveTagsObj; | ||||||||||||||||||||
|
||||||||||||||||||||
| preserveTags = (bool)preserveTagsObj; | |
| preserveTags = preserveTagsObj as bool? ?? false; |
Copilot
AI
Sep 25, 2025
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.
Using .Result on async operations can cause deadlocks and blocks the thread. Consider making this method async and using await, or use GetAwaiter().GetResult() if async conversion is not possible.
Copilot
AI
Sep 25, 2025
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.
The cast as Dictionary<string, string> may fail silently if Properties.Tags is not actually a Dictionary<string, string>. Consider using a safer conversion method or checking the type first.
| existingTags = existing?.Properties.Tags as Dictionary<string, string> ?? new Dictionary<string, string>(); | |
| if (existing?.Properties.Tags is IDictionary<string, string> tagsDict) | |
| { | |
| existingTags = new Dictionary<string, string>(tagsDict); | |
| } | |
| else | |
| { | |
| existingTags = new Dictionary<string, string>(); | |
| } |
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.
The method signature change from
string tags = nulltoDictionary<string,string> tagsis a breaking change. Consider adding method overloads to maintain backward compatibility or make the parameter nullable withDictionary<string,string>? tags = null.