-
Notifications
You must be signed in to change notification settings - Fork 492
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
fix(dps-service): Remove client side validation of x509 CA references format #2172
Changes from 1 commit
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 |
---|---|---|
|
@@ -42,11 +42,6 @@ public class X509CAReferences | |
[JsonConstructor] | ||
internal X509CAReferences(string primary, string secondary = null) | ||
{ | ||
/* SRS_X509_CAREFERENCE_21_001: [The constructor shall throw ArgumentException if the primary CA reference is null or empty.] */ | ||
if(string.IsNullOrWhiteSpace(primary)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In which scenario would we expect this to happen, i.e. all CA refs to be empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had a conversation with the DPS service folks and they confirmed both CA references can be null if the enrollment group is using symmetric keys, client certificates or signing certificates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Primary and secondary are the only properties on this class. If both are null, then is there a valid case for this type even being initialized, i.e. if the enrollment group is using symmetric keys, client certificates or signing certificates => these refs are null but we'd still expect X509CAReferences to be initialized? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may be better for the service not to return the CA references object if all its contents are null, sure. However, the SDK appears to be receiving them from the service in cases like that anyways. |
||
{ | ||
throw new ProvisioningServiceClientException("Primary CA reference cannot be null or empty"); | ||
} | ||
/* SRS_X509_CAREFERENCE_21_002: [The constructor shall store the primary and secondary CA references.] */ | ||
Primary = primary; | ||
Secondary = secondary; | ||
|
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.
You'd need to clean up the param note about it not being allowed to be null or empty.