-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
MSAL-Node Configuration: Refactoring to remove the ambiguity for deeply nested properties #7221
Labels
confidential-client
Issues regarding ConfidentialClientApplications
msal-node
Related to msal-node package
Comments
Robbie-Microsoft
added
question
Customer is asking for a clarification, use case or information.
feature-unconfirmed
labels
Jul 25, 2024
microsoft-github-policy-service
bot
added
the
Needs: Attention 👋
Awaiting response from the MSAL.js team
label
Jul 25, 2024
github-actions
bot
added
confidential-client
Issues regarding ConfidentialClientApplications
msal-node
Related to msal-node package
labels
Jul 25, 2024
2 tasks
Robbie-Microsoft
removed
question
Customer is asking for a clarification, use case or information.
Needs: Attention 👋
Awaiting response from the MSAL.js team
feature-unconfirmed
labels
Jul 25, 2024
Sounds good to me to eliminate a source of confusion like this. But how can you "refactor this spread operator functionality" ? |
@bgavrilMS, I should have worded it better. I meant to say "refactor this functionality, in general". For example, one solution would be to not use spread here, and instead write a short algorithm for merging that ignores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confidential-client
Issues regarding ConfidentialClientApplications
msal-node
Related to msal-node package
Core Library
MSAL Node (@azure/msal-node)
Wrapper Library
Not Applicable
Public or Confidential Client?
Confidential
Description
In TypeScript, the spread operator does not ignore undefined values.
For example, as it relates to msal-node, when building the configuration for an application:
Assuming
DEFAULT_AUTH_OPTIONS.clientCertificate: { thumbprint: Constants.EMPTY_STRING, thumbprintSha256: Constants.EMPTY_STRING, privateKey: Constants.EMPTY_STRING, x5c: Constants.EMPTY_STRING, }
and
auth.clientCertificate = undefined
(can be undefined as long as clientSecret or clientAssertion is defined)Then after
auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
,We want
auth.clientCertificate
to be equal toDEFAULT_AUTH_OPTIONS.clientCertificate
. However, it's equal toundefined
.This is apparently expected behavior in TypeScript, but is not desired behavior in our case. Therefore, we need to refactor this spread operator functionality here and wherever else it's used when we want to ignore
undefined
values.Please see this discussion for additional context.
Source
Internal (Microsoft)
The text was updated successfully, but these errors were encountered: