mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18: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
|
|
@ -15,7 +15,11 @@ module Vmpooler
|
|||
end
|
||||
|
||||
def validate_token(backend)
|
||||
return if valid_token?(backend)
|
||||
if valid_token?(backend)
|
||||
backend.hset('vmpooler__token__' + request.env['HTTP_X_AUTH_TOKEN'], 'last', Time.now)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
content_type :json
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue