mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Don't require username/password authentication for GET /token/:token route
This commit is contained in:
parent
e0356968df
commit
d74c9ff512
3 changed files with 2 additions and 17 deletions
|
|
@ -127,19 +127,11 @@ describe Vmpooler::API::V1 do
|
|||
]
|
||||
} }
|
||||
|
||||
it 'returns a 401 if not authed' do
|
||||
get "#{prefix}/token/this"
|
||||
|
||||
expect_json(ok = false, http = 401)
|
||||
end
|
||||
|
||||
it 'returns a token if authed' do
|
||||
it 'returns a token' do
|
||||
expect(redis).to receive(:hgetall).with('vmpooler__token__this').and_return({'user' => 'admin'})
|
||||
expect(redis).to receive(:smembers).with('vmpooler__running__pool1').and_return(['vmhostname'])
|
||||
expect(redis).to receive(:hget).with('vmpooler__vm__vmhostname', 'token:token').and_return('this')
|
||||
|
||||
authorize 'admin', 's3cr3t'
|
||||
|
||||
get "#{prefix}/token/this"
|
||||
|
||||
expect(JSON.parse(last_response.body)['ok']).to eq(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue