Skip to content

Support user defined auth method with configuration#975

Merged
Flanker32 merged 4 commits intodevelopfrom
hanxiao/authMethod
Jan 6, 2020
Merged

Support user defined auth method with configuration#975
Flanker32 merged 4 commits intodevelopfrom
hanxiao/authMethod

Conversation

@Flanker32
Copy link
Copy Markdown
Member

Support user defined auth method with configuration

@Flanker32 Flanker32 requested review from akaroml and andxu January 3, 2020 08:23
@@ -67,7 +51,6 @@ public static Azure getAzureClient(AuthConfiguration auth, String subscriptionId
Log.info(String.format(SUBSCRIPTION_TEMPLATE, subscription.displayName(), subscription.subscriptionId()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this piece of code to abstractazuremojo and record auth type, subscription id(in another PR)

for (final AuthType authType : AUTH_ORDER) {
try {
result = authType.getAzureToken(authConfiguration, azureEnvironment);
if (result != null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you call a light azure api to verify the auth credential?

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 3, 2020

Codecov Report

Merging #975 into develop will decrease coverage by 0.22%.
The diff coverage is 27.14%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #975      +/-   ##
=============================================
- Coverage      41.65%   41.42%   -0.23%     
- Complexity       778      780       +2     
=============================================
  Files            155      155              
  Lines           5587     5620      +33     
  Branches         784      786       +2     
=============================================
+ Hits            2327     2328       +1     
- Misses          3091     3124      +33     
+ Partials         169      168       -1
Impacted Files Coverage Δ Complexity Δ
...a/com/microsoft/azure/maven/AbstractAzureMojo.java 41.46% <0%> (-2.41%) 0 <0> (ø)
...microsoft/azure/maven/auth/AzureClientFactory.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...m/microsoft/azure/auth/configuration/AuthType.java 27.58% <25%> (-72.42%) 1 <0> (ø)
...java/com/microsoft/azure/auth/AzureAuthHelper.java 71.13% <41.37%> (-8.63%) 36 <3> (+2)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a33be7b...4b95db6. Read the comment docs.

.filter(authTypeEnum -> StringUtils.equalsAnyIgnoreCase(authTypeEnum.name(), authType))
.findFirst().orElse(null);
if (result == null) {
Log.warn(String.format(INVALID_AUTH_TYPE, authType, StringUtils.join(AuthType.values(), ", ")));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toLowerCase

@Flanker32 Flanker32 merged commit 04d2404 into develop Jan 6, 2020
@Flanker32 Flanker32 deleted the hanxiao/authMethod branch January 6, 2020 03:05
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 27.14286% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.42%. Comparing base (a33be7b) to head (4b95db6).
⚠️ Report is 4056 commits behind head on develop.

Files with missing lines Patch % Lines
...m/microsoft/azure/auth/configuration/AuthType.java 25.00% 21 Missing ⚠️
...java/com/microsoft/azure/auth/AzureAuthHelper.java 41.37% 14 Missing and 3 partials ⚠️
...a/com/microsoft/azure/maven/AbstractAzureMojo.java 0.00% 11 Missing ⚠️
...microsoft/azure/maven/auth/AzureClientFactory.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #975      +/-   ##
=============================================
- Coverage      41.65%   41.42%   -0.23%     
- Complexity       778      780       +2     
=============================================
  Files            155      155              
  Lines           5587     5620      +33     
  Branches         784      786       +2     
=============================================
+ Hits            2327     2328       +1     
- Misses          3091     3124      +33     
+ Partials         169      168       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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