You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2019/03/21 15:56:34 UTC

[GitHub] [qpid-dispatch] ChugR commented on a change in pull request #472: Dispatch 1288 1 - policy for outbound connectors

ChugR commented on a change in pull request #472: Dispatch 1288 1 - policy for outbound connectors
URL: https://github.com/apache/qpid-dispatch/pull/472#discussion_r267829682
 
 

 ##########
 File path: src/policy.c
 ##########
 @@ -404,18 +409,47 @@ bool qd_policy_open_lookup_user(
         } else {
             qd_log(policy->log_source, QD_LOG_DEBUG, "Internal: lookup_user: lookup_user");
         }
+        Py_XDECREF(module);
     }
-    if (!res) {
-        if (module) {
-            Py_XDECREF(module);
-        }
-        qd_python_unlock(lock_state);
-        return false;
-    }
+    qd_python_unlock(lock_state);
 
-    // 
     if (name_buf[0]) {
-        // Go get the named settings
+        qd_log(policy->log_source,
+           QD_LOG_TRACE,
+           "[%"PRIu64"]: ALLOW AMQP Open lookup_user: %s, rhost: %s, vhost: %s, connection: %s. Usergroup: '%s'%s",
+           conn_id, username, hostip, vhost, conn_name, name_buf, (res ? "" : " Internal error."));
+    }
+    return res;
+}
+
+
+/** Fetch policy settings for a vhost/group
+ * A vhost database user group name has been returned by qd_policy_open_lookup_user
+ * or by some configuration value. Access the vhost database for that group and
+ * extract the run-time settings.
+ * @param[in] policy pointer to policy
+ * @param[in] username authenticated user name (for logging)
+ * @param[in] hostip numeric host ip address (for logging)
+ * @param[in] vhost vhost name
+ * @param[in] conn_name connection name for tracking (for logging)
+ * @param[in] name_buf group name that holds the settings of interest
+ * @param[in] conn_id connection id for log tracking (for logging)
+ * @param[out] settings pointer to settings object to be filled with policy values
+ **/
+bool qd_policy_open_fetch_settings(
+    qd_policy_t *policy,
+    const char *username,
+    const char *hostip,
+    const char *vhost,
+    const char *conn_name,
+    const char *name_buf,
+    uint64_t    conn_id,
 
 Review comment:
   Well spotted. These are left over from when there was a log message that used them.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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