mirror of https://github.com/hashicorp/consul
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
|
${ env('CONSUL_ACLS_LEGACY', false) ? `rpc error making call: rpc: can't find method ACL.Method` : `
|
||
|
[
|
||
|
${
|
||
|
range(
|
||
|
env(
|
||
|
'CONSUL_BINDING_COUNT',
|
||
|
Math.floor(
|
||
|
(
|
||
|
Math.random() * env('CONSUL_BINDING_MAX', 10)
|
||
|
) + parseInt(env('CONSUL_BINDING_MIN', 1))
|
||
|
)
|
||
|
)
|
||
|
).map(
|
||
|
function(item, i) {
|
||
|
return `
|
||
|
{
|
||
|
"Description": "${fake.lorem.sentence()}",
|
||
|
"IDPName": "${fake.hacker.noun()}-idp",
|
||
|
"Matches": [
|
||
|
${
|
||
|
range(env('CONSUL_MATCH_COUNT', 3)).map(
|
||
|
function(item, i) {
|
||
|
return `
|
||
|
{
|
||
|
"Selectors": [
|
||
|
${
|
||
|
range(env('CONSUL_SELECTOR_COUNT', fake.random.number({min: 1, max: 5}))).map(
|
||
|
function(item, i) {
|
||
|
return `"serviceaccount.name=${fake.hacker.noun()}"`;
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
`;
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
],
|
||
|
"RoleName": "${ fake.random.boolean() ? `role-{$i}` : `{{ serviceaccount.name }}`}",
|
||
|
"CreateIndex": 10,
|
||
|
"ModifyIndex": 10
|
||
|
}
|
||
|
`
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
]
|
||
|
`}
|