-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Initial MSI credential implementation #6464
Conversation
As I understand live tests are hard to write for MSI, can we add mocking tests for this implementation? |
@@ -20,6 +20,8 @@ internal class IdentityClient | |||
{ | |||
private readonly IdentityClientOptions _options; | |||
private readonly HttpPipeline _pipeline; | |||
private readonly Uri ImdsEndptoint = new Uri("http://169.254.169.254/metadata/identity/oauth2/token"); |
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.
Should we consider allowing this to be overridden by environment or options?
|
||
namespace Azure.Identity.Tests.Mock | ||
{ | ||
class MockToken |
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.
nit: access modifier
Assert.AreEqual("tokenA", await provider.GetTokenAsync(new string[] { "scopeA" })); | ||
Assert.AreEqual("tokenB", await provider.GetTokenAsync(new string[] { "scopeB" })); | ||
Assert.AreEqual("tokenC", await provider.GetTokenAsync(new string[] { "scopeC" })); | ||
// await Assert.ThrowsAsync<InvalidOperationException>(async () => await provider.GetTokenAsync(new string[] { "scopeD" })); |
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.
Is this commented out by accident?
…nto identity-msi
@schaabs can this be merged? |
No description provided.