mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Track token use times
* rename the Redis token 'timestamp' var to 'created' * update the Redis token 'last' var when token is successfully validataed * expose the Redis token 'last' var in GET /token route
This commit is contained in:
parent
ce158d9fec
commit
89ce70dba9
3 changed files with 31 additions and 14 deletions
|
|
@ -49,7 +49,7 @@ describe Vmpooler::API::V1 do
|
|||
|
||||
it 'returns a list of tokens if authed' do
|
||||
expect(redis).to receive(:keys).with('vmpooler__token__*').and_return(["vmpooler__token__abc"])
|
||||
expect(redis).to receive(:hgetall).with('vmpooler__token__abc').and_return({"user" => "admin", "timestamp" => "now"})
|
||||
expect(redis).to receive(:hgetall).with('vmpooler__token__abc').and_return({"user" => "admin", "created" => "now"})
|
||||
|
||||
authorize 'admin', 's3cr3t'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue