Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ai
sso
Commits
b5ec86fe
Commit
b5ec86fe
authored
Aug 12, 2013
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace "using namespace" with explicit imports
parent
772698cb
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
76 additions
and
58 deletions
+76
-58
src/mod_sso/mod_sso.cc
src/mod_sso/mod_sso.cc
+3
-1
src/mod_sso/mod_sso.h
src/mod_sso/mod_sso.h
+22
-19
src/mod_sso/sso_utils.cc
src/mod_sso/sso_utils.cc
+1
-1
src/mod_sso/test/sso_utils_unittest.cc
src/mod_sso/test/sso_utils_unittest.cc
+3
-3
src/pam_sso/pam_sso.cc
src/pam_sso/pam_sso.cc
+0
-2
src/sso/base64.cc
src/sso/base64.cc
+9
-7
src/sso/signer.cc
src/sso/signer.cc
+1
-3
src/sso/sso.cc
src/sso/sso.cc
+3
-1
src/sso/ssotool.cc
src/sso/ssotool.cc
+7
-1
src/sso/string_utils.h
src/sso/string_utils.h
+5
-2
src/sso/test/nacl_unittest.cc
src/sso/test/nacl_unittest.cc
+1
-1
src/sso/test/signer_unittest.cc
src/sso/test/signer_unittest.cc
+2
-1
src/sso/test/sso_unittest.cc
src/sso/test/sso_unittest.cc
+2
-1
src/sso/test/string_utils_unittest.cc
src/sso/test/string_utils_unittest.cc
+3
-1
src/sso/test/ticket_unittest.cc
src/sso/test/ticket_unittest.cc
+1
-2
src/sso/test/verifier_unittest.cc
src/sso/test/verifier_unittest.cc
+2
-1
src/sso/ticket.cc
src/sso/ticket.cc
+8
-6
src/sso/ticket.h
src/sso/ticket.h
+0
-1
src/sso/verifier.cc
src/sso/verifier.cc
+3
-4
No files found.
src/mod_sso/mod_sso.cc
View file @
b5ec86fe
...
...
@@ -39,7 +39,9 @@
extern
"C"
module
AP_MODULE_DECLARE_DATA
sso_module
;
using
namespace
std
;
using
std
::
map
;
using
std
::
string
;
using
std
::
ostringstream
;
typedef
struct
{
const
char
*
login_server
;
...
...
src/mod_sso/mod_sso.h
View file @
b5ec86fe
...
...
@@ -38,24 +38,27 @@
struct
request_rec
;
using
std
::
string
;
using
std
::
map
;
using
std
::
vector
;
namespace
modsso
{
using
namespace
std
;
typedef
map
<
string
,
string
>
params_t
;
// sso_utils.cc
void
debug
(
const
string
&
s
);
string
url_decode
(
const
string
&
str
);
string
url_encode
(
const
string
&
str
);
string
base64_decode
(
const
string
&
str
);
params_t
parse_query_string
(
const
string
&
str
);
void
make_cookie_value
(
string
&
cookie_value
,
const
string
&
name
,
const
string
&
session_id
,
const
string
&
path
,
int
cookie_lifespan
);
void
set_cookie
(
request_rec
*
r
,
const
std
::
string
&
cookie_name
,
const
std
::
string
&
value
,
const
std
::
string
&
path
);
void
del_cookie
(
request_rec
*
r
,
const
std
::
string
&
cookie_name
);
vector
<
string
>
explode
(
string
s
,
string
e
);
}
typedef
map
<
string
,
string
>
params_t
;
// sso_utils.cc
void
debug
(
const
string
&
s
);
string
url_decode
(
const
string
&
str
);
string
url_encode
(
const
string
&
str
);
string
base64_decode
(
const
string
&
str
);
params_t
parse_query_string
(
const
string
&
str
);
void
make_cookie_value
(
string
&
cookie_value
,
const
string
&
name
,
const
string
&
session_id
,
const
string
&
path
,
int
cookie_lifespan
);
void
set_cookie
(
request_rec
*
r
,
const
string
&
cookie_name
,
const
string
&
value
,
const
string
&
path
);
void
del_cookie
(
request_rec
*
r
,
const
string
&
cookie_name
);
vector
<
string
>
explode
(
string
s
,
string
e
);
}
// namespace
src/mod_sso/sso_utils.cc
View file @
b5ec86fe
...
...
@@ -37,7 +37,7 @@
namespace
modsso
{
using
namespace
std
;
using
std
::
string
;
void
debug
(
const
string
&
s
)
{
#ifdef DEBUG
...
...
src/mod_sso/test/sso_utils_unittest.cc
View file @
b5ec86fe
#include <iostream>
#include <stdlib.h>
#include "../mod_sso.h"
#include <gtest/gtest.h>
#include <string>
#include "../mod_sso.h"
using
namespace
std
;
using
std
::
string
;
namespace
{
...
...
src/pam_sso/pam_sso.cc
View file @
b5ec86fe
...
...
@@ -25,8 +25,6 @@
#include <string.h>
#include "pam_sso.h"
using
namespace
std
;
static
const
char
*
kPasswordPrompt
=
"Password: "
;
static
void
parse_config
(
pam_sso_config
*
cfg
,
int
argc
,
const
char
**
argv
)
...
...
src/sso/base64.cc
View file @
b5ec86fe
...
...
@@ -25,13 +25,15 @@
*/
#include <
iostream
>
#include <
string
>
#include "sso/base64.h"
using
std
::
string
;
namespace
sso
{
static
const
st
d
::
st
ring
base64_chars
=
static
const
string
base64_chars
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"
;
...
...
@@ -41,14 +43,14 @@ static inline bool is_base64(unsigned char c) {
return
(
isalnum
(
c
)
||
(
c
==
'+'
)
||
(
c
==
'/'
));
}
st
d
::
string
base64_encode
(
const
std
::
string
&
bytes_to_encode
)
{
st
d
::
st
ring
ret
;
st
ring
base64_encode
(
const
string
&
bytes_to_encode
)
{
string
ret
;
int
i
=
0
;
int
j
=
0
;
unsigned
char
char_array_3
[
3
];
unsigned
char
char_array_4
[
4
];
for
(
st
d
::
st
ring
::
const_iterator
c
=
bytes_to_encode
.
begin
();
for
(
string
::
const_iterator
c
=
bytes_to_encode
.
begin
();
c
!=
bytes_to_encode
.
end
();
c
++
)
{
char_array_3
[
i
++
]
=
*
c
;
...
...
@@ -83,13 +85,13 @@ std::string base64_encode(const std::string& bytes_to_encode) {
return
ret
;
}
st
d
::
string
base64_decode
(
const
std
::
string
&
encoded_string
)
{
st
ring
base64_decode
(
const
string
&
encoded_string
)
{
int
in_len
=
encoded_string
.
size
();
int
i
=
0
;
int
j
=
0
;
int
in_
=
0
;
unsigned
char
char_array_4
[
4
],
char_array_3
[
3
];
st
d
::
st
ring
ret
;
string
ret
;
while
(
in_len
--
&&
(
encoded_string
[
in_
]
!=
'='
)
&&
is_base64
(
encoded_string
[
in_
]))
{
char_array_4
[
i
++
]
=
encoded_string
[
in_
];
in_
++
;
...
...
src/sso/signer.cc
View file @
b5ec86fe
...
...
@@ -25,14 +25,12 @@
#include <time.h>
#include <crypto_sign.h>
#include <sstream>
#include <string>
#include "sso/base64.h"
#include "sso/sso.h"
using
namespace
std
;
using
namespace
sso
;
using
std
::
string
;
namespace
sso
{
...
...
src/sso/sso.cc
View file @
b5ec86fe
...
...
@@ -31,7 +31,9 @@
#include "sso/sso.h"
using
namespace
std
;
using
std
::
ifstream
;
using
std
::
stringstream
;
using
std
::
string
;
namespace
sso
{
...
...
src/sso/ssotool.cc
View file @
b5ec86fe
...
...
@@ -32,7 +32,13 @@
#include "sso/sso.h"
using
namespace
std
;
using
std
::
string
;
using
std
::
ifstream
;
using
std
::
ofstream
;
using
std
::
stringstream
;
using
std
::
cerr
;
using
std
::
cout
;
using
std
::
endl
;
static
void
write_to_file
(
const
char
*
path
,
const
string
&
contents
)
{
ofstream
out
(
path
,
ofstream
::
out
);
...
...
src/sso/string_utils.h
View file @
b5ec86fe
...
...
@@ -33,9 +33,12 @@
#include <algorithm>
#include <iterator>
namespace
sso
{
using
std
::
string
;
using
std
::
insert_iterator
;
using
std
::
inserter
;
using
std
::
ostringstream
;
using
namespace
std
;
namespace
sso
{
template
<
class
T
>
T
string_split
(
const
string
&
str
,
char
delim
)
{
...
...
src/sso/test/nacl_unittest.cc
View file @
b5ec86fe
...
...
@@ -3,7 +3,7 @@
#include <string>
#include "test_common.h"
using
namespace
std
;
using
std
::
string
;
namespace
{
...
...
src/sso/test/signer_unittest.cc
View file @
b5ec86fe
...
...
@@ -3,7 +3,8 @@
#include "base64.h"
#include "sso.h"
using
namespace
std
;
using
std
::
string
;
using
std
::
vector
;
namespace
{
...
...
src/sso/test/sso_unittest.cc
View file @
b5ec86fe
...
...
@@ -4,7 +4,8 @@
#include <gtest/gtest.h>
#include "sso.h"
using
namespace
std
;
using
std
::
ofstream
;
using
std
::
string
;
namespace
{
...
...
src/sso/test/string_utils_unittest.cc
View file @
b5ec86fe
...
...
@@ -29,7 +29,9 @@
#include <vector>
#include <gtest/gtest.h>
using
namespace
std
;
using
std
::
string
;
using
std
::
vector
;
using
std
::
set
;
namespace
{
...
...
src/sso/test/ticket_unittest.cc
View file @
b5ec86fe
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <sys/stat.h>
...
...
@@ -7,7 +6,7 @@
#include "sso.h"
#include "test_common.h"
using
namespace
std
;
using
std
::
string
;
namespace
{
...
...
src/sso/test/verifier_unittest.cc
View file @
b5ec86fe
...
...
@@ -4,7 +4,8 @@
#include "sso.h"
#include "test_common.h"
using
namespace
std
;
using
std
::
string
;
using
std
::
ostringstream
;
namespace
{
...
...
src/sso/ticket.cc
View file @
b5ec86fe
...
...
@@ -38,7 +38,9 @@
#define GROUPS_SEP ','
using
namespace
std
;
using
std
::
string
;
using
std
::
ostringstream
;
using
std
::
vector
;
namespace
sso
{
...
...
@@ -50,7 +52,7 @@ string Ticket::serialize() {
<<
service_
<<
TICKET_SEP
<<
domain_
<<
TICKET_SEP
<<
expires_
<<
TICKET_SEP
<<
s
so
::
s
tring_join
<
groups_t
>
(
groups_
.
begin
(),
groups_
.
end
(),
GROUPS_SEP
);
<<
string_join
<
groups_t
>
(
groups_
.
begin
(),
groups_
.
end
(),
GROUPS_SEP
);
return
obuf
.
str
();
}
...
...
@@ -58,16 +60,16 @@ string Ticket::serialize() {
Ticket
::
Ticket
(
const
string
&
ticket_string
)
throw
(
sso
::
sso_error
)
{
vector
<
string
>
parts
(
s
so
::
s
tring_split
<
vector
<
string
>
>
(
ticket_string
,
TICKET_SEP
));
string_split
<
vector
<
string
>
>
(
ticket_string
,
TICKET_SEP
));
if
(
parts
.
size
()
!=
6
)
throw
sso
::
sso
_error
(
"wrong format"
);
throw
sso_error
(
"wrong format"
);
if
(
parts
[
0
]
!=
TICKET_VERSION
)
throw
sso
::
sso
_error
(
"unsupported ticket version"
);
throw
sso_error
(
"unsupported ticket version"
);
user_
=
parts
[
1
];
service_
=
parts
[
2
];
domain_
=
parts
[
3
];
expires_
=
strtol
(
parts
[
4
].
c_str
(),
NULL
,
0
);
groups_
=
s
so
::
s
tring_split
<
groups_t
>
(
parts
[
5
],
GROUPS_SEP
);
groups_
=
string_split
<
groups_t
>
(
parts
[
5
],
GROUPS_SEP
);
}
}
// namespace sso
src/sso/ticket.h
View file @
b5ec86fe
...
...
@@ -28,7 +28,6 @@
#include <time.h>
#include <exception>
#include <set>
#include <string>
...
...
src/sso/verifier.cc
View file @
b5ec86fe
...
...
@@ -22,8 +22,6 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <iostream>
#include <sstream>
#include <string>
#include <time.h>
...
...
@@ -32,8 +30,9 @@
#include "sso/base64.h"
#include "sso/sso.h"
using
namespace
std
;
using
namespace
sso
;
using
std
::
string
;
using
std
::
set_intersection
;
using
std
::
insert_iterator
;
#define ALLOWED_TIME_SKEW 30
...
...
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