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

Remove spurious truthiness checks on serverSecrets #2634

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/azure-devops/azure-devops-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function render({ status }) {

function getHeaders() {
const headers = {}
if (serverSecrets && serverSecrets.azure_devops_token) {
if (serverSecrets.azure_devops_token) {
const pat = serverSecrets.azure_devops_token
const auth = Buffer.from(`:${pat}`).toString('base64')
headers.Authorization = `basic ${auth}`
Expand Down
2 changes: 1 addition & 1 deletion services/bintray/bintray.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = class Bintray extends LegacyService {
},
}

if (serverSecrets && serverSecrets.bintray_user) {
if (serverSecrets.bintray_user) {
options.auth = {
user: serverSecrets.bintray_user,
pass: serverSecrets.bintray_apikey,
Expand Down
2 changes: 1 addition & 1 deletion services/jenkins/jenkins-build.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = class JenkinsBuild extends LegacyService {
options.uri = `${scheme}://${host}/${job}/api/json?tree=color`
}

if (serverSecrets && serverSecrets.jenkins_user) {
if (serverSecrets.jenkins_user) {
options.auth = {
user: serverSecrets.jenkins_user,
pass: serverSecrets.jenkins_pass,
Expand Down
2 changes: 1 addition & 1 deletion services/jenkins/jenkins-coverage.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BaseJenkinsCoverage extends BaseJsonService {
tree: treeParam,
},
}
if (serverSecrets && serverSecrets.jenkins_user) {
if (serverSecrets.jenkins_user) {
options.auth = {
user: serverSecrets.jenkins_user,
pass: serverSecrets.jenkins_pass,
Expand Down
2 changes: 1 addition & 1 deletion services/jenkins/jenkins-tests.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = class JenkinsTests extends LegacyService {
)}`
}

if (serverSecrets && serverSecrets.jenkins_user) {
if (serverSecrets.jenkins_user) {
options.auth = {
user: serverSecrets.jenkins_user,
pass: serverSecrets.jenkins_pass,
Expand Down
5 changes: 1 addition & 4 deletions services/jira/jira-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module.exports = class JiraBase extends BaseJsonService {
async fetch({ url, qs, schema, errorMessages }) {
const options = { qs }

if (
serverSecrets &&
(serverSecrets.jira_user || serverSecrets.jira_username)
) {
if (serverSecrets.jira_user || serverSecrets.jira_username) {
/*
for legacy reasons we still allow
jira_username, jira_password
Expand Down
2 changes: 1 addition & 1 deletion services/nexus/nexus.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ module.exports = class Nexus extends BaseJsonService {

const options = { qs }

if (serverSecrets && serverSecrets.nexus_user) {
if (serverSecrets.nexus_user) {
options.auth = {
user: serverSecrets.nexus_user,
pass: serverSecrets.nexus_pass,
Expand Down
2 changes: 1 addition & 1 deletion services/sensiolabs/sensiolabs.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = class Sensiolabs extends LegacyService {
},
}

if (serverSecrets && serverSecrets.sl_insight_userUuid) {
if (serverSecrets.sl_insight_userUuid) {
options.auth = {
user: serverSecrets.sl_insight_userUuid,
pass: serverSecrets.sl_insight_apiToken,
Expand Down
2 changes: 1 addition & 1 deletion services/sonarqube/sonarqube.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = class Sonarqube extends LegacyService {
Accept: 'application/json',
},
}
if (serverSecrets && serverSecrets.sonarqube_token) {
if (serverSecrets.sonarqube_token) {
options.auth = {
user: serverSecrets.sonarqube_token,
}
Expand Down
2 changes: 1 addition & 1 deletion services/teamcity/teamcity-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = class TeamCityBase extends BaseJsonService {
const url = `${protocol}://${hostAndPath}/${apiPath}`
const options = { qs }
// JetBrains API Auth Docs: https://confluence.jetbrains.com/display/TCD18/REST+API#RESTAPI-RESTAuthentication
if (serverSecrets && serverSecrets.teamcity_user) {
if (serverSecrets.teamcity_user) {
options.auth = {
user: serverSecrets.teamcity_user,
pass: serverSecrets.teamcity_pass,
Expand Down