Extend Native AOT support for PKI management APIs#1
Merged
Conversation
- Fix enum JsonConverter attributes to use generic JsonStringEnumConverter<T> under NET8_0_OR_GREATER for AOT safety (IssuerFormat, IssuerPrivateKeyFormat, PrivateKeyType, PrivateKeyRoleType), with non-generic fallback for older TFMs - Rename IssuerPrivetKeyFormat.cs -> IssuerPrivateKeyFormat.cs (typo fix) - Add JsonSerializable registrations in VaultSharpJsonContext for all new PKI Issuers/Keys/Roles request and response types; use TypeInfoPropertyName to disambiguate KeysData and KeyInfo which exist in both Issuers and Keys namespaces
Copilot
AI
changed the title
[WIP] Amend Native AOT support for .NET 8+
Extend Native AOT support for PKI management APIs
Jul 4, 2026
bbartels
marked this pull request as ready for review
July 4, 2026 14:52
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The upstream PKI management commit (
rajanadar/VaultSharp@8cb298c) added Issuers/Keys/Roles APIs whose types were not covered by the existing Native AOT source-generation context, and whose enum converters used the reflection-based non-genericJsonStringEnumConverter.Enum converters
Four new PKI enums updated to use the AOT-safe generic form under
NET8_0_OR_GREATER, preserving the non-generic fallback for older TFMs — matching the pattern already established in the PR forCertificateFormat,PrivateKeyFormat, etc.:Affected:
IssuerFormat,IssuerPrivateKeyFormat,PrivateKeyType,PrivateKeyRoleType.VaultSharpJsonContextregistrationsAdded
[JsonSerializable]entries for all new PKI request/response types:Secret<IssuerResponseData>,Secret<IssuerConfigResponseData>,Secret<IssuerData>,Secret<KeysData>, plus bare DTO typesIssuerData,IssuerConfigRequestData,IssuerConfigResponseData,IssuerResponseDataSecret<KeysData>,Secret<KeyData>,Secret<ImportKeyData>, plus bareKeyData,ImportKeyDataSecret<RolesData>,Secret<RoleData>, plus bareRoleData,RolesDataDictionary<string, KeyInfo>variants for both namespacesKeysDataandKeyInfoeach exist in bothIssuersandKeysnamespaces; all four are disambiguated withTypeInfoPropertyNameto avoid source-gen naming conflicts.File rename
IssuerPrivetKeyFormat.cs→IssuerPrivateKeyFormat.cs(typo; type nameIssuerPrivateKeyFormatwas already correct).