Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flexisip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
flexisip
Commits
b376cadf
Commit
b376cadf
authored
Jun 12, 2015
by
Guillaume BIENKOWSKI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SOCI auth db backend. Have to be tested yet in testing environment.
parent
4bab04b5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
2 deletions
+44
-2
CMakeLists.txt
CMakeLists.txt
+7
-1
flexisip-config.h.in
cmake/flexisip-config.h.in
+1
-0
CMakeLists.txt
src/CMakeLists.txt
+6
-0
authdb.cc
src/authdb.cc
+4
-0
authdb.hh
src/authdb.hh
+24
-0
module-auth.cc
src/module-auth.cc
+2
-1
No files found.
CMakeLists.txt
View file @
b376cadf
...
...
@@ -39,6 +39,7 @@ option(ENABLE_BOOSTLOG "" YES)
option
(
ENABLE_DATEHANDLER
""
NO
)
option
(
ENABLE_DOC
""
YES
)
option
(
ENABLE_ODB
""
YES
)
option
(
ENABLE_SOCI
""
YES
)
option
(
ENABLE_ODB_MYSQL
""
YES
)
option
(
ENABLE_MONOTONIC_CLOCK_REGISTRATIONS
""
NO
)
option
(
ENABLE_ODBC
"Build ODBC support"
YES
)
...
...
@@ -139,7 +140,7 @@ if(ENABLE_ODBC)
if
(
NOT ODBC_SQL_HEADERS
)
message
(
FATAL_ERROR
"ODBC Mysql headers not found."
)
else
()
message
(
STATUS
"ODBC
K
Mysql
${
ODBC_SQL_HEADERS
}
"
)
message
(
STATUS
"ODBC Mysql
${
ODBC_SQL_HEADERS
}
"
)
endif
()
# check that odbc_config gives us a correct library path
...
...
@@ -209,6 +210,11 @@ if(ENABLE_PRESENCE)
endif
()
endif
()
if
(
ENABLE_SOCI
)
find_package
(
Soci REQUIRED COMPONENTS mysql
)
find_path
(
SOCI_MYSQL_INCLUDES NAMES mysql.h PATH_SUFFIXES mysql
)
endif
()
# Boost checks
set
(
BOOST_COMPONENTS
)
if
(
ENABLE_BOOSTLOG
)
...
...
cmake/flexisip-config.h.in
View file @
b376cadf
...
...
@@ -11,6 +11,7 @@
#cmakedefine ENABLE_ODBC 1
#cmakedefine ENABLE_REDIS 1
#cmakedefine ENABLE_XSD 1
#cmakedefine ENABLE_SOCI 1
#cmakedefine HAVE_DATEHANDLER 1
#cmakedefine HAVE_ARC4RANDOM 1
...
...
src/CMakeLists.txt
View file @
b376cadf
...
...
@@ -205,6 +205,12 @@ if(ENABLE_PUSHNOTIFICATION)
list
(
APPEND FLEXISIP_INCLUDES
${
Boost_INCLUDE_DIRS
}
${
OPENSSL_INCLUDE_DIRS
}
)
endif
()
if
(
ENABLE_SOCI
)
list
(
APPEND FLEXISIP_SOURCES authdb-soci.cc
)
list
(
APPEND FLEXISIP_LIBS
${
SOCI_LIBRARY
}
)
list
(
APPEND FLEXISIP_INCLUDES
${
SOCI_INCLUDE_DIRS
}
${
SOCI_MYSQL_INCLUDES
}
)
endif
()
message
(
STATUS
"Flexisip LIBS :
${
FLEXISIP_LIBS
}
"
)
message
(
STATUS
"Flexisip INCLUDES :
${
FLEXISIP_INCLUDES
}
"
)
message
(
STATUS
"Flexisip DEPENDENCIES :
${
FLEXISIP_DEPENDENCIES
}
"
)
...
...
src/authdb.cc
View file @
b376cadf
...
...
@@ -53,6 +53,10 @@ AuthDb* AuthDb::get() {
#if ENABLE_ODBC
}
else
if
(
impl
==
"odbc"
)
{
sUnique
=
new
OdbcAuthDb
();
#endif
#if ENABLE_SOCI
}
else
if
(
impl
==
"soci"
)
{
sUnique
=
new
SociAuthDB
();
#endif
}
}
...
...
src/authdb.hh
View file @
b376cadf
...
...
@@ -147,4 +147,28 @@ public:
#endif
/* ENABLE_ODBC */
#if ENABLE_SOCI
#include "soci.h"
#include "mysql/soci-mysql.h"
class
SociAuthDB
:
public
AuthDb
{
virtual
~
SociAuthDB
();
public
:
SociAuthDB
();
void
setConnectionParameters
(
const
string
&
domain
,
const
string
&
request
);
virtual
void
getPasswordFromBackend
(
su_root_t
*
root
,
const
std
::
string
&
id
,
const
std
::
string
&
domain
,
const
std
::
string
&
authid
,
AuthDbListener
*
listener
);
private
:
void
getPasswordWithPool
(
su_root_t
*
root
,
const
std
::
string
&
id
,
const
std
::
string
&
domain
,
const
std
::
string
&
authid
,
AuthDbListener
*
listener
);
size_t
poolSize
;
soci
::
connection_pool
*
pool
;
std
::
string
connection_string
;
std
::
string
backend
;
std
::
string
get_password_request
;
};
#endif
/* ENABLE_SOCI */
#endif
src/module-auth.cc
View file @
b376cadf
...
...
@@ -282,7 +282,7 @@ public:
{
StringList
,
"trusted-hosts"
,
"List of whitespace separated IP which will not be challenged."
,
""
},
{
String
,
"db-implementation"
,
"Database backend implementation [odbc,file,fixed]."
,
"fixed"
},
{
String
,
"db-implementation"
,
"Database backend implementation [odbc,
soci,
file,fixed]."
,
"fixed"
},
{
String
,
"datasource"
,
"Odbc connection string to use for connecting to database. "
"ex1: DSN=myodbc3; where 'myodbc3' is the datasource name. "
...
...
@@ -318,6 +318,7 @@ public:
"This MUST not be used for production as it is a real security hole."
,
"false"
},
{
Boolean
,
"disable-qop-auth"
,
"Disable the QOP authentication method. Default is to use it, use this flag to disable it if needed."
,
"false"
},
config_item_end
};
mc
->
addChildrenValues
(
items
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment