-
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
Move node clients from msal-common
to msal-node
#5788
Move node clients from msal-common
to msal-node
#5788
Conversation
import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse"; | ||
import { IAppTokenProvider } from "../config/AppTokenProvider"; | ||
import { UrlString } from "../url/UrlString"; | ||
import { ClientConfiguration } from "@azure/msal-common/src/config/ClientConfiguration"; |
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.
Are we doing package
based imports now?
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.
No we should not do this, these things should be exported from msal-common if not already.
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.
That is what I thought. And this is common pattern across the board, to export the files from msal-common
and not the pre-compiled package. @konstantin-msft why the change??
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.
+1, I think the reason most of these aren't exported already is because none of the client classes were implemented at the wrapper library level. Having to export all of these common classes may be an argument against factoring the confidential clients out.
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.
My bad. Fixed imports, thank you.
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.
Please update the import
paths
@konstantin-msft think we should probably relocate this doc to msal-node side as well (and maybe rename it to |
Reminder: The next release is scheduled for next week and this PR appears to be stale :( If changes have been requested please address feedback. |
946a743
to
c99aa06
Compare
Codecov Report
|
44bcbe3
to
a5a5e85
Compare
That's a very good point. Thank you Dogan! |
Done. |
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.
Looks good. Just as a general comment; we've been making a lot of major bumps of common lately (which is fine!) and it seems like with this change msal-node will be taking on an even heavier dependency on msal-common APIs, which were previously abstracted away from it. We recently discussed our versioning strategy with regards to common and it may be time to revisit that and seriously consider some of the ideas folks had (i.e. pin dependencies to a specific version or stop publishing it as a separate package and bundle it in with the public packages)
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.
Approved, with a few formatting comments
@@ -0,0 +1,6 @@ | |||
MSAL will return an `AuthenticationResult.ts` object as a response to all acquire token APIs: |
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.
Add heading here?
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.
Good catch, done
@@ -1,19 +1,36 @@ | |||
import { ConfidentialClientApplication } from './../../src/client/ConfidentialClientApplication'; | |||
import { ClientConfiguration, AuthorizationCodeClient, RefreshTokenClient, AuthenticationResult, ClientCredentialClient, OnBehalfOfClient, UsernamePasswordClient } from '@azure/msal-common'; | |||
import { |
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.
Combine imports from src with imports below?
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.
fixed.
import { PublicClientApplication } from './../../src/client/PublicClientApplication'; | ||
import { Configuration, ILoopbackClient, InteractiveRequest } from './../../src/index'; | ||
import { PublicClientApplication } from '../../src'; | ||
import { Configuration, DeviceCodeClient, ILoopbackClient, InteractiveRequest } from '../../src'; |
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.
Combine src
imports?
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.
fixed.
import { ID_TOKEN_CLAIMS, mockAuthenticationResult, TEST_CONSTANTS, TEST_DATA_CLIENT_INFO } from '../utils/TestConstants'; | ||
import { | ||
ClientConfiguration, AuthenticationResult, AuthorizationCodeClient, RefreshTokenClient, UsernamePasswordClient, | ||
SilentFlowClient, ProtocolMode, Logger, LogLevel, ClientAuthError, AccountInfo, ServerAuthorizationCodeResponse | ||
ClientConfiguration, |
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.
Same as above
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.
fixed.
import { AuthorizationUrlRequest } from "../../src/request/AuthorizationUrlRequest"; | ||
import { UsernamePasswordRequest } from '../../src/request/UsernamePasswordRequest'; | ||
import { SilentFlowRequest } from '../../src/request/SilentFlowRequest'; | ||
import { |
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.
Same as above
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.
fixed.
I would say with this PR |
- Fix unit tests.
- Moved/updated docs.
- Beautify imports.
c307187
to
f1eb1ac
Compare
requested changes are already addressed
1. Move 4 clients used only by `msal-node` from `msal-common` to `msal-node`. - ClientCredentialClient - DeviceCodeClient - OnBehalfOfClient - UsernamePasswordClient 2. Move `request` and part of `response` docs from `msal-common` to `msal-node`. 3. Update references.
1. Move 4 clients used only by `msal-node` from `msal-common` to `msal-node`. - ClientCredentialClient - DeviceCodeClient - OnBehalfOfClient - UsernamePasswordClient 2. Move `request` and part of `response` docs from `msal-common` to `msal-node`. 3. Update references.
🎉 Handy links: |
🎉 Handy links: |
msal-node
frommsal-common
tomsal-node
.request
and part ofresponse
docs frommsal-common
tomsal-node
.