2018-09-25 16:28:26 +00:00
|
|
|
import { match } from '@ember/object/computed';
|
2018-04-03 14:16:57 +00:00
|
|
|
import DS from 'ember-data';
|
2018-10-17 03:10:41 +00:00
|
|
|
import KeyMixin from 'vault/mixins/key-mixin';
|
2018-04-03 14:16:57 +00:00
|
|
|
const { attr } = DS;
|
|
|
|
|
|
|
|
/* sample response
|
|
|
|
{
|
|
|
|
"id": "auth/token/create/25c75065466dfc5f920525feafe47502c4c9915c",
|
|
|
|
"issue_time": "2017-04-30T10:18:11.228946471-04:00",
|
|
|
|
"expire_time": "2017-04-30T11:18:11.228946708-04:00",
|
|
|
|
"last_renewal": null,
|
|
|
|
"renewable": true,
|
|
|
|
"ttl": 3558
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
export default DS.Model.extend(KeyMixin, {
|
|
|
|
issueTime: attr('string'),
|
|
|
|
expireTime: attr('string'),
|
|
|
|
lastRenewal: attr('string'),
|
|
|
|
renewable: attr('boolean'),
|
|
|
|
ttl: attr('number'),
|
2018-09-25 16:28:26 +00:00
|
|
|
isAuthLease: match('id', /^auth/),
|
2018-04-03 14:16:57 +00:00
|
|
|
});
|