Update service-topology mock data with new attributes: TransparentProxy, DefaultAllow, WildcardIntention, and Source
This commit is contained in:
parent
7e9bcb06ca
commit
bcad886efd
|
@ -11,6 +11,9 @@ export default class Topology extends Model {
|
||||||
@attr('string') Namespace;
|
@attr('string') Namespace;
|
||||||
@attr('string') Protocol;
|
@attr('string') Protocol;
|
||||||
@attr('boolean') FilteredByACLs;
|
@attr('boolean') FilteredByACLs;
|
||||||
|
@attr('boolean') TransparentProxy;
|
||||||
|
@attr('boolean') DefaultAllow;
|
||||||
|
@attr('boolean') WildcardIntention;
|
||||||
@attr() Upstreams; // Service[]
|
@attr() Upstreams; // Service[]
|
||||||
@attr() Downstreams; // Service[],
|
@attr() Downstreams; // Service[],
|
||||||
@attr() meta; // {}
|
@attr() meta; // {}
|
||||||
|
|
|
@ -52,10 +52,18 @@ ${
|
||||||
}
|
}
|
||||||
fake.seed(index);
|
fake.seed(index);
|
||||||
|
|
||||||
|
|
||||||
|
// Randomly make permissive intentions
|
||||||
|
const defaultAllow = fake.random.boolean();
|
||||||
|
const wildcardIntention = defaultAllow ? false : fake.random.boolean();
|
||||||
|
|
||||||
return `
|
return `
|
||||||
{
|
{
|
||||||
"Protocol": "${serviceProto}",
|
"Protocol": "${serviceProto}",
|
||||||
"FilteredByACLs": ${fake.random.boolean()},
|
"FilteredByACLs": ${fake.random.boolean()},
|
||||||
|
"TransparentProxy": ${fake.random.boolean()},
|
||||||
|
"DefaultAllow": ${defaultAllow},
|
||||||
|
"WildcardIntention": ${wildcardIntention},
|
||||||
"Upstreams": [
|
"Upstreams": [
|
||||||
${
|
${
|
||||||
upstreams.map((item, i) => {
|
upstreams.map((item, i) => {
|
||||||
|
@ -70,11 +78,14 @@ ${
|
||||||
"ChecksPassing":${fake.random.number({min: 1, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksPassing":${fake.random.number({min: 1, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
"ChecksWarning":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksWarning":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
"ChecksCritical":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksCritical":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
|
"Source": "${fake.helpers.randomize(['proxy-registration', 'default-allow', 'wildcard-intention'])}",
|
||||||
|
"TransparentProxy": ${fake.random.boolean()},
|
||||||
"Intention": {
|
"Intention": {
|
||||||
"Allowed": ${allowed},
|
"Allowed": ${allowed},
|
||||||
"HasPermissions": ${hasPerms},
|
"HasPermissions": ${hasPerms},
|
||||||
"ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}",
|
"ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}",
|
||||||
"HasExact": ${fake.random.boolean()}
|
"HasExact": ${fake.random.boolean()},
|
||||||
|
"DefaultAllow": ${fake.random.boolean()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`})}
|
`})}
|
||||||
|
@ -93,11 +104,14 @@ ${
|
||||||
"ChecksPassing":${fake.random.number({min: 1, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksPassing":${fake.random.number({min: 1, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
"ChecksWarning":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksWarning":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
"ChecksCritical":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
"ChecksCritical":${fake.random.number({min: 0, max: env('CONSUL_CHECK_COUNT', fake.random.number(10))})},
|
||||||
|
"Source": "${fake.helpers.randomize(['proxy-registration', 'specific-intention', 'default-allow', 'wildcard-intention'])}",
|
||||||
|
"TransparentProxy": ${fake.random.boolean()},
|
||||||
"Intention": {
|
"Intention": {
|
||||||
"Allowed": ${allowed},
|
"Allowed": ${allowed},
|
||||||
"HasPermissions": ${hasPerms},
|
"HasPermissions": ${hasPerms},
|
||||||
"ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}",
|
"ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}",
|
||||||
"HasExact": ${fake.random.boolean()}
|
"HasExact": ${fake.random.boolean()},
|
||||||
|
"DefaultAllow": ${fake.random.boolean()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`})}
|
`})}
|
||||||
|
|
Loading…
Reference in New Issue