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

in fails with UserToken #31

Closed
febinrejoe opened this issue Dec 27, 2018 · 2 comments
Closed

in fails with UserToken #31

febinrejoe opened this issue Dec 27, 2018 · 2 comments

Comments

@febinrejoe
Copy link

As per sonar documentation, using UserToken does not require a password and the curl command should look like,

curl -u THIS_IS_MY_TOKEN: https://sonarqube.com/api/user_tokens/search

However the in script adds the : only if source.password is provided. This causes the curl to prompt for a password.

I believe this can be fixed as below.

if [[ ! -z "${sonar_login}" ]] && [[ "${sonar_login}" != "" ]]; then
  sonar_token="${sonar_login}:"
  if [[ ! -z "${sonar_password}" ]] && [[ "${sonar_password}" != "" ]]; then
    sonar_token+="${sonar_password}"
  fi
fi

Let me know, I am willing to create a PR.

@headcr4sh
Copy link
Member

Good catch. I think you are right. PR will be gladly accepted.

@febinrejoe
Copy link
Author

Thanks @headcr4sh I have created #32

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

No branches or pull requests

2 participants