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 2016/07/27 15:42:53 UTC

qpid-dispatch git commit: DISPATCH-311: Adjust local_policy compiler/lookup to match new schema. This version runs with test/policy-2 rules and runs qdstat anonymous lookups.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/crolke-DISPATCH-311 9d82b839f -> 00515b890


DISPATCH-311: Adjust local_policy compiler/lookup to match new schema.
This version runs with test/policy-2 rules and runs qdstat anonymous lookups.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/00515b89
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/00515b89
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/00515b89

Branch: refs/heads/crolke-DISPATCH-311
Commit: 00515b8908ac93734e2af5506b556dcfd3507235
Parents: 9d82b83
Author: Chuck Rolke <cr...@redhat.com>
Authored: Wed Jul 27 11:38:12 2016 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Wed Jul 27 11:38:12 2016 -0400

----------------------------------------------------------------------
 python/qpid_dispatch/management/qdrouter.json   |  22 +-
 .../qdrouter.policyRuleset.settings.txt         |  15 +-
 .../policy/policy_local.py                      | 351 +++++++++----------
 .../policy/policy_manager.py                    |  32 +-
 src/policy.c                                    |   4 +-
 src/policy.h                                    |   2 +-
 tests/policy-1/management-access.json           |  12 +-
 tests/policy-1/policy-boardwalk.json            |  10 +-
 tests/policy-1/policy-safari.json               |  10 +-
 tests/policy-2/test-router-with-policy.json.in  |  87 +++--
 tests/policy-3/test-sender-receiver-limits.json |  12 +-
 tests/router_policy_test.py                     |   4 +-
 12 files changed, 261 insertions(+), 300 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/python/qpid_dispatch/management/qdrouter.json
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index a465550..63b6785 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -1411,32 +1411,14 @@
                     "required": false,
                     "create": true
                 },
-                "userGroups": {
-                    "type": "map",
-                    "description": "A map where each key is a user group name and the corresponding value is a CSV string naming the users in that group. Users who are assigned to one or more groups are deemed 'restricted'. Restricted users are subject to connection ingress policy and are assigned policy settings based on the assigned user groups. Unrestricted users may be allowed or denied. If unrestricted users are allowed to connect then they are assigned to user group default.",
-                    "required": false,
-                    "create": true
-                },
-                "ingressHostGroups": {
-                    "type": "map",
-                    "description": "A map where each key is an ingress host group name and the corresponding value is a CSV string naming the IP addresses or address ranges in that group. IP addresses may be FQDN strings or numeric IPv4 or IPv6 host addresses. A host range is two host addresses of the same address family separated with a hyphen.  The wildcard host address '*' represents any host address.",
-                    "required": false,
-                    "create": true
-                },
-                "ingressPolicies": {
-                    "type": "map",
-                    "description": "A map where each key is a user group name and the corresponding value is a CSV string naming the ingress host group names that restrict the ingress host for the user group. Users who are members of the user group are allowed to connect only from a host in one of the named ingress host groups.",
-                    "required": false,
-                    "create": true
-                },
-                "connectionAllowDefault": {
+                "allowUnknownUser": {
                     "type": "boolean",
                     "description": "Unrestricted users, those who are not members of a defined user group, are allowed to connect to this application. Unrestricted users are assigned to the 'default' user group and receive 'default' settings.",
                     "default": false,
                     "required": false,
                     "create": true
                 },
-                "settings": {
+                "groups": {
                     "type": "map",
                     "description": "A map where each key is a user group name and the value is a map of the corresponding settings for that group.",
                     "required": false,

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/python/qpid_dispatch/management/qdrouter.policyRuleset.settings.txt
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch/management/qdrouter.policyRuleset.settings.txt b/python/qpid_dispatch/management/qdrouter.policyRuleset.settings.txt
index 653a378..ec8e8a9 100644
--- a/python/qpid_dispatch/management/qdrouter.policyRuleset.settings.txt
+++ b/python/qpid_dispatch/management/qdrouter.policyRuleset.settings.txt
@@ -25,13 +25,18 @@ Schema entity `vhost` includes several attributes of type map. In the current fo
 
 Until the schema is extended specify embedded maps this document describes the vhost settings.
 
-  "policyAppSettings": {
-      "description": "For a given user group define the policy settings applied to the user's AMQP connection.",
+  "vhostUserGroupSettings": {
+      "description": "For a given user group define group membership, remote hosts, the policy settings applied to the user's AMQP connection.",
       "extends": "configurationEntity",
       "attributes": {
-          "userGroupName": {
+          "users": {
               "type": "string",
-              "description": "The user group to which these settings apply.",
+              "description": "CSV string or list of authenticated user names. A user may belong to one group only.",
+              "required": true
+          },
+          "remoteHosts": {
+              "type": "string",
+              "description": "CSV string of numeric host IP addresses or address ranges from which the users may connect.",
               "required": true
           },
           "maxFrameSize": {
@@ -75,7 +80,7 @@ Until the schema is extended specify embedded maps this document describes the v
               "required": false,
               "create": true
           },
-          "allowDynamicSrc": {
+          "allowDynamicSource": {
               "type": "boolean",
               "description": "This connection is allowed to use the dynamic link source feature.",
               "default": false,

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/python/qpid_dispatch_internal/policy/policy_local.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/policy/policy_local.py b/python/qpid_dispatch_internal/policy/policy_local.py
index 9b34f0f..3bb34d3 100644
--- a/python/qpid_dispatch_internal/policy/policy_local.py
+++ b/python/qpid_dispatch_internal/policy/policy_local.py
@@ -22,6 +22,7 @@
 """
 
 import json
+import pdb
 from policy_util import PolicyError, HostStruct, HostAddr, PolicyAppConnectionMgr
 
 """
@@ -38,27 +39,25 @@ class PolicyKeys(object):
     KW_IGNORED_NAME             = "name"
     KW_IGNORED_IDENTITY         = "identity"
     KW_IGNORED_TYPE             = "type"
-    KW_VHOST_NAME         = "vhostName"
+    KW_VHOST_NAME               = "vhostName"
 
     # Policy ruleset key words
     KW_MAXCONN                     = "maxConnections"
     KW_MAXCONNPERHOST              = "maxConnectionsPerHost"
     KW_MAXCONNPERUSER              = "maxConnectionsPerUser"
-    KW_USER_GROUPS                 = "userGroups"
-    KW_INGRESS_HOST_GROUPS         = "ingressHostGroups"
-    KW_INGRESS_POLICIES            = "ingressPolicies"
-    KW_CONNECTION_ALLOW_DEFAULT    = "connectionAllowDefault"
-    KW_SETTINGS                    = "settings"
+    KW_CONNECTION_ALLOW_DEFAULT    = "allowUnknownUser"
+    KW_GROUPS                      = "groups"
 
     # Policy settings key words
-    KW_USER_GROUP_NAME          = "userGroupName"
+    KW_USERS                    = "users"
+    KW_REMOTE_HOSTS             = "remoteHosts"
     KW_MAX_FRAME_SIZE           = "maxFrameSize"
     KW_MAX_MESSAGE_SIZE         = "maxMessageSize"
     KW_MAX_SESSION_WINDOW       = "maxSessionWindow"
     KW_MAX_SESSIONS             = "maxSessions"
     KW_MAX_SENDERS              = "maxSenders"
     KW_MAX_RECEIVERS            = "maxReceivers"
-    KW_ALLOW_DYNAMIC_SRC        = "allowDynamicSrc"
+    KW_ALLOW_DYNAMIC_SRC        = "allowDynamicSource"
     KW_ALLOW_ANONYMOUS_SENDER   = "allowAnonymousSender"
     KW_SOURCES                  = "sources"
     KW_TARGETS                  = "targets"
@@ -72,7 +71,7 @@ class PolicyKeys(object):
 
     # What settings does a user get when allowed to connect but
     # not restricted by a user group?
-    KW_DEFAULT_SETTINGS         = "default"
+    KW_DEFAULT_SETTINGS         = "$default"
 
     # Config file separator character for two IP addresses in a range
     KC_CONFIG_IP_SEP            = "-"
@@ -104,14 +103,13 @@ class PolicyCompiler(object):
         PolicyKeys.KW_MAXCONN,
         PolicyKeys.KW_MAXCONNPERHOST,
         PolicyKeys.KW_MAXCONNPERUSER,
-        PolicyKeys.KW_USER_GROUPS,
-        PolicyKeys.KW_INGRESS_HOST_GROUPS,
-        PolicyKeys.KW_INGRESS_POLICIES,
         PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT,
-        PolicyKeys.KW_SETTINGS
+        PolicyKeys.KW_GROUPS
         ]
 
     allowed_settings_options = [
+        PolicyKeys.KW_USERS,
+        PolicyKeys.KW_REMOTE_HOSTS,
         PolicyKeys.KW_MAX_FRAME_SIZE,
         PolicyKeys.KW_MAX_MESSAGE_SIZE,
         PolicyKeys.KW_MAX_SESSION_WINDOW,
@@ -154,14 +152,15 @@ class PolicyCompiler(object):
         return True
 
 
-    def compile_connection_groups(self, name, submap_in, submap_out, warnings, errors):
+    def compile_connection_group(self, vhostname, groupname, val, list_out, warnings, errors):
         """
         Handle an ingressHostGroups submap.
         Each origin value is verified. On a successful run the submap
         is replaced parsed lists of HostAddr objects.
-        @param[in] name application name
-        @param[in] submap_in user input origin list as text strings
-        @param[out] submap_out user inputs replaced with HostAddr objects
+        @param[in] vhostname vhost name
+        @param[in] groupname vhost/group name
+        @param[in] val origin list as text string
+        @param[out] list_out user inputs replaced with HostAddr objects
         @param[out] warnings nonfatal irregularities observed
         @param[out] errors descriptions of failure
         @return - origins is usable. If True then warnings[] may contain useful
@@ -169,26 +168,37 @@ class PolicyCompiler(object):
                   warnings[] may contain info and errors[0] will hold the
                   description of why the origin was rejected.
         """
-        key = PolicyKeys.KW_INGRESS_HOST_GROUPS
-        for coname in submap_in:
+        key = PolicyKeys.KW_REMOTE_HOSTS
+        # convert val string to list of host specs
+        if type(val) is str:
+            # 'abc, def, mytarget'
+            val = [x.strip(' ') for x in val.split(PolicyKeys.KC_CONFIG_LIST_SEP)]
+        elif type(val) is list:
+            # ['abc', 'def', 'mytarget']
+            pass
+        elif type(val) is unicode:
+            # u'abc, def, mytarget'
+            val = [x.strip(' ') for x in str(val).split(PolicyKeys.KC_CONFIG_LIST_SEP)]
+        else:
+            errors.append(
+                "Policy vhost '%s' user group '%s' option '%s' has illegal value '%s'. Type must be 'str' or 'list' but is '%s;" %
+                (vhostname, groupname, key, val, type(val)))
+            return False
+        for coname in val:
             try:
-                ostr = str(submap_in[coname])
-                olist = [x.strip(' ') for x in ostr.split(PolicyKeys.KC_CONFIG_LIST_SEP)]
-                submap_out[coname] = []
-                for co in olist:
-                    coha = HostAddr(co, PolicyKeys.KC_CONFIG_IP_SEP)
-                    submap_out[coname].append(coha)
+                coha = HostAddr(coname, PolicyKeys.KC_CONFIG_IP_SEP)
+                list_out.append(coha)
             except Exception, e:
-                errors.append("Application '%s' option '%s' connectionOption '%s' failed to translate: '%s'." %
-                                (name, key, coname, e))
+                errors.append("Policy vhost '%s' user group '%s' option '%s' connectionOption '%s' failed to translate: '%s'." %
+                                (vhostname, groupname, key, coname, e))
                 return False
         return True
 
 
-    def compile_app_settings(self, appname, usergroup, policy_in, policy_out, warnings, errors):
+    def compile_app_settings(self, vhostname, usergroup, policy_in, policy_out, warnings, errors):
         """
         Compile a schema from processed json format to local internal format.
-        @param[in] name application name
+        @param[in] name vhost name
         @param[in] policy_in user config settings
         @param[out] policy_out validated Internal format
         @param[out] warnings nonfatal irregularities observed
@@ -199,6 +209,8 @@ class PolicyCompiler(object):
                   description of why the policy was rejected.
         """
         # rulesets may not come through standard config so make nice defaults
+        policy_out[PolicyKeys.KW_USERS] = ''
+        policy_out[PolicyKeys.KW_REMOTE_HOSTS] = ''
         policy_out[PolicyKeys.KW_MAX_FRAME_SIZE] = 65536
         policy_out[PolicyKeys.KW_MAX_MESSAGE_SIZE] = 0
         policy_out[PolicyKeys.KW_MAX_SESSION_WINDOW] = 2147483647
@@ -213,8 +225,8 @@ class PolicyCompiler(object):
         cerror = []
         for key, val in policy_in.iteritems():
             if key not in self.allowed_settings_options:
-                warnings.append("Application '%s' user group '%s' option '%s' is ignored." %
-                                (appname, usergroup, key))
+                warnings.append("Policy vhost '%s' user group '%s' option '%s' is ignored." %
+                                (vhostname, usergroup, key))
             if key in [PolicyKeys.KW_MAX_FRAME_SIZE,
                        PolicyKeys.KW_MAX_MESSAGE_SIZE,
                        PolicyKeys.KW_MAX_RECEIVERS,
@@ -223,19 +235,27 @@ class PolicyCompiler(object):
                        PolicyKeys.KW_MAX_SESSIONS
                        ]:
                 if not self.validateNumber(val, 0, 0, cerror):
-                    errors.append("Application '%s' user group '%s' option '%s' has error '%s'." %
-                                  (appname, usergroup, key, cerror[0]))
+                    errors.append("Policy vhost '%s' user group '%s' option '%s' has error '%s'." %
+                                  (vhostname, usergroup, key, cerror[0]))
                     return False
                 policy_out[key] = val
+            elif key == PolicyKeys.KW_REMOTE_HOSTS:
+                # Conection groups are lists of IP addresses that need to be
+                # converted into binary structures for comparisons.
+                val_out = []
+                if not self.compile_connection_group(vhostname, usergroup, val, val_out, warnings, errors):
+                    return False
+                policy_out[key] = val_out
             elif key in [PolicyKeys.KW_ALLOW_ANONYMOUS_SENDER,
                          PolicyKeys.KW_ALLOW_DYNAMIC_SRC
                          ]:
                 if not type(val) is bool:
-                    errors.append("Application '%s' user group '%s' option '%s' has illegal boolean value '%s'." %
-                                  (appname, usergroup, key, val))
+                    errors.append("Policy vhost '%s' user group '%s' option '%s' has illegal boolean value '%s'." %
+                                  (vhostname, usergroup, key, val))
                     return False
                 policy_out[key] = val
-            elif key in [PolicyKeys.KW_SOURCES,
+            elif key in [PolicyKeys.KW_USERS,
+                         PolicyKeys.KW_SOURCES,
                          PolicyKeys.KW_TARGETS
                          ]:
                 # accept a string or list
@@ -249,8 +269,8 @@ class PolicyCompiler(object):
                     # u'abc, def, mytarget'
                     val = [x.strip(' ') for x in str(val).split(PolicyKeys.KC_CONFIG_LIST_SEP)]
                 else:
-                    errors.append("Application '%s' user group '%s' option '%s' has illegal value '%s'. Type must be 'str' or 'list' but is '%s;" %
-                                  (appname, usergroup, key, val, type(val)))
+                    errors.append("Policy vhost '%s' user group '%s' option '%s' has illegal value '%s'. Type must be 'str' or 'list' but is '%s;" %
+                                  (vhostname, usergroup, key, val, type(val)))
                 # deduplicate address lists
                 val = list(set(val))
                 # output result is CSV string with no white space between values: 'abc,def,mytarget'
@@ -261,7 +281,7 @@ class PolicyCompiler(object):
     def compile_access_ruleset(self, name, policy_in, policy_out, warnings, errors):
         """
         Compile a schema from processed json format to local internal format.
-        @param[in] name application name
+        @param[in] name vhost name
         @param[in] policy_in raw policy to be validated
         @param[out] policy_out validated Internal format
         @param[out] warnings nonfatal irregularities observed
@@ -276,64 +296,33 @@ class PolicyCompiler(object):
         policy_out[PolicyKeys.KW_MAXCONN] = 65535
         policy_out[PolicyKeys.KW_MAXCONNPERHOST] = 65535
         policy_out[PolicyKeys.KW_MAXCONNPERUSER] = 65535
-        policy_out[PolicyKeys.KW_USER_GROUPS] = {}
-        policy_out[PolicyKeys.KW_INGRESS_HOST_GROUPS] = {}
-        policy_out[PolicyKeys.KW_INGRESS_POLICIES] = {}
         policy_out[PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT] = False
-        policy_out[PolicyKeys.KW_SETTINGS] = {}
+        policy_out[PolicyKeys.KW_GROUPS] = {}
 
         # validate the options
         for key, val in policy_in.iteritems():
             if key not in self.allowed_ruleset_options:
-                warnings.append("Application '%s' option '%s' is ignored." %
+                warnings.append("Policy vhost '%s' option '%s' is ignored." %
                                 (name, key))
             if key in [PolicyKeys.KW_MAXCONN,
                        PolicyKeys.KW_MAXCONNPERHOST,
                        PolicyKeys.KW_MAXCONNPERUSER
                        ]:
                 if not self.validateNumber(val, 0, 65535, cerror):
-                    msg = ("Application '%s' option '%s' has error '%s'." % 
+                    msg = ("Policy vhost '%s' option '%s' has error '%s'." % 
                            (name, key, cerror[0]))
                     errors.append(msg)
                     return False
                 policy_out[key] = val
-            elif key in [PolicyKeys.KW_USER_GROUPS,
-                         PolicyKeys.KW_INGRESS_HOST_GROUPS,
-                         PolicyKeys.KW_INGRESS_POLICIES
-                         ]:
-                try:
-                    if not type(val) is dict:
-                        errors.append("Application '%s' option '%s' must be of type 'dict' but is '%s'" %
-                                      (name, key, type(val)))
-                        return False
-                    if key == PolicyKeys.KW_INGRESS_HOST_GROUPS:
-                        # Conection groups are lists of IP addresses that need to be
-                        # converted into binary structures for comparisons.
-                        val_out = {}
-                        if not self.compile_connection_groups(name, val, val_out, warnings, errors):
-                            return False
-                        policy_out[key] = {}
-                        policy_out[key].update(val_out)
-                    else:
-                        # deduplicate ingressPolicy and userGroups lists
-                        for k,v in val.iteritems():
-                            v = [x.strip(' ') for x in v.split(PolicyKeys.KC_CONFIG_LIST_SEP)]
-                            v = list(set(v))
-                            val[k] = v
-                        policy_out[key] = val
-                except Exception, e:
-                    errors.append("Application '%s' option '%s' error processing map: %s" %
-                                  (name, key, e))
-                    return False
             elif key in [PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT]:
                 if not type(val) is bool:
-                    errors.append("Application '%s' option '%s' must be of type 'bool' but is '%s'" %
+                    errors.append("Policy vhost '%s' option '%s' must be of type 'bool' but is '%s'" %
                                   (name, key, type(val)))
                     return False
                 policy_out[key] = val
-            elif key in [PolicyKeys.KW_SETTINGS]:
+            elif key in [PolicyKeys.KW_GROUPS]:
                 if not type(val) is dict:
-                    errors.append("Application '%s' option '%s' must be of type 'dict' but is '%s'" %
+                    errors.append("Policy vhost '%s' option '%s' must be of type 'dict' but is '%s'" %
                                   (name, key, type(val)))
                     return False
                 for skey, sval in val.iteritems():
@@ -344,38 +333,29 @@ class PolicyCompiler(object):
                     policy_out[key][skey].update(newsettings)
 
         # Verify that each user is in only one group.
-        # Verify that each user group has defined settings
         # Create user-to-group map for looking up user's group
         policy_out[PolicyKeys.RULESET_U2G_MAP] = {}
-        if PolicyKeys.KW_USER_GROUPS in policy_out:
-            for group, userlist in policy_out[PolicyKeys.KW_USER_GROUPS].iteritems():
-                for user in userlist:
-                    if user in policy_out[PolicyKeys.RULESET_U2G_MAP]:
-                        errors.append("Application '%s' user '%s' is in multiple user groups '%s' and '%s'" %
-                                      (name, user, policy_out[PolicyKeys.RULESET_U2G_MAP][user], group))
-                        return False
-                    else:
-                        policy_out[PolicyKeys.RULESET_U2G_MAP][user] = group
-                if not group in policy_out[PolicyKeys.KW_SETTINGS]:
-                    errors.append("Application '%s' user group '%s' has no defined settings" %
-                                  (name, group))
-                    return False
+        if PolicyKeys.KW_GROUPS in policy_out:
+            for group, groupsettings in policy_out[PolicyKeys.KW_GROUPS].iteritems():
+                if PolicyKeys.KW_USERS in groupsettings:
+                    users = [x.strip(' ') for x in groupsettings[PolicyKeys.KW_USERS].split(PolicyKeys.KC_CONFIG_LIST_SEP)]
+                    for user in users:
+                        if user in policy_out[PolicyKeys.RULESET_U2G_MAP]:
+                            errors.append("Policy vhost '%s' user '%s' is in multiple user groups '%s' and '%s'" %
+                                          (name, user, policy_out[PolicyKeys.RULESET_U2G_MAP][user], group))
+                            return False
+                        else:
+                            policy_out[PolicyKeys.RULESET_U2G_MAP][user] = group
+                else:
+                    warnings.append("Policy vhost '%s' user group '%s' has no defined users. This policy has ne effect" % (name, group))
 
         # Default connections require a default settings
         if policy_out[PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT]:
-            if not PolicyKeys.KW_DEFAULT_SETTINGS in policy_out[PolicyKeys.KW_SETTINGS]:
-                errors.append("Application '%s' allows connections by default but default settings are not defined" %
+            if not PolicyKeys.KW_DEFAULT_SETTINGS in policy_out[PolicyKeys.KW_GROUPS]:
+                errors.append("Policy vhost '%s' allows connections by default but default settings are not defined" %
                               (name))
                 return False
 
-        # Each ingress policy name reference must exist in ingressHostGroups
-        for cipname, cip in policy_out[PolicyKeys.KW_INGRESS_POLICIES].iteritems():
-            for co in cip:
-                if not co in policy_out[PolicyKeys.KW_INGRESS_HOST_GROUPS]:
-                    errors.append("Application '%s' connection ingress policy '%s' references ingress host group '%s' but that group does not exist"
-                                  (name, cipname, co))
-                    return False
-
         return True
 
 
@@ -383,7 +363,7 @@ class PolicyCompiler(object):
 #
 class AppStats(object):
     """
-    Maintain live state and statistics for an application.
+    Maintain live state and statistics for an vhost.
     """
     def __init__(self, id, manager, ruleset):
         self.my_id = id
@@ -457,14 +437,14 @@ class PolicyLocal(object):
         self._manager = manager
 
         # rulesetdb is a map
-        #  key : application name
+        #  key : vhost name
         #  val : ruleset for this app
         # created by configuration
         # augmented by policy compiler
         self.rulesetdb = {}
 
         # settingsdb is a map
-        #  key : <application name>
+        #  key : <vhost name>
         #  val : a map
         #   key : <user group name>
         #   val : settings to use for user's connection
@@ -472,7 +452,7 @@ class PolicyLocal(object):
         self.settingsdb = {}
 
         # statsdb is a map
-        #  key : <application name>
+        #  key : <vhost name>
         #  val : AppStats object
         self.statsdb = {}
 
@@ -506,23 +486,23 @@ class PolicyLocal(object):
         name = attributes[PolicyKeys.KW_VHOST_NAME]
         result = self._policy_compiler.compile_access_ruleset(name, attributes, candidate, warnings, diag)
         if not result:
-            raise PolicyError( "Policy '%s' is invalid: %s" % (name, diag[0]) )
+            raise PolicyError("Policy '%s' is invalid: %s" % (name, diag[0]))
         if len(warnings) > 0:
             for warning in warnings:
                 self._manager.log_warning(warning)
         if name not in self.rulesetdb:
             self.statsdb[name] = AppStats(name, self._manager, candidate)
-            self._manager.log_info("Created policy rules for application %s" % name)
+            self._manager.log_info("Created policy rules for vhost %s" % name)
         else:
             self.statsdb[name].update_ruleset(candidate)
-            self._manager.log_info("Updated policy rules for application %s" % name)
+            self._manager.log_info("Updated policy rules for vhost %s" % name)
         self.rulesetdb[name] = {}
         self.rulesetdb[name].update(candidate)
 
     def policy_read(self, name):
         """
-        Read policy for named application
-        @param[in] name application name
+        Read policy for named vhost
+        @param[in] name vhost name
         @return policy data in raw user format
         """
         return self.rulesetdb[name]
@@ -530,19 +510,17 @@ class PolicyLocal(object):
     def policy_update(self, name, policy):
         """
         Update named policy
-        @param[in] name application name
+        @param[in] name vhost name
         @param[in] policy data in raw user input
         """
-        if not name in self.rulesetdb:
-            raise PolicyError("Policy '%s' does not exist" % name)
-        self.policy_create(name, policy)
+        raise PolicyError("Policy updatd function not implemented")
 
     def policy_delete(self, name):
         """
         Delete named policy
-        @param[in] name application name
+        @param[in] name vhost name
         """
-        if not name in self.rulesetdb:
+        if name not in self.rulesetdb:
             raise PolicyError("Policy '%s' does not exist" % name)
         del self.rulesetdb[name]
 
@@ -551,19 +529,18 @@ class PolicyLocal(object):
     #
     def policy_db_get_names(self):
         """
-        Return a list of application names in this policy
+        Return a list of vhost names in this policy
         """
         return self.rulesetdb.keys()
 
     def set_default_vhost(self, name):
         """
         Set the default vhost name.
-        @param name: the name of the default application
+        @param name: the name of the default vhost
         @return: none
         """
         self._default_vhost = name
-        self._manager.log_info("Policy fallback defaultVhost is enabled: '%s'" % name)
-
+        self._manager.log_info("Policy fallback defaultVhost is defined: '%s'" % name)
 
     def default_vhost_enabled(self):
         """
@@ -573,91 +550,90 @@ class PolicyLocal(object):
         """
         return not self._default_vhost == "" and self._default_vhost in self.rulesetdb
 
-
     #
     # Runtime query interface
     #
-    def lookup_user(self, user, host, app_in, conn_name, conn_id):
+    def lookup_user(self, user, rhost, vhost_in, conn_name, conn_id):
         """
         Lookup function called from C.
-        Determine if a user on host accessing app through AMQP Open is allowed
+        Determine if a user on host accessing vhost through AMQP Open is allowed
         according to the policy access rules.
-        If allowed then return the policy settings name. If stats.can_connect
+        If allowed then return the policy vhost settings name. If stats.can_connect
         returns true then it has registered and counted the connection.
         @param[in] user connection authId
-        @param[in] host connection remote host numeric IP address as string
-        @param[in] app_in application user is accessing
+        @param[in] rhost connection remote host numeric IP address as string
+        @param[in] vhost_in vhost user is accessing
         @param[in] conn_name connection name used for tracking reports
         @param[in] conn_id internal connection id
         @return settings user-group name if allowed; "" if not allowed
         """
         try:
-            app = app_in
-            if not app_in in self.rulesetdb:
+            # choose rule set based on incoming vhost or default vhost
+            vhost = vhost_in
+            if vhost_in not in self.rulesetdb:
                 if self.default_vhost_enabled():
-                    app = self._default_vhost
+                    vhost = self._default_vhost
                 else:
                     self._manager.log_info(
-                        "DENY AMQP Open for user '%s', host '%s', application '%s': "
-                        "No policy defined for application" % (user, host, app))
+                        "DENY AMQP Open for user '%s', rhost '%s', vhost '%s': "
+                        "No policy defined for vhost" % (user, rhost, vhost))
                     return ""
+            ruleset = self.rulesetdb[vhost]
 
-            ruleset = self.rulesetdb[app]
-
-            if not app in self.statsdb:
+            # look up the stats
+            if vhost not in self.statsdb:
                 msg = (
-                    "DENY AMQP Open for user '%s', host '%s', application '%s': "
-                    "INTERNAL: Policy is defined but stats are missing" % (user, host, app))
+                    "DENY AMQP Open for user '%s', rhost '%s', vhost '%s': "
+                    "INTERNAL: Policy is defined but stats are missing" % (user, rhost, vhost))
                 raise PolicyError(msg)
-            stats = self.statsdb[app]
-            # User in a group or default?
+            stats = self.statsdb[vhost]
+
+            # Get settings for user in a user group or in default
             if user in ruleset[PolicyKeys.RULESET_U2G_MAP]:
                 usergroup = ruleset[PolicyKeys.RULESET_U2G_MAP][user]
+            elif "*" in ruleset[PolicyKeys.RULESET_U2G_MAP]:
+                usergroup = ruleset[PolicyKeys.RULESET_U2G_MAP]["*"]
             else:
                 if ruleset[PolicyKeys.KW_CONNECTION_ALLOW_DEFAULT]:
                     usergroup = PolicyKeys.KW_DEFAULT_SETTINGS
                 else:
                     self._manager.log_info(
-                        "DENY AMQP Open for user '%s', host '%s', application '%s': "
-                        "User is not in a user group and default users are denied" % (user, host, app))
+                        "DENY AMQP Open for user '%s', rhost '%s', vhost '%s': "
+                        "User is not in a user group and unknown users are denied" % (user, rhost, vhost))
                     stats.count_other_denial()
                     return ""
-            # User in usergroup allowed to connect from host?
-            if usergroup in ruleset[PolicyKeys.KW_INGRESS_POLICIES]:
-                # User's usergroup is restricted to connecting from a host
-                # defined by the group's ingress policy
-                allowed = False
-                uhs = HostStruct(host)
-                cglist = ruleset[PolicyKeys.KW_INGRESS_POLICIES][usergroup]
-                for cg in cglist:
-                    for cohost in ruleset[PolicyKeys.KW_INGRESS_HOST_GROUPS][cg]:
-                        if cohost.match_bin(uhs):
-                            allowed = True
-                            break
-                    if allowed:
+            groupsettings = ruleset[PolicyKeys.KW_GROUPS][usergroup]
+
+            # User in usergroup allowed to connect from rhost?
+            allowed = False
+            if PolicyKeys.KW_REMOTE_HOSTS in groupsettings:
+                # Users are restricted to connecting from a rhost
+                # defined by the group's remoteHost list
+                cglist = groupsettings[PolicyKeys.KW_REMOTE_HOSTS]
+                uhs = HostStruct(rhost)
+                for cohost in cglist:
+                    if cohost.match_bin(uhs):
+                        allowed = True
                         break
-            else:
-                # User's usergroup has no ingress policy so allow
-                allowed = True
             if not allowed:
                 self._manager.log_info(
-                    "DENY AMQP Open for user '%s', host '%s', application '%s': "
-                    "User is not allowed to connect from this network host" % (user, host, app))
+                    "DENY AMQP Open for user '%s', rhost '%s', vhost '%s': "
+                    "User is not allowed to connect from this network host" % (user, rhost, vhost))
                 stats.count_other_denial()
                 return ""
 
             # This user passes administrative approval.
             # Now check live connection counts
             diags = []
-            if not stats.can_connect(conn_name, user, host, diags):
+            if not stats.can_connect(conn_name, user, rhost, diags):
                 for diag in diags:
                     self._manager.log_info(
-                        "DENY AMQP Open for user '%s', host '%s', application '%s': "
-                        "%s" % (user, host, app, diag))
+                        "DENY AMQP Open for user '%s', rhost '%s', vhost '%s': "
+                        "%s" % (user, rhost, vhost, diag))
                 return ""
 
             # Record facts about this connection to use during teardown
-            facts = ConnectionFacts(user, host, app, conn_name)
+            facts = ConnectionFacts(user, rhost, vhost, conn_name)
             self._connections[conn_id] = facts
 
             # Return success
@@ -665,43 +641,43 @@ class PolicyLocal(object):
 
         except Exception, e:
             self._manager.log_info(
-                "DENY AMQP Open lookup_user failed for user '%s', host '%s', application '%s': "
-                "Internal error: %s" % (user, host, app, e))
+                "DENY AMQP Open lookup_user failed for user '%s', rhost '%s', vhost '%s': "
+                "Internal error: %s" % (user, rhost, vhost, e))
             # return failure
             return ""
 
-    def lookup_settings(self, appname_in, name, upolicy):
+    def lookup_settings(self, vhost_in, groupname, upolicy):
         """
         Given a settings name, return the aggregated policy blob.
-        @param[in] appname: application user is accessing
-        @param[in] name: user group name
+        @param[in] vhost_in: vhost user is accessing
+        @param[in] groupname: user group name
         @param[out] upolicy: dict holding policy values - the settings blob
                     TODO: make this a c struct
         @return if lookup worked
         # Note: the upolicy output is a non-nested dict with settings of interest
         """
         try:
-            appname = appname_in
-            if not appname in self.rulesetdb:
+            vhost = vhost_in
+            if vhost not in self.rulesetdb:
                 if self.default_vhost_enabled():
-                    appname = self._default_vhost
+                    vhost = self._default_vhost
 
-            if not appname in self.rulesetdb:
+            if vhost not in self.rulesetdb:
                 self._manager.log_info(
-                        "lookup_settings fail for application '%s', user group '%s': "
-                        "No policy defined for this application" % (appname, name))
+                        "lookup_settings fail for vhost '%s', user group '%s': "
+                        "No policy defined for this vhost" % (vhost, groupname))
                 return False
 
-            ruleset = self.rulesetdb[appname]
+            ruleset = self.rulesetdb[vhost]
 
-            if not name in ruleset[PolicyKeys.KW_SETTINGS]:
+            if groupname not in ruleset[PolicyKeys.KW_GROUPS]:
                 self._manager.log_trace(
-                        "lookup_settings fail for application '%s', user group '%s': "
-                        "This application has no settings for the user group" % (appname, name))
+                        "lookup_settings fail for vhost '%s', user group '%s': "
+                        "This vhost has no settings for the user group" % (vhost, groupname))
                 return False
 
-            upolicy.update(ruleset[PolicyKeys.KW_SETTINGS][name])
-            upolicy[PolicyKeys.KW_CSTATS] = self.statsdb[appname].get_cstats()
+            upolicy.update(ruleset[PolicyKeys.KW_GROUPS][groupname])
+            upolicy[PolicyKeys.KW_CSTATS] = self.statsdb[vhost].get_cstats()
             return True
         except Exception, e:
             return False
@@ -729,16 +705,17 @@ class PolicyLocal(object):
         Test function to load a policy.
         @return:
         """
-        ruleset_str = '["policyAccessRuleset", {"vhostName": "photoserver","maxConnections": 50,"maxConnectionsPerUser": 5,"maxConnectionsPerHost": 20,"userGroups": {"anonymous":       "anonymous","users":           "u1, u2","paidsubscribers": "p1, p2","test":            "zeke, ynot","admin":           "alice, bob","superuser":       "ellen"},"ingressHostGroups": {"Ten18":     "10.18.0.0-10.18.255.255","EllensWS":  "72.135.2.9","TheLabs":   "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255","localhost": "127.0.0.1, ::1","TheWorld":  "*"},"ingressPolicies": {"anonymous":       "TheWorld","users":           "TheWorld","paidsubscribers": "TheWorld","test":            "TheLabs","admin":           "Ten18, TheLabs, localhost","superuser":       "EllensWS, localhost"},"connectionAllowDefault": true,'
-        ruleset_str += '"settings": {'
-        ruleset_str += '"anonymous":      {"maxFrameSize": 111111,"maxMessageSize":   111111,"maxSessionWindow": 111111,"maxSessions":           1,"maxSenders":           11,"maxReceivers":         11,"allowDynamicSrc":      false,"allowAnonymousSender": false,"sources": "public",                           "targets": ""},'
-        ruleset_str += '"users":          {"maxFrameSize": 222222,"maxMessageSize":   222222,"maxSessionWindow": 222222,"maxSessions":           2,"maxSenders":           22,"maxReceivers":         22,"allowDynamicSrc":      false,"allowAnonymousSender": false,"sources": "public, private",                  "targets": "public"},'
-        ruleset_str += '"paidsubscribers":{"maxFrameSize": 333333,"maxMessageSize":   333333,"maxSessionWindow": 333333,"maxSessions":           3,"maxSenders":           33,"maxReceivers":         33,"allowDynamicSrc":      true, "allowAnonymousSender": false,"sources": "public, private",                  "targets": "public, private"},'
-        ruleset_str += '"test":           {"maxFrameSize": 444444,"maxMessageSize":   444444,"maxSessionWindow": 444444,"maxSessions":           4,"maxSenders":           44,"maxReceivers":         44,"allowDynamicSrc":      true, "allowAnonymousSender": true, "sources": "private",                          "targets": "private"},'
-        ruleset_str += '"admin":          {"maxFrameSize": 555555,"maxMessageSize":   555555,"maxSessionWindow": 555555,"maxSessions":           5,"maxSenders":           55,"maxReceivers":         55,"allowDynamicSrc":      true, "allowAnonymousSender": true, "sources": "public, private, management",      "targets": "public, private, management"},'
-        ruleset_str += '"superuser":      {"maxFrameSize": 666666,"maxMessageSize":   666666,"maxSessionWindow": 666666,"maxSessions":           6,"maxSenders":           66,"maxReceivers":         66,"allowDynamicSrc":      false,"allowAnonymousSender": false,"sources": "public, private, management, root","targets": "public, private, management, root"},'
-        ruleset_str += '"default":        {"maxFrameSize": 222222,"maxMessageSize":   222222,"maxSessionWindow": 222222,"maxSessions":           2,"maxSenders":           22,"maxReceivers":         22,"allowDynamicSrc":      false,"allowAnonymousSender": false,"sources": "public, private",                  "targets": "public"}'
+        ruleset_str = '["vhostName": "photoserver", "maxConnections": 50, "maxConnectionsPerUser": 5, "maxConnectionsPerHost": 20, "allowUnknownUser": true,'
+        ruleset_str += '"groups": {'
+        ruleset_str += '"anonymous":       { "users": "anonymous", "remoteHosts": "*", "maxFrameSize": 111111, "maxMessageSize": 111111, "maxSessionWindow": 111111, "maxSessions": 1, "maxSenders": 11, "maxReceivers": 11, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public", "targets": "" },'
+        ruleset_str += '"users":           { "users": "u1, u2", "remoteHosts": "*", "maxFrameSize": 222222, "maxMessageSize": 222222, "maxSessionWindow": 222222, "maxSessions": 2, "maxSenders": 22, "maxReceivers": 22, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private", "targets": "public" },'
+        ruleset_str += '"paidsubscribers": { "users": "p1, p2", "remoteHosts": "*", "maxFrameSize": 333333, "maxMessageSize": 333333, "maxSessionWindow": 333333, "maxSessions": 3, "maxSenders": 33, "maxReceivers": 33, "allowDynamicSource": true, "allowAnonymousSender": false, "sources": "public, private", "targets": "public, private" },'
+        ruleset_str += '"test":            { "users": "zeke, ynot", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255", "maxFrameSize": 444444, "maxMessageSize": 444444, "maxSessionWindow": 444444, "maxSessions": 4, "maxSenders": 44, "maxReceivers": 44, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "private", "targets": "private" },'
+        ruleset_str += '"admin":           { "users": "alice, bob", "remoteHosts": "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1, ::1", "maxFrameSize": 555555, "maxMessageSize": 555555, "maxSessionWindow": 555555, "maxSessions": 5, "maxSenders": 55, "maxReceivers": 55, "allowDynamicSource": true, "allowAnonymousSender": true, "sources": "public, private, management", "targets": "public, private, management" },'
+        ruleset_str += '"superuser":       { "users": "ellen", "remoteHosts": "72.135.2.9, 127.0.0.1, ::1", "maxFrameSize": 666666, "maxMessageSize": 666666, "maxSessionWindow": 666666, "maxSessions": 6, "maxSenders": 66, "maxReceivers": 66, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private, management, root", "targets": "public, private, management, root" },'
+        ruleset_str += '"$default":        { "users": "*", "remoteHosts": "*", "maxFrameSize": 222222, "maxMessageSize": 222222, "maxSessionWindow": 222222, "maxSessions": 2, "maxSenders": 22, "maxReceivers": 22, "allowDynamicSource": false, "allowAnonymousSender": false, "sources": "public, private", "targets": "public" }'
         ruleset_str += '}}]'
+
         ruleset = json.loads(ruleset_str)
 
         self.create_ruleset(ruleset[1])

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/python/qpid_dispatch_internal/policy/policy_manager.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/policy/policy_manager.py b/python/qpid_dispatch_internal/policy/policy_manager.py
index cb0247b..3438564 100644
--- a/python/qpid_dispatch_internal/policy/policy_manager.py
+++ b/python/qpid_dispatch_internal/policy/policy_manager.py
@@ -78,7 +78,7 @@ class PolicyManager(object):
         self._policy_local.create_ruleset(attributes)
 
     #
-    # Management interface to set the default application
+    # Management interface to set the default vhost
     #
     def set_default_vhost(self, name):
         """
@@ -91,30 +91,30 @@ class PolicyManager(object):
     #
     # Runtime query interface
     #
-    def lookup_user(self, user, host, app, conn_name, conn_id):
+    def lookup_user(self, user, rhost, vhost, conn_name, conn_id):
         """
         Lookup function called from C.
         Determine if a user on host accessing app through AMQP Open is allowed
         according to the policy access rules.
         If allowed then return the policy settings name
         @param[in] user connection authId
-        @param[in] host connection remote host numeric IP address as string
-        @param[in] app application user is accessing
+        @param[in] rhost connection remote host numeric IP address as string
+        @param[in] vhost application user is accessing
         @param[in] conn_name connection name for accounting purposes
         @param[in] conn_id internal connection id
         @return settings user-group name if allowed; "" if not allowed
         """
-        return self._policy_local.lookup_user(user, host, app, conn_name, conn_id)
+        return self._policy_local.lookup_user(user, rhost, vhost, conn_name, conn_id)
 
-    def lookup_settings(self, appname, name, upolicy):
+    def lookup_settings(self, vhost, name, upolicy):
         """
         Given a settings name, return the aggregated policy blob.
-        @param[in] appname: application user is accessing
+        @param[in] vhost: vhost user is accessing
         @param[in] name: user group name
         @param[out] upolicy: map that receives the settings
         @return settings were retrieved or not
         """
-        return self._policy_local.lookup_settings(appname, name, upolicy)
+        return self._policy_local.lookup_settings(vhost, name, upolicy)
 
     def close_connection(self, conn_id):
         """
@@ -127,18 +127,18 @@ class PolicyManager(object):
 #
 #
 #
-def policy_lookup_user(mgr, user, host, app, conn_name, conn_id):
+def policy_lookup_user(mgr, user, rhost, vhost, conn_name, conn_id):
     """
     Look up a user in the policy database
     Called by C code
     @param mgr:
     @param user:
-    @param host:
-    @param app:
+    @param rhost:
+    @param vhost:
     @param conn_name:
     @return:
     """
-    return mgr.lookup_user(user, host, app, conn_name, conn_id)
+    return mgr.lookup_user(user, rhost, vhost, conn_name, conn_id)
 
 #
 #
@@ -156,13 +156,13 @@ def policy_close_connection(mgr, conn_id):
 #
 #
 #
-def policy_lookup_settings(mgr, appname, name, upolicy):
+def policy_lookup_settings(mgr, vhost, name, upolicy):
     """
-    Return settings for <app, usergroup> in upolicy map
+    Return settings for <vhost, usergroup> in upolicy map
     @param mgr:
-    @param appname:
+    @param vhost:
     @param name:
     @param upolicy:
     @return:
     """
-    return mgr.lookup_settings(appname, name, upolicy)
\ No newline at end of file
+    return mgr.lookup_settings(vhost, name, upolicy)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/src/policy.c
----------------------------------------------------------------------
diff --git a/src/policy.c b/src/policy.c
index 4786446..434bbb0 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -336,7 +336,7 @@ bool qd_policy_open_lookup_user(
                     settings->maxSenders           = qd_entity_opt_long((qd_entity_t*)upolicy, "maxSenders", 0);
                     settings->maxReceivers         = qd_entity_opt_long((qd_entity_t*)upolicy, "maxReceivers", 0);
                     settings->allowAnonymousSender = qd_entity_opt_bool((qd_entity_t*)upolicy, "allowAnonymousSender", false);
-                    settings->allowDynamicSrc      = qd_entity_opt_bool((qd_entity_t*)upolicy, "allowDynamicSrc", false);
+                    settings->allowDynamicSource      = qd_entity_opt_bool((qd_entity_t*)upolicy, "allowDynamicSource", false);
                     settings->sources              = qd_entity_get_string((qd_entity_t*)upolicy, "sources");
                     settings->targets              = qd_entity_get_string((qd_entity_t*)upolicy, "targets");
                     settings->denialCounts         = (qd_policy_denial_counts_t*)
@@ -651,7 +651,7 @@ bool qd_policy_approve_amqp_receiver_link(pn_link_t *pn_link, qd_connection_t *q
     // Approve receiver link based on source
     bool dynamic_src = pn_terminus_is_dynamic(pn_link_remote_source(pn_link));
     if (dynamic_src) {
-        bool lookup = qd_conn->policy_settings->allowDynamicSrc;
+        bool lookup = qd_conn->policy_settings->allowDynamicSource;
         qd_log(qd_conn->server->qd->policy->log_source, (lookup ? QD_LOG_TRACE : QD_LOG_INFO),
             "%s AMQP Attach receiver dynamic source for user '%s', host '%s', app '%s',",
             (lookup ? "ALLOW" : "DENY"), qd_conn->user_id, hostip, app);

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/src/policy.h
----------------------------------------------------------------------
diff --git a/src/policy.h b/src/policy.h
index 1bad99d..6287bfb 100644
--- a/src/policy.h
+++ b/src/policy.h
@@ -48,7 +48,7 @@ struct qd_policy__settings_s {
     int  maxSessions;
     int  maxSenders;
     int  maxReceivers;
-    bool allowDynamicSrc;
+    bool allowDynamicSource;
     bool allowAnonymousSender;
     char *sources;
     char *targets;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/policy-1/management-access.json
----------------------------------------------------------------------
diff --git a/tests/policy-1/management-access.json b/tests/policy-1/management-access.json
index d2b8132..08803af 100644
--- a/tests/policy-1/management-access.json
+++ b/tests/policy-1/management-access.json
@@ -28,7 +28,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -37,7 +37,7 @@
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "$management",
           "targets": "$management"
@@ -50,7 +50,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -59,7 +59,7 @@
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "$management",
           "targets": "$management"
@@ -72,7 +72,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -81,7 +81,7 @@
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "$management",
           "targets": "$management"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/policy-1/policy-boardwalk.json
----------------------------------------------------------------------
diff --git a/tests/policy-1/policy-boardwalk.json b/tests/policy-1/policy-boardwalk.json
index d2cf4da..2b2393b 100644
--- a/tests/policy-1/policy-boardwalk.json
+++ b/tests/policy-1/policy-boardwalk.json
@@ -40,7 +40,7 @@
                 "anonymous": "Ten18, TheLabs",
                 "superuser": "Localhost, EllensWS"
             },
-            "connectionAllowDefault": true,
+            "allowUnknownUser": true,
             "settings": {
                 "anonymous": {
                     "maxFrameSize": 111111,
@@ -49,7 +49,7 @@
                     "maxSessions": 1,
                     "maxSenders": 11,
                     "maxReceivers": 11,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public",
                     "targets": ""
@@ -61,7 +61,7 @@
                     "maxSessions": 2,
                     "maxSenders": 22,
                     "maxReceivers": 22,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private",
                     "targets": "public"
@@ -73,7 +73,7 @@
                     "maxSessions": 6,
                     "maxSenders": 66,
                     "maxReceivers": 66,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private, management, root",
                     "targets": "public, private, management, root"
@@ -85,7 +85,7 @@
                     "maxSessions": 2,
                     "maxSenders": 22,
                     "maxReceivers": 22,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private",
                     "targets": "public"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/policy-1/policy-safari.json
----------------------------------------------------------------------
diff --git a/tests/policy-1/policy-safari.json b/tests/policy-1/policy-safari.json
index 5147335..66a489b 100644
--- a/tests/policy-1/policy-safari.json
+++ b/tests/policy-1/policy-safari.json
@@ -40,7 +40,7 @@
                 "clients": "basecamp",
 		"guides": "basecamp, mobile, Localhost"
             },
-            "connectionAllowDefault": true,
+            "allowUnknownUser": true,
             "settings": {
                 "anonymous": {
                     "maxFrameSize": 111111,
@@ -49,7 +49,7 @@
                     "maxSessions": 1,
                     "maxSenders": 11,
                     "maxReceivers": 11,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public",
                     "targets": ""
@@ -61,7 +61,7 @@
                     "maxSessions": 2,
                     "maxSenders": 22,
                     "maxReceivers": 22,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private",
                     "targets": "public"
@@ -73,7 +73,7 @@
                     "maxSessions": 6,
                     "maxSenders": 66,
                     "maxReceivers": 66,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private, management, root",
                     "targets": "public, private, management, root"
@@ -85,7 +85,7 @@
                     "maxSessions": 2,
                     "maxSenders": 22,
                     "maxReceivers": 22,
-                    "allowDynamicSrc": false,
+                    "allowDynamicSource": false,
                     "allowAnonymousSender": false,
                     "sources": "public, private",
                     "targets": "public"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/policy-2/test-router-with-policy.json.in
----------------------------------------------------------------------
diff --git a/tests/policy-2/test-router-with-policy.json.in b/tests/policy-2/test-router-with-policy.json.in
index 197d604..648c118 100644
--- a/tests/policy-2/test-router-with-policy.json.in
+++ b/tests/policy-2/test-router-with-policy.json.in
@@ -34,111 +34,102 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "userGroups": {
-        "anonymous":       "anonymous",
-        "users":           "u1, u2",
-        "paidsubscribers": "p1, p2",
-        "test":            "zeke, ynot",
-        "admin":           "alice, bob",
-        "superuser":       "ellen"
-      },
-      "ingressHostGroups": {
-        "Ten18":     "10.18.0.0-10.18.255.255",
-        "EllensWS":  "72.135.2.9",
-        "TheLabs":   "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255",
-        "localhost": "127.0.0.1, ::1",
-        "TheWorld":  "*"
-      },
-      "ingressPolicies": {
-        "anonymous":       "TheWorld",
-        "users":           "TheWorld",
-        "paidsubscribers": "TheWorld",
-        "test":            "TheLabs",
-        "admin":           "Ten18, TheLabs, localhost",
-        "superuser":       "EllensWS, localhost"
-      },
-      "connectionAllowDefault": true,
-      "settings": {
+      "allowUnknownUser": true,
+      "groups": {
         "anonymous" : {
+          "users":            "anonymous",
+          "remoteHosts":      "*",
           "maxFrameSize":     111111,
           "maxMessageSize":   111111,
           "maxSessionWindow": 111111,
           "maxSessions":           1,
           "maxSenders":           11,
           "maxReceivers":         11,
-          "allowDynamicSrc":      false,
+          "allowDynamicSource":   false,
           "allowAnonymousSender": false,
           "sources": "public",
           "targets": ""
         },
         "users" : {
+          "users":            "u1, u2",
+          "remoteHosts":      "*",
           "maxFrameSize":     222222,
           "maxMessageSize":   222222,
           "maxSessionWindow": 222222,
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      false,
+          "allowDynamicSource":   false,
           "allowAnonymousSender": false,
           "sources": "public, private",
           "targets": "public"
         },
         "paidsubscribers" : {
+          "users":            "p1, p2",
+          "remoteHosts":      "*",
           "maxFrameSize":     333333,
           "maxMessageSize":   333333,
           "maxSessionWindow": 333333,
           "maxSessions":           3,
           "maxSenders":           33,
           "maxReceivers":         33,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":   true,
           "allowAnonymousSender": false,
           "sources": "public, private",
           "targets": "public, private"
         },
         "test" : {
+          "users":            "zeke, ynot",
+          "remoteHosts":      "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255",
           "maxFrameSize":     444444,
           "maxMessageSize":   444444,
           "maxSessionWindow": 444444,
           "maxSessions":           4,
           "maxSenders":           44,
           "maxReceivers":         44,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":   true,
           "allowAnonymousSender": true,
           "sources": "private",
           "targets": "private"
         },
         "admin" : {
+          "users":            "alice, bob",
+          "remoteHosts":      "10.48.0.0-10.48.255.255, 192.168.100.0-192.168.100.255, 10.18.0.0-10.18.255.255, 127.0.0.1, ::1",
           "maxFrameSize":     555555,
           "maxMessageSize":   555555,
           "maxSessionWindow": 555555,
           "maxSessions":           5,
           "maxSenders":           55,
           "maxReceivers":         55,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":   true,
           "allowAnonymousSender": true,
           "sources": "public, private, management",
           "targets": "public, private, management"
         },
         "superuser" : {
+          "users":            "ellen",
+          "remoteHosts":      "72.135.2.9, 127.0.0.1, ::1",
           "maxFrameSize":     666666,
           "maxMessageSize":   666666,
           "maxSessionWindow": 666666,
           "maxSessions":           6,
           "maxSenders":           66,
           "maxReceivers":         66,
-          "allowDynamicSrc":      false,
+          "allowDynamicSource":      false,
           "allowAnonymousSender": false,
           "sources": "public, private, management, root",
           "targets": "public, private, management, root"
         },
-        "default" : {
+        "$default" : {
+          "users":            "*",
+          "remoteHosts":      "*",
           "maxFrameSize":     222222,
           "maxMessageSize":   222222,
           "maxSessionWindow": 222222,
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      false,
+          "allowDynamicSource":      false,
           "allowAnonymousSender": false,
           "sources": "public, private",
           "targets": "public"
@@ -150,16 +141,18 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
-      "settings": {
-        "default" : {
+      "allowUnknownUser": true,
+      "groups": {
+        "$default" : {
+          "users":            "*",
+          "remoteHosts":      "*",
           "maxFrameSize":     222222,
           "maxMessageSize":   222222,
           "maxSessionWindow": 222222,
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":   true,
           "allowAnonymousSender": true,
           "sources": "public, private, $management",
           "targets": "public, private, $management"
@@ -172,16 +165,18 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
-      "settings": {
-        "default" : {
+      "allowUnknownUser": true,
+      "groups": {
+        "$default" : {
+          "users":            "*",
+          "remoteHosts":      "*",
           "maxFrameSize":     222222,
           "maxMessageSize":   222222,
           "maxSessionWindow": 222222,
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "public, private, $management",
           "targets": "public, private, $management"
@@ -194,16 +189,18 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 5,
       "maxConnectionsPerHost": 20,
-      "connectionAllowDefault": true,
-      "settings": {
-        "default" : {
+      "allowUnknownUser": true,
+      "groups": {
+        "$default" : {
+          "users":            "*",
+          "remoteHosts":      "*",
           "maxFrameSize":     222222,
           "maxMessageSize":   222222,
           "maxSessionWindow": 222222,
           "maxSessions":           2,
           "maxSenders":           22,
           "maxReceivers":         22,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "public, private, $management",
           "targets": "public, private, $management"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/policy-3/test-sender-receiver-limits.json
----------------------------------------------------------------------
diff --git a/tests/policy-3/test-sender-receiver-limits.json b/tests/policy-3/test-sender-receiver-limits.json
index 3e6145d..d14652b 100644
--- a/tests/policy-3/test-sender-receiver-limits.json
+++ b/tests/policy-3/test-sender-receiver-limits.json
@@ -6,7 +6,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 2,
       "maxConnectionsPerHost": 4,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -15,7 +15,7 @@
           "maxSessions":           2,
           "maxSenders":            2,
           "maxReceivers":          4,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "*",
           "targets": "*"
@@ -28,7 +28,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 2,
       "maxConnectionsPerHost": 4,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -37,7 +37,7 @@
           "maxSessions":           2,
           "maxSenders":            2,
           "maxReceivers":          4,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "*",
           "targets": "*"
@@ -50,7 +50,7 @@
       "maxConnections": 50,
       "maxConnectionsPerUser": 2,
       "maxConnectionsPerHost": 4,
-      "connectionAllowDefault": true,
+      "allowUnknownUser": true,
       "settings": {
         "default" : {
           "maxFrameSize":     222222,
@@ -59,7 +59,7 @@
           "maxSessions":           2,
           "maxSenders":            2,
           "maxReceivers":          4,
-          "allowDynamicSrc":      true,
+          "allowDynamicSource":      true,
           "allowAnonymousSender": true,
           "sources": "*",
           "targets": "*"

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/00515b89/tests/router_policy_test.py
----------------------------------------------------------------------
diff --git a/tests/router_policy_test.py b/tests/router_policy_test.py
index d6eefca..af19277 100644
--- a/tests/router_policy_test.py
+++ b/tests/router_policy_test.py
@@ -157,7 +157,7 @@ class PolicyFile(TestCase):
         self.assertTrue(upolicy['maxSenders']               == 44)
         self.assertTrue(upolicy['maxReceivers']             == 44)
         self.assertTrue(upolicy['allowAnonymousSender'])
-        self.assertTrue(upolicy['allowDynamicSrc'])
+        self.assertTrue(upolicy['allowDynamicSource'])
         self.assertTrue(upolicy['targets'] == 'private')
         self.assertTrue(upolicy['sources'] == 'private')
 
@@ -217,7 +217,7 @@ class PolicyFileApplicationFallback(TestCase):
         self.assertTrue(upolicy['maxSenders']               == 44)
         self.assertTrue(upolicy['maxReceivers']             == 44)
         self.assertTrue(upolicy['allowAnonymousSender'])
-        self.assertTrue(upolicy['allowDynamicSrc'])
+        self.assertTrue(upolicy['allowDynamicSource'])
         self.assertTrue(upolicy['targets'] == 'private')
         self.assertTrue(upolicy['sources'] == 'private')
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org