Skip to content
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

Merged
merged 10 commits into from
Jun 6, 2019
Merged

Conversation

schaabs
Copy link
Member

@schaabs schaabs commented Jun 3, 2019

No description provided.

@pakrym
Copy link
Contributor

pakrym commented Jun 3, 2019

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");
Copy link
Member

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
Copy link
Contributor

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" }));
Copy link
Contributor

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?

@AlexGhiondea
Copy link
Contributor

@schaabs can this be merged?

@schaabs schaabs merged commit 8e5dca3 into Azure:master Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants