-
Notifications
You must be signed in to change notification settings - Fork 281
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
port:[#3906] Port Managed Identity (MSI) + Single Tenant from DotNet #3923
port:[#3906] Port Managed Identity (MSI) + Single Tenant from DotNet #3923
Conversation
Pull Request Test Coverage Report for Build 1279572164
💛 - Coveralls |
libraries/botframework-connector/src/auth/authenticationConfiguration.ts
Outdated
Show resolved
Hide resolved
libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityAppCredentials.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityServiceClientCredentialsFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityAuthenticator.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/parameterizedBotFrameworkAuthentication.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/passwordServiceClientCredentialFactory.ts
Outdated
Show resolved
Hide resolved
@@ -40,7 +40,8 @@ | |||
"update-versions": "yarn workspace botbuilder-repo-utils update-versions" | |||
}, | |||
"devDependencies": { | |||
"@azure/ms-rest-js": "1.9.0", | |||
"@azure/logger": "^1.0.2", | |||
"@azure/ms-rest-js": "1.9.1", |
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.
This also should likely be reconciled with whatever package(s) it's used in. Why was this updated?
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.
For consistency with other uses of the same dependency. We can revert it if you deem it so
…://github.com/southworks/botbuilder-js into southworks/add/port-msi-single-tenant-support
…b.com:southworks/botbuilder-js into southworks/add/port-msi-single-tenant-support
libraries/botframework-connector/src/auth/jwtTokenProviderFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/passwordServiceClientCredentialFactory.ts
Show resolved
Hide resolved
…b.com:southworks/botbuilder-js into southworks/add/port-msi-single-tenant-support
…it tests to validate
…-tenant-support' into southworks/add/port-msi-single-tenant-support
libraries/botframework-connector/src/auth/managedIdentityAppCredentials.ts
Outdated
Show resolved
Hide resolved
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.
Little more feedback here, it's looking solid though. I pulled the branch and understand the root package.json
changes better now, thanks for your patience while I convinced myself those changes were necessary.
libraries/botframework-connector/src/auth/parameterizedBotFrameworkAuthentication.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityServiceClientCredentialsFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityAuthenticator.ts
Show resolved
Hide resolved
libraries/botframework-connector/tests/auth/managedIdentityAuthenticator.test.js
Outdated
Show resolved
Hide resolved
@joshgummersall Thank you for your feedback, we just pushed some changes, let us know if we can improve anything else 🤗(hug). |
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 Identity team released @azure/identity@2.0.0-beta.6
which contains a few breaking changes that I don't believe affects the changes in this PR nor the rest of the botframework-connector
package. That said, would you bump @azure/identity to this current next
version and vet the contents of this PR again?
libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts
Show resolved
Hide resolved
Updated the |
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.
One final set of feedback
libraries/botframework-connector/src/auth/managedIdentityAppCredentials.ts
Show resolved
Hide resolved
libraries/botbuilder-core/src/configurationServiceClientCredentialFactory.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/parameterizedBotFrameworkAuthentication.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/parameterizedBotFrameworkAuthentication.ts
Outdated
Show resolved
Hide resolved
/** | ||
* The Government V1 Azure AD token issuer URL template that will contain the tenant id where the token was issued from. | ||
*/ | ||
export const ValidGovernmentTokenIssuerUrlTemplateV1 = 'https://login.microsoftonline.us/'; | ||
|
||
/** | ||
* The Government V2 Azure AD token issuer URL template that will contain the tenant id where the token was issued from. | ||
*/ | ||
export const ValidGovernmentTokenIssuerUrlTemplateV2 = 'https://login.microsoftonline.us/'; |
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.
Shouldn't this be in the GovernmentConstants
instead? @msomanathan
It's not a big deal, but historically all of the US Gov Cloud related constants are stored in a separate file. My main concern is the v4-to-v5 work and making sure our ducks are in a row.
I did note that this is a verbatim port from .NET.
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.
Filed microsoft/botframework-sdk#6384 for tracking.
libraries/botframework-connector/src/auth/jwtTokenProviderFactoryInterface.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/jwtTokenProviderFactoryInterface.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityAppCredentials.ts
Show resolved
Hide resolved
libraries/botframework-connector/src/auth/managedIdentityAuthenticator.ts
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/tests/auth/managedIdentityAuthenticator.test.js
Outdated
Show resolved
Hide resolved
libraries/botframework-connector/tests/auth/managedIdentityAuthenticator.test.js
Outdated
Show resolved
Hide resolved
...ies/botframework-connector/tests/auth/managedIdentityServiceClientCredentialsFactory.test.js
Outdated
Show resolved
Hide resolved
...ies/botframework-connector/tests/auth/managedIdentityServiceClientCredentialsFactory.test.js
Outdated
Show resolved
Hide resolved
...ies/botframework-connector/tests/auth/managedIdentityServiceClientCredentialsFactory.test.js
Outdated
Show resolved
Hide resolved
@stevengum Thank you for the feedback, we just pushed the changes. |
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, pending test pass!
Fixes #3906
Description
This PR ports the Managed Identity (MSI) and Single Tenant functionalities from DotNet.
Specific Changes
ConfigurationServiceClientCredentialFactory
to support the three MultiTenant, SingleTenant and MSI functionalities.botbuilder-dialogs-adaptive-runtime
andbotframework-connector
libraries.JwtTokenProviderFactory
class that will be used to instantiate theDefaultAzureCredential
class from@azure/identity
.ManagedIdentityAppCredentials
class by extending fromAppCredentials
and be able to get the jwt token.ManagedIdentityAuthenticator
that will be in charge of creating the token provider and gather the token from it.ManagedIdentityServiceClientCredentialsFactory
class Factory in charge of creating theManagedIdentityAppCredentials
.botframework-connector
@azure/identity@2.0.0-beta.6
root
@azure/logger@1.0.2
@azure/ms-rest-js@1.9.1
Testing
The following image shows some new added unit tests passing successfully.
Troubleshooting
@azure/identity
1.5.2
) we started gettingUnexpected character...
error on thekeytar
dependency when runningyarn build
.keytar
which will not be included in the base package in the2.0.0
release.https://github.com/Azure/azure-sdk-for-js/issues/14852#issuecomment-818915410
1.5.2
we use2.0.0-beta.6
and no issues were shown, and the build was successful.@azure/logger
@azure/identity
library.@azure/logger
library in the@azure/identity
. This is caused by the browser configuration property set in the@azure/logger
library.@azure/identity
wasn't installing.@azure/logger
into the rootpackage.json
and setting the minimum version of^1.0.2
solved the issue when building with browserify.