You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2018/05/16 20:14:00 UTC
[02/12] qpid-dispatch git commit: DISPATCH-990: vhost hostname
patterns management interface
DISPATCH-990: vhost hostname patterns management interface
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/32b06d23
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/32b06d23
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/32b06d23
Branch: refs/heads/master
Commit: 32b06d23e29a692f2821f39d02be0f9d092b1648
Parents: 4bd79a3
Author: Chuck Rolke <cr...@redhat.com>
Authored: Tue May 8 10:37:35 2018 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Thu May 10 10:39:47 2018 -0400
----------------------------------------------------------------------
python/qpid_dispatch/management/qdrouter.json | 7 +++++++
src/policy.c | 16 ++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/32b06d23/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index 83e1182..ee8a943 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -1678,6 +1678,13 @@
"required": false,
"create": true
},
+ "useVhostNamePatterns": {
+ "type": "boolean",
+ "default": false,
+ "description": "Use Vhost name patterns.",
+ "required": false,
+ "create": true
+ },
"policyDir": {
"type": "path",
"default": "",
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/32b06d23/src/policy.c
----------------------------------------------------------------------
diff --git a/src/policy.c b/src/policy.c
index a7e31cf..915ca37 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -61,10 +61,12 @@ struct qd_policy_t {
qd_dispatch_t *qd;
qd_log_source_t *log_source;
void *py_policy_manager;
+ qd_parse_tree_t *hostname_tree;
// configured settings
int max_connection_limit;
char *policyDir;
bool enableVhostPolicy;
+ bool useVhostNamePatterns;
// live statistics
int connections_processed;
int connections_denied;
@@ -77,15 +79,11 @@ struct qd_policy_t {
qd_policy_t *qd_policy(qd_dispatch_t *qd)
{
qd_policy_t *policy = NEW(qd_policy_t);
+ ZERO(policy);
policy->qd = qd;
policy->log_source = qd_log_source("POLICY");
policy->max_connection_limit = 65535;
- policy->py_policy_manager = 0;
- policy->policyDir = 0;
- policy->enableVhostPolicy = false;
- policy->connections_processed= 0;
- policy->connections_denied = 0;
- policy->connections_current = 0;
+ policy->hostname_tree = qd_parse_tree_new(QD_PARSE_TREE_ADDRESS);
qd_log(policy->log_source, QD_LOG_TRACE, "Policy Initialized");
return policy;
@@ -99,6 +97,7 @@ void qd_policy_free(qd_policy_t *policy)
{
if (policy->policyDir)
free(policy->policyDir);
+ qd_parse_tree_free(policy->hostname_tree);
free(policy);
}
@@ -114,8 +113,9 @@ qd_error_t qd_entity_configure_policy(qd_policy_t *policy, qd_entity_t *entity)
policy->policyDir =
qd_entity_opt_string(entity, "policyDir", 0); CHECK();
policy->enableVhostPolicy = qd_entity_opt_bool(entity, "enableVhostPolicy", false); CHECK();
- qd_log(policy->log_source, QD_LOG_INFO, "Policy configured maxConnections: %d, policyDir: '%s', access rules enabled: '%s'",
- policy->max_connection_limit, policy->policyDir, (policy->enableVhostPolicy ? "true" : "false"));
+ policy->useVhostNamePatterns = qd_entity_opt_bool(entity, "useVhostNamePatterns", false); CHECK();
+ qd_log(policy->log_source, QD_LOG_INFO, "Policy configured maxConnections: %d, policyDir: '%s', access rules enabled: '%s', use hostname patterns: '%s'",
+ policy->max_connection_limit, policy->policyDir, (policy->enableVhostPolicy ? "true" : "false"), (policy->useVhostNamePatterns ? "true" : "false"));
return QD_ERROR_NONE;
error:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org