Add textarea field for allowed_cidrs in the listener api
Change-Id: I5af4b0735bafca3e541558974140502454ce39db
This commit is contained in:
parent
4a188af317
commit
f4417cb97d
@ -185,6 +185,7 @@ def create_listener(request, **kwargs):
|
|||||||
timeout_member_connect=data['listener'].get('timeout_member_connect'),
|
timeout_member_connect=data['listener'].get('timeout_member_connect'),
|
||||||
timeout_member_data=data['listener'].get('timeout_member_data'),
|
timeout_member_data=data['listener'].get('timeout_member_data'),
|
||||||
timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'),
|
timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'),
|
||||||
|
allowed_cidrs=data['listener'].get('allowed_cidrs')
|
||||||
)
|
)
|
||||||
|
|
||||||
if data.get('pool'):
|
if data.get('pool'):
|
||||||
@ -457,6 +458,7 @@ def update_listener(request, **kwargs):
|
|||||||
timeout_member_connect=data['listener'].get('timeout_member_connect'),
|
timeout_member_connect=data['listener'].get('timeout_member_connect'),
|
||||||
timeout_member_data=data['listener'].get('timeout_member_data'),
|
timeout_member_data=data['listener'].get('timeout_member_data'),
|
||||||
timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'),
|
timeout_tcp_inspect=data['listener'].get('timeout_tcp_inspect'),
|
||||||
|
allowed_cidrs=data['listener'].get('allowed_cidrs')
|
||||||
)
|
)
|
||||||
|
|
||||||
if data.get('pool'):
|
if data.get('pool'):
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
'id', 'name', 'description', 'project_id', 'created_at', 'updated_at',
|
'id', 'name', 'description', 'project_id', 'created_at', 'updated_at',
|
||||||
'connection_limit', 'insert_headers', 'default_pool_id',
|
'connection_limit', 'insert_headers', 'default_pool_id',
|
||||||
'timeout_client_data', 'timeout_member_connect',
|
'timeout_client_data', 'timeout_member_connect',
|
||||||
'timeout_member_data', 'timeout_tcp_inspect'
|
'timeout_member_data', 'timeout_tcp_inspect', 'allowed_cidrs'
|
||||||
]]">
|
]]">
|
||||||
</hz-resource-property-list>
|
</hz-resource-property-list>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
['created_at', 'updated_at', 'description'],
|
['created_at', 'updated_at', 'description'],
|
||||||
['protocol', 'protocol_port', 'connection_limit'],
|
['protocol', 'protocol_port', 'connection_limit'],
|
||||||
['insert_headers', 'default_pool_id', 'timeout_client_data'],
|
['insert_headers', 'default_pool_id', 'timeout_client_data'],
|
||||||
['timeout_member_connect', 'timeout_member_data', 'timeout_tcp_inspect']
|
['timeout_member_connect', 'timeout_member_data', 'timeout_tcp_inspect', 'allowed_cidrs']
|
||||||
]">
|
]">
|
||||||
</hz-resource-property-list>
|
</hz-resource-property-list>
|
||||||
|
@ -177,6 +177,10 @@
|
|||||||
loadBalancerService.nullFilter
|
loadBalancerService.nullFilter
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
allowed_cidrs: {
|
||||||
|
label: gettext('Allowed Cidrs'),
|
||||||
|
filters: ['noValue']
|
||||||
|
},
|
||||||
timeout_client_data: gettext('Client Data Timeout'),
|
timeout_client_data: gettext('Client Data Timeout'),
|
||||||
timeout_member_connect: gettext('Member Connect Timeout'),
|
timeout_member_connect: gettext('Member Connect Timeout'),
|
||||||
timeout_member_data: gettext('Member Data Timeout'),
|
timeout_member_data: gettext('Member Data Timeout'),
|
||||||
|
@ -62,3 +62,10 @@
|
|||||||
Backend member inactivity timeout in milliseconds. Default: 50000.
|
Backend member inactivity timeout in milliseconds. Default: 50000.
|
||||||
</translate>
|
</translate>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong translate>Allowed Cidrs:</strong>
|
||||||
|
<translate>
|
||||||
|
A newline separated list of cidrs to be allowed to connect to the listener.
|
||||||
|
An empty list means allow from any.
|
||||||
|
</translate>
|
||||||
|
</p>
|
||||||
|
@ -154,6 +154,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-12 col-sm-8 col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label" for="allowed_cidrs">
|
||||||
|
<translate>Allowed Cidrs</translate>
|
||||||
|
</label>
|
||||||
|
<textarea ng-model="model.spec.listener.allowed_cidrs" ng-trim="false" ng-list=" "
|
||||||
|
rows="2" placeholder="0.0.0.0/0" id="allowed_cidrs" name="allowed_cidrs" class="form-control">
|
||||||
|
</textarea>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4 translate ng-if="model.spec.listener.protocol === 'HTTP' || model.spec.listener.protocol === 'TERMINATED_HTTPS'">Insert Headers</h4>
|
<h4 translate ng-if="model.spec.listener.protocol === 'HTTP' || model.spec.listener.protocol === 'TERMINATED_HTTPS'">Insert Headers</h4>
|
||||||
|
@ -169,7 +169,8 @@
|
|||||||
timeout_client_data: 50000,
|
timeout_client_data: 50000,
|
||||||
timeout_member_connect: 5000,
|
timeout_member_connect: 5000,
|
||||||
timeout_member_data: 50000,
|
timeout_member_data: 50000,
|
||||||
timeout_tcp_inspect: 0
|
timeout_tcp_inspect: 0,
|
||||||
|
allowed_cidrs: null
|
||||||
},
|
},
|
||||||
l7policy: {
|
l7policy: {
|
||||||
id: null,
|
id: null,
|
||||||
@ -801,6 +802,7 @@
|
|||||||
spec.timeout_member_connect = listener.timeout_member_connect;
|
spec.timeout_member_connect = listener.timeout_member_connect;
|
||||||
spec.timeout_member_data = listener.timeout_member_data;
|
spec.timeout_member_data = listener.timeout_member_data;
|
||||||
spec.timeout_tcp_inspect = listener.timeout_tcp_inspect;
|
spec.timeout_tcp_inspect = listener.timeout_tcp_inspect;
|
||||||
|
spec.allowed_cidrs = listener.allowed_cidrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setL7PolicySpec(l7policy) {
|
function setL7PolicySpec(l7policy) {
|
||||||
|
@ -1298,7 +1298,7 @@
|
|||||||
it('has the right number of properties', function() {
|
it('has the right number of properties', function() {
|
||||||
expect(Object.keys(model.spec).length).toBe(11);
|
expect(Object.keys(model.spec).length).toBe(11);
|
||||||
expect(Object.keys(model.spec.loadbalancer).length).toBe(7);
|
expect(Object.keys(model.spec.loadbalancer).length).toBe(7);
|
||||||
expect(Object.keys(model.spec.listener).length).toBe(14);
|
expect(Object.keys(model.spec.listener).length).toBe(15);
|
||||||
expect(Object.keys(model.spec.l7policy).length).toBe(8);
|
expect(Object.keys(model.spec.l7policy).length).toBe(8);
|
||||||
expect(Object.keys(model.spec.l7rule).length).toBe(7);
|
expect(Object.keys(model.spec.l7rule).length).toBe(7);
|
||||||
expect(Object.keys(model.spec.pool).length).toBe(7);
|
expect(Object.keys(model.spec.pool).length).toBe(7);
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add the ability to set allowed_cidrs on the listeners
|
Loading…
Reference in New Issue
Block a user