Module: Conjur::API::TokenExpiration
Constant Summary collapse
- TOKEN_STALE =
The four minutes is to work around a bug in Conjur < 4.7 causing a 404 on long-running operations (when the token is used right around the 5 minute mark).
4.minutes
Instance Attribute Summary collapse
-
#token_born ⇒ Object
Returns the value of attribute token_born.
Instance Method Summary collapse
Methods included from MonotonicTime
Instance Attribute Details
#token_born ⇒ Object
Returns the value of attribute token_born.
171 172 173 |
# File 'lib/conjur/base.rb', line 171 def token_born @token_born end |
Instance Method Details
#needs_token_refresh? ⇒ Boolean
173 174 175 |
# File 'lib/conjur/base.rb', line 173 def needs_token_refresh? token_age > TOKEN_STALE end |
#token_age ⇒ Object
177 178 179 |
# File 'lib/conjur/base.rb', line 177 def token_age gettime - token_born end |