Skip to content

Commit

Permalink
Merge pull request #61 from travis-ci/ha-feature-prefer-https
Browse files Browse the repository at this point in the history
Put oauth_token only when config demands it
  • Loading branch information
BanzaiMan authored Feb 14, 2017
2 parents 32dd13f + 557b033 commit 2fc79fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/travis/scheduler/serialize/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Worker < Struct.new(:job, :config)
require 'travis/scheduler/serialize/worker/ssh_key'

def data
{
value = {
type: :test,
vm_type: repo.vm_type,
queue: job.queue,
Expand All @@ -23,8 +23,9 @@ def data
ssh_key: ssh_key,
timeouts: repo.timeouts,
cache_settings: cache_settings,
oauth_token: github_oauth_token
}
value[:oauth_token] = github_oauth_token if Travis.config.prefer_https?
value
end

private
Expand Down
6 changes: 2 additions & 4 deletions spec/travis/scheduler/serialize/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def encrypted(value)
hard_limit: 180 * 60, # worker handles timeouts in seconds
log_silence: 20 * 60
},
cache_settings: s3,
oauth_token: 'token'
cache_settings: s3
)
end

Expand Down Expand Up @@ -246,8 +245,7 @@ def encrypted(value)
hard_limit: 180 * 60, # worker handles timeouts in seconds
log_silence: 20 * 60
},
cache_settings: s3,
oauth_token: 'token'
cache_settings: s3
)
end

Expand Down

0 comments on commit 2fc79fa

Please sign in to comment.