summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2010-11-09 21:15:03 +0000
committerTed Ross <tross@apache.org>2010-11-09 21:15:03 +0000
commit42d18e5791c0f79588d5264f2b0c96ee0a39c122 (patch)
treef8436d4e4e55ffae9754df0655f0bd4d06abcf36 /qpid/cpp/include
parentbb79785992b6e4aacdc213e00ff367fa709e35b1 (diff)
downloadqpid-python-42d18e5791c0f79588d5264f2b0c96ee0a39c122.tar.gz
QPID-2934 Feature to pass the authenticated userId to QMF agent method handlers for authorization
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1033232 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/management/Manageable.h5
-rw-r--r--qpid/cpp/include/qpid/management/ManagementObject.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/qpid/cpp/include/qpid/management/Manageable.h b/qpid/cpp/include/qpid/management/Manageable.h
index 7a72cc1592..1e5cd8bc42 100644
--- a/qpid/cpp/include/qpid/management/Manageable.h
+++ b/qpid/cpp/include/qpid/management/Manageable.h
@@ -63,6 +63,11 @@ class QPID_COMMON_EXTERN Manageable
// method being called and must be down-cast to the appropriate sub class
// before use.
virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text);
+
+ // This optional method can be overridden to allow the agent application to
+ // authorize method invocations. Return true iff the authenticated user identified
+ // in userId us authorized to execute the method.
+ virtual bool AuthorizeMethod(uint32_t methodId, Args& args, const std::string& userId);
};
inline Manageable::~Manageable(void) {}
diff --git a/qpid/cpp/include/qpid/management/ManagementObject.h b/qpid/cpp/include/qpid/management/ManagementObject.h
index 59a7f00603..dec5a63ee9 100644
--- a/qpid/cpp/include/qpid/management/ManagementObject.h
+++ b/qpid/cpp/include/qpid/management/ManagementObject.h
@@ -175,7 +175,8 @@ protected:
virtual void mapDecodeValues(const types::Variant::Map& map) = 0;
virtual void doMethod(std::string& methodName,
const types::Variant::Map& inMap,
- types::Variant::Map& outMap) = 0;
+ types::Variant::Map& outMap,
+ const std::string& userId) = 0;
QPID_COMMON_EXTERN void writeTimestamps(types::Variant::Map& map) const;
QPID_COMMON_EXTERN void readTimestamps(const types::Variant::Map& buf);
@@ -187,7 +188,7 @@ protected:
virtual void readProperties(const std::string&) {}
virtual void writeProperties(std::string&) const {}
virtual void writeStatistics(std::string&, bool = false) {}
- virtual void doMethod(std::string&, const std::string&, std::string&) {}
+ virtual void doMethod(std::string&, const std::string&, std::string&, const std::string&) {}
QPID_COMMON_EXTERN virtual void setReference(ObjectId objectId);