open-consul/ui/packages/consul-ui/mock-api/v1/acl/list
John Cowen 5875e4b15b
ui: Move mocks into the ui project (#9084)
* Add consul-api-double under api

* Update config to reflect api change

* Remove consul-api-double as a dependency

* api -> mock-api

* Fixup mocks path for staging
2020-11-05 16:03:49 +00:00

72 lines
1.5 KiB
Plaintext

${
env('CONSUL_ENABLE_ACLS', 1) ? `
[
${
(count = env(
'CONSUL_ACL_COUNT',
Math.floor(
(
Math.random() * env('CONSUL_ACL_MAX', 10)
) + parseInt(env('CONSUL_ACL_MIN', 2))
)
)) >= 2 ? `
{
"ID":"anonymous",
"Name":"Anonymous Token",
"Type":"client",
"Rules":"",
"CreateIndex":4,
"ModifyIndex":4
},
{
"ID":"secret",
"Name":"Master Token",
"Type":"management",
"Rules":"",
"CreateIndex":5,
"ModifyIndex":5
}${count > 2 ? "," : ""}
${
range(
Math.max(0, count - 2)
).map(
function(item, i) {
return `{
"ID":"${fake.lorem.word()}-${i}",
"Name":"${fake.lorem.word()}-${i}",
"Type":"client",
"Rules":"",
"CreateIndex":5,
"ModifyIndex":5
}`;
}
)
}` : `
${
range(
env(
'CONSUL_ACL_COUNT',
Math.floor(
(
Math.random() * env('CONSUL_ACL_MAX', 10)
) + parseInt(env('CONSUL_ACL_MIN', 1))
)
)
).map(
function(item, i) {
return `{
"ID":"${fake.lorem.word()}-${i}",
"Name":"${fake.lorem.word()}-${i}",
"Type":"client",
"Rules":"",
"CreateIndex":5,
"ModifyIndex":5
}`;
}
)
}
`}
]
` : "ACL support disabled"
}