diff --git a/ui/packages/consul-ui/app/models/topology.js b/ui/packages/consul-ui/app/models/topology.js index 9c06acd5e..1c1984a15 100644 --- a/ui/packages/consul-ui/app/models/topology.js +++ b/ui/packages/consul-ui/app/models/topology.js @@ -11,6 +11,9 @@ export default class Topology extends Model { @attr('string') Namespace; @attr('string') Protocol; @attr('boolean') FilteredByACLs; + @attr('boolean') TransparentProxy; + @attr('boolean') DefaultAllow; + @attr('boolean') WildcardIntention; @attr() Upstreams; // Service[] @attr() Downstreams; // Service[], @attr() meta; // {} diff --git a/ui/packages/consul-ui/mock-api/v1/internal/ui/service-topology/_ b/ui/packages/consul-ui/mock-api/v1/internal/ui/service-topology/_ index 339adee51..d4f6ade68 100644 --- a/ui/packages/consul-ui/mock-api/v1/internal/ui/service-topology/_ +++ b/ui/packages/consul-ui/mock-api/v1/internal/ui/service-topology/_ @@ -52,10 +52,18 @@ ${ } fake.seed(index); + + // Randomly make permissive intentions + const defaultAllow = fake.random.boolean(); + const wildcardIntention = defaultAllow ? false : fake.random.boolean(); + return ` { "Protocol": "${serviceProto}", "FilteredByACLs": ${fake.random.boolean()}, + "TransparentProxy": ${fake.random.boolean()}, + "DefaultAllow": ${defaultAllow}, + "WildcardIntention": ${wildcardIntention}, "Upstreams": [ ${ upstreams.map((item, i) => { @@ -70,11 +78,14 @@ ${ "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))})}, "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": { "Allowed": ${allowed}, "HasPermissions": ${hasPerms}, "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))})}, "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))})}, + "Source": "${fake.helpers.randomize(['proxy-registration', 'specific-intention', 'default-allow', 'wildcard-intention'])}", + "TransparentProxy": ${fake.random.boolean()}, "Intention": { "Allowed": ${allowed}, "HasPermissions": ${hasPerms}, "ExternalSource": "${fake.helpers.randomize(['nomad', 'kubernetes', ''])}", - "HasExact": ${fake.random.boolean()} + "HasExact": ${fake.random.boolean()}, + "DefaultAllow": ${fake.random.boolean()} } } `})}