github.com/hernad/nomad@v1.6.112/ui/mirage/factories/policy.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { Factory } from 'ember-cli-mirage'; 7 import faker from 'nomad-ui/mirage/faker'; 8 9 export default Factory.extend({ 10 id: () => faker.hacker.verb(), 11 name() { 12 return this.id; 13 }, 14 description: () => (faker.random.number(10) >= 2 ? faker.lorem.sentence() : null), 15 rules: `# Allow read only access to the default namespace 16 namespace "default" { 17 policy = "read" 18 } 19 20 node { 21 policy = "read" 22 }`, 23 rulesJSON: () => ({ 24 Node: { 25 Policy: 'read', 26 }, 27 }), 28 });