-
Notifications
You must be signed in to change notification settings - Fork 86
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
SCANJLIB-230 Add warning when sonar.login (and sonar.token simultaneo… #221
Conversation
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.
I have a small doubt regarding the messages mentioning properties keys. In practice, users can set the token also using the env variable SONAR_TOKEN
. So mentioning they defined sonar.token
might be confusing.
Either we should "remember" the source of the token (maybe not an easy task), or every message should mention both?
lib/src/main/java/org/sonarsource/scanner/lib/internal/http/HttpConfig.java
Outdated
Show resolved
Hide resolved
lib/src/test/java/org/sonarsource/scanner/lib/ScannerEngineBootstrapperTest.java
Outdated
Show resolved
Hide resolved
lib/src/main/java/org/sonarsource/scanner/lib/ScannerEngineBootstrapper.java
Outdated
Show resolved
Hide resolved
lib/src/test/java/org/sonarsource/scanner/lib/internal/http/HttpConfigTest.java
Outdated
Show resolved
Hide resolved
b229bba
to
5db6b5e
Compare
|
|
So to sum up, we have a different behavior in the scanner bootstrapper than in the current scanner engine, right?
I don't think this is a big deal, since this has been deprecated for a long time, and we are even dropping username/password in the next SQS release. |
Yes, that's right. |
SCANJLIB-230
…usly) is used
I have determined the SonarQube Server version when the sonar.token property was introduced from the fix version of the following task.
How to test?
Run the scanner with both the sonar.token and sonar.login properties set, the following two warnings should be displayed in the logs:
11:28:24.316 WARN Both 'sonar.login' and 'sonar.token' (or the 'SONAR_TOKEN' env variable) are set, but only the latter will be used.
11:28:24.680 WARN Use of 'sonar.login' property has been deprecated in favor of 'sonar.token' (or the env variable alternative 'SONAR_TOKEN'). Please use the latter when passing a token.
However, to discuss:
As for this point of the task: ensure that token effectively has priority over basic auth (also check in the scanner engine of SQS and SQC)
ScannerWsClientProvider.java
in sonarqube - if the login property is present, it is not overriden).