2021-02-17 18:56:56 +00:00
|
|
|
[
|
|
|
|
${
|
|
|
|
range(
|
|
|
|
env(
|
|
|
|
'CONSUL_AUTH_METHOD_COUNT',
|
|
|
|
Math.floor(
|
|
|
|
(
|
|
|
|
Math.random() * env('CONSUL_AUTH_METHOD_MAX', 10)
|
|
|
|
) + parseInt(env('CONSUL_AUTH_METHOD_MIN', 1))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
).map(
|
|
|
|
function(item, i) {
|
|
|
|
return `
|
|
|
|
{
|
|
|
|
"Name": "${fake.hacker.noun()}-${i}",
|
|
|
|
${typeof location.search.ns !== 'undefined' ? `
|
|
|
|
"Namespace": "${location.search.ns}",
|
|
|
|
` : ``}
|
2021-09-15 18:50:11 +00:00
|
|
|
${typeof location.search.partition !== 'undefined' ? `
|
|
|
|
"Partition": "${location.search.partition}",
|
|
|
|
` : ``}
|
2021-03-17 14:40:56 +00:00
|
|
|
${env('CONSUL_NSPACES_ENABLE', false) ? `
|
2022-04-14 16:13:13 +00:00
|
|
|
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt', 'oidc', 'aws-iam'])}",
|
2021-03-17 14:40:56 +00:00
|
|
|
` : `
|
2022-04-14 16:13:13 +00:00
|
|
|
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt', 'aws-iam'])}",
|
2021-03-17 14:40:56 +00:00
|
|
|
`}
|
2021-02-17 18:56:56 +00:00
|
|
|
"Description": "${fake.lorem.sentence()}",
|
|
|
|
${i%2 ? `
|
|
|
|
"DisplayName": "${fake.hacker.noun()}-${i}",
|
|
|
|
` : `
|
|
|
|
"DisplayName": "",
|
|
|
|
`}
|
|
|
|
${i%2 ? `
|
|
|
|
"MaxTokenTTL": "${fake.random.number({min: 0, max: 60})}m${fake.random.number({min: 0, max: 60})}s",
|
|
|
|
` : `
|
|
|
|
`}
|
|
|
|
${i%2 ? `
|
|
|
|
"TokenLocality": "${fake.helpers.randomize(['local', 'global', ''])}",
|
|
|
|
` : `
|
|
|
|
`}
|
|
|
|
"CreateIndex": ${fake.random.number()},
|
|
|
|
"ModifyIndex": 10
|
|
|
|
}
|
|
|
|
`
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
]
|