-
Notifications
You must be signed in to change notification settings - Fork 24
Token integration tests, use http scheme when testing locally #90
base: dev
Are you sure you want to change the base?
Conversation
|
I can't add reviewers for some reason, so I'll just tag you here |
cgillum
left a comment
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.
These changes look good to me, though I don't fully understand how the tests are being run. :) A couple questions that would be helpful for me as a rookie reviewer:
- Do these tests execute any binding logic, or just the ADAL calls?
- How are the tests actually being run? Said another way, what does
TestHelpers.RunTestAsync<T>do?
| INameResolver nameResolver = GetValidSettingsForTests(); | ||
| IAadClient aadClient = new AadClient(nameResolver); | ||
|
|
||
| var methodInfo = typeof(RealTokenFunctions).GetMethod("ClientCredentials"); |
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.
methodInfo is not used here or in several tests below. Can these lines be deleted?
|
@cgillum This JobHost then calls whatever method was passed to RunTestAsync. In the three tests I added, the method is ClientCredentials (in the RealTokenFunctions class). That function has a Token binding, which follows the normal client credentials flow to get a real token. Similar to the discussion we had yesterday about the Graph binding tests, appsettings.json needs four things: a client ID, client secret, open ID issuer, and hostname. To avoid checking in secrets, I left all of these blank. Since we want these to run as part of CI, I'm not really sure where to store/retrieve the secret. |
Token integration tests rely on new appsettings.json file. The valid token path requires a proper client ID, client secret, issuer, and hostname. These tests focus on the token from client credentials path currently. We can add more once we decide on which token retrieval methods we want to expose for the GA token binding.
This PR also allows for the EasyAuthTokenClient to use HTTP to call /.auth endpoints. This is only useful/allowed during local testing.