2021-02-17 18:56:56 +00:00
|
|
|
import Model, { attr } from '@ember-data/model';
|
|
|
|
import { or } from '@ember/object/computed';
|
2021-04-07 16:43:04 +00:00
|
|
|
import parse from 'parse-duration';
|
|
|
|
import { computed } from '@ember/object';
|
2021-02-17 18:56:56 +00:00
|
|
|
|
|
|
|
export const PRIMARY_KEY = 'uid';
|
|
|
|
export const SLUG_KEY = 'Name';
|
|
|
|
|
|
|
|
export default class AuthMethod extends Model {
|
|
|
|
@attr('string') uid;
|
|
|
|
@attr('string') Name;
|
|
|
|
|
|
|
|
@attr('string') Datacenter;
|
|
|
|
@attr('string') Namespace;
|
2021-09-15 18:50:11 +00:00
|
|
|
@attr('string') Partition;
|
2021-02-17 18:56:56 +00:00
|
|
|
@attr('string', { defaultValue: () => '' }) Description;
|
|
|
|
@attr('string', { defaultValue: () => '' }) DisplayName;
|
|
|
|
@attr('string', { defaultValue: () => 'local' }) TokenLocality;
|
|
|
|
@attr('string') Type;
|
2021-03-31 14:55:31 +00:00
|
|
|
@attr() NamespaceRules;
|
2021-02-17 18:56:56 +00:00
|
|
|
@or('DisplayName', 'Name') MethodName;
|
|
|
|
@attr() Config;
|
|
|
|
@attr('string') MaxTokenTTL;
|
|
|
|
@attr('number') CreateIndex;
|
|
|
|
@attr('number') ModifyIndex;
|
|
|
|
@attr() Datacenters; // string[]
|
|
|
|
@attr() meta; // {}
|
2021-04-07 16:43:04 +00:00
|
|
|
|
|
|
|
@computed('MaxTokenTTL')
|
|
|
|
get TokenTTL() {
|
|
|
|
return parse(this.MaxTokenTTL);
|
|
|
|
}
|
2021-02-17 18:56:56 +00:00
|
|
|
}
|