Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32711 Define LDAP security manager abstraction #19292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dali/server/daldap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class CDaliLdapConnection: implements IDaliLdapConnection, public CInterface

if (!authenticated)
{
CLdapSecManager* ldapSecMgr = dynamic_cast<CLdapSecManager*>(ldapsecurity.get());
ILdapSecManager* ldapSecMgr = dynamic_cast<ILdapSecManager*>(ldapsecurity.get());
if (!ldapSecMgr || !ldapSecMgr->isSuperUser(user))
{
DBGLOG("LDAP: EnableScopeScans caller %s must be an LDAP HPCC Admin", username.str());
Expand Down
2 changes: 1 addition & 1 deletion esp/platform/espcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class CEspContext : public CInterface, implements IEspContext
virtual void ensureSuperUser(unsigned excCode, const char* excMsg)
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(m_secmgr.get());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(m_secmgr.get());
if (secmgr && !secmgr->isSuperUser(m_user.get()))
{
setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down
12 changes: 6 additions & 6 deletions esp/services/espcontrol/ws_espcontrolservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ bool CWSESPControlEx::onSetLogging(IEspContext& context, IEspSetLoggingRequest&
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down Expand Up @@ -220,7 +220,7 @@ bool CWSESPControlEx::onGetLoggingSettings(IEspContext& context, IEspGetLoggingS
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down Expand Up @@ -264,7 +264,7 @@ bool CWSESPControlEx::onSessionQuery(IEspContext& context, IEspSessionQueryReque
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down Expand Up @@ -305,7 +305,7 @@ bool CWSESPControlEx::onSessionInfo(IEspContext& context, IEspSessionInfoRequest
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down Expand Up @@ -349,7 +349,7 @@ bool CWSESPControlEx::onCleanSession(IEspContext& context, IEspCleanSessionReque
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down Expand Up @@ -384,7 +384,7 @@ bool CWSESPControlEx::onSetSessionTimeout(IEspContext& context, IEspSetSessionTi
try
{
#ifdef _USE_OPENLDAP
CLdapSecManager* secmgr = dynamic_cast<CLdapSecManager*>(context.querySecManager());
ILdapSecManager* secmgr = dynamic_cast<ILdapSecManager*>(context.querySecManager());
if(secmgr && !secmgr->isSuperUser(context.queryUser()))
{
context.setAuthStatus(AUTH_STATUS_NOACCESS);
Expand Down
4 changes: 2 additions & 2 deletions esp/services/ldapenvironment/ldapenvironmentService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CldapenvironmentEx : public Cldapenvironment //base class name built from
{
private:
IPropertyTree * cfg;
CLdapSecManager* secmgr = nullptr;
ILdapSecManager* secmgr = nullptr;
StringBuffer ldapRootOU;
StringBuffer sharedFilesBaseDN;
StringBuffer sharedGroupsBaseDN;
Expand Down Expand Up @@ -52,7 +52,7 @@ class CldapenvironmentEx : public Cldapenvironment //base class name built from
virtual void init(IPropertyTree *_cfg, const char *_process, const char *_service);
bool onLDAPQueryDefaults(IEspContext &context, IEspLDAPQueryDefaultsRequest &req, IEspLDAPQueryDefaultsResponse &resp);
bool onLDAPCreateEnvironment(IEspContext &context, IEspLDAPCreateEnvironmentRequest &req, IEspLDAPCreateEnvironmentResponse &resp);
void setSecMgr( ISecManager*sm) { secmgr = dynamic_cast<CLdapSecManager*>(sm); }
void setSecMgr( ISecManager*sm) { secmgr = dynamic_cast<ILdapSecManager*>(sm); }
};


Expand Down
Loading
Loading