-
Notifications
You must be signed in to change notification settings - Fork 139
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
Use auth-helper to auth webapp&functions. #843
Conversation
2. Use auth-helper to auth webapp&functions.
Codecov Report
@@ Coverage Diff @@
## develop #843 +/- ##
=============================================
- Coverage 45.08% 44.55% -0.54%
+ Complexity 768 765 -3
=============================================
Files 133 134 +1
Lines 5119 5169 +50
Branches 729 742 +13
=============================================
- Hits 2308 2303 -5
- Misses 2640 2692 +52
- Partials 171 174 +3
Continue to review full report at Codecov.
|
@@ -0,0 +1,43 @@ | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
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.
Why we move the resources to spring-cloud-maven-common
?
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.
Done
if (this.settings.getServer(auth.getServerId()) != null) { | ||
try { | ||
auth = MavenSettingHelper.getAuthConfigurationFromServer(session, settingsDecrypter, auth.getServerId()); | ||
} catch (MavenDecryptException e) { | ||
throw new AzureAuthFailureException(e.getMessage()); | ||
} | ||
} else { | ||
throw new AzureAuthFailureException(String.format("Unable to get server('%s') from settings.xml.", auth.getServerId())); | ||
} | ||
} | ||
|
||
final List<ConfigurationProblem> problems = auth.validate(); | ||
if (problems.stream().anyMatch(problem -> problem.getSeverity() == Severity.ERROR)) { | ||
throw new AzureAuthFailureException(String.format("Unable to validate auth configuration due to the following errors: %s", | ||
problems.stream().map(ConfigurationProblem::getErrorMessage).collect(Collectors.joining("\n")))); | ||
} |
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.
Shall we move the check of server id as well as the validation to MavenSettingHelper.getAuthConfigurationFromServer
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 be done later
Use auth-helper to auth webapp&functions.