mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
bug #847: Auth drivers are set in OpenNebula core. Login tokens do not include the driver, so the hash logic needs update, see #911
This commit is contained in:
1 parent
7683ba8998
commit
cbf64ecf1b
12 files changed
+141
-59
No files matched your search
@@ -428,12 +428,12 @@ public:
|
||||
am.loop(0,0);
|
||||
};
|
||||
|
||||
bool plain_authorize()
|
||||
bool core_authorize()
|
||||
{
|
||||
return ( uid == 0 || self_authorize );
|
||||
}
|
||||
|
||||
bool plain_authenticate()
|
||||
bool core_authenticate()
|
||||
{
|
||||
return (password == session);
|
||||
}
|
||||
|
||||
+8
-1
@@ -164,6 +164,11 @@ private:
|
||||
*/
|
||||
string password;
|
||||
|
||||
/**
|
||||
* Authentication driver for this user
|
||||
*/
|
||||
string auth_driver;
|
||||
|
||||
/**
|
||||
* Flag marking user enabled/disabled
|
||||
*/
|
||||
@@ -210,10 +215,12 @@ protected:
|
||||
int _gid,
|
||||
const string& _uname,
|
||||
const string& _gname,
|
||||
const string& _password,
|
||||
const string& _password,
|
||||
const string& _auth_driver,
|
||||
bool _enabled):
|
||||
PoolObjectSQL(id,_uname,-1,_gid,"",_gname,table),
|
||||
password(_password),
|
||||
auth_driver(_auth_driver),
|
||||
enabled(_enabled)
|
||||
{
|
||||
obj_template = new UserTemplate;
|
||||
|
||||
+7
-1
@@ -54,6 +54,7 @@ public:
|
||||
const string& uname,
|
||||
const string& gname,
|
||||
const string& password,
|
||||
const string& auth,
|
||||
bool enabled,
|
||||
string& error_str);
|
||||
|
||||
@@ -133,6 +134,11 @@ public:
|
||||
return PoolSQL::dump(oss, "USER_POOL", User::table, where);
|
||||
};
|
||||
|
||||
/**
|
||||
* Name for the OpenNebula core authentication process
|
||||
*/
|
||||
static const char * CORE_AUTH;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Factory method to produce User objects
|
||||
@@ -140,7 +146,7 @@ private:
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
{
|
||||
return new User(-1,-1,"","","",true);
|
||||
return new User(-1,-1,"","","",UserPool::CORE_AUTH,true);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user