Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
302a3c9a
Commit
302a3c9a
authored
Mar 20, 2015
by
Stephane Glondu
Browse files
Many renamings in auth-related interfaces
parent
4b24fdb5
Changes
8
Show whitespace changes
Inline
Side-by-side
src/web/auth_cas.ml
View file @
302a3c9a
...
...
@@ -33,7 +33,7 @@ module type CONFIG = sig
val
server
:
string
end
module
Make
(
C
:
CONFIG
)
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_HANDLERS
=
struct
module
Make
(
C
:
CONFIG
)
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_
INSTANCE_
HANDLERS
=
struct
let
scope
=
Eliom_common
.
default_session_scope
...
...
@@ -142,7 +142,7 @@ let parse_config ~attributes =
let
make
{
server
}
=
let
module
C
=
struct
let
server
=
server
end
in
(
module
Make
(
C
)
:
AUTH_
SERVI
CE
)
(
module
Make
(
C
)
:
AUTH_
MAKE_INSTAN
CE
)
type
c
=
config
...
...
src/web/auth_dummy.ml
View file @
302a3c9a
...
...
@@ -32,7 +32,7 @@ let parse_config ~attributes =
|
[]
->
Some
()
|
_
->
None
module
Make
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_HANDLERS
=
struct
module
Make
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_
INSTANCE_
HANDLERS
=
struct
module
L
=
Web_auth
.
MakeLinks
(
N
)
...
...
@@ -73,7 +73,7 @@ module Make (N : NAME) (S : AUTH_SERVICES) : AUTH_HANDLERS = struct
end
let
make
()
=
(
module
Make
:
AUTH_
SERVI
CE
)
let
make
()
=
(
module
Make
:
AUTH_
MAKE_INSTAN
CE
)
module
A
:
AUTH_SYSTEM
=
struct
type
config
=
unit
...
...
src/web/auth_password.ml
View file @
302a3c9a
...
...
@@ -49,7 +49,7 @@ let load_db name file =
let
(
/
)
=
Filename
.
concat
module
Make
(
C
:
CONFIG
)
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_HANDLERS
=
struct
module
Make
(
C
:
CONFIG
)
(
N
:
NAME
)
(
S
:
AUTH_SERVICES
)
:
AUTH_
INSTANCE_
HANDLERS
=
struct
module
L
=
Web_auth
.
MakeLinks
(
N
)
...
...
@@ -147,7 +147,7 @@ end
let
make
{
db
}
=
let
module
C
=
struct
let
db
=
db
end
in
(
module
Make
(
C
)
:
AUTH_
SERVI
CE
)
(
module
Make
(
C
)
:
AUTH_
MAKE_INSTAN
CE
)
type
c
=
config
...
...
src/web/web_auth.ml
View file @
302a3c9a
...
...
@@ -41,7 +41,7 @@ let register_auth_system auth_system =
type
logged_user
=
{
user_user
:
user
;
user_handlers
:
(
module
AUTH_HANDLERS
);
user_handlers
:
(
module
AUTH_
INSTANCE_
HANDLERS
);
}
module
MakeLinks
(
N
:
NAME
)
=
struct
...
...
@@ -85,7 +85,7 @@ module Make (N : NAME) = struct
Eliom_reference
.
set
user
(
Some
logged_user
)
>>
cont
()
()
in
let
module
A
=
(
val
user_handlers
:
AUTH_HANDLERS
)
in
let
module
A
=
(
val
user_handlers
:
AUTH_
INSTANCE_
HANDLERS
)
in
A
.
login
cont
()
with
Not_found
->
fail_http
404
...
...
@@ -135,16 +135,16 @@ module Make (N : NAME) = struct
let
path
=
N
.
path
@
[
"auth"
;
instance
]
let
kind
=
N
.
kind
end
in
let
module
A
=
(
val
auth
:
AUTH_
SERVI
CE
)
(
N
)
(
Services
)
in
let
i
=
(
module
A
:
AUTH_HANDLERS
)
in
let
module
A
=
(
val
auth
:
AUTH_
MAKE_INSTAN
CE
)
(
N
)
(
Services
)
in
let
i
=
(
module
A
:
AUTH_
INSTANCE_
HANDLERS
)
in
Hashtbl
.
add
auth_instances
instance
i
;
auth_instance_names
:=
instance
::
!
auth_instance_names
)
)
xs
module
Handlers
:
AUTH_HANDLERS
_PUBLIC
=
struct
module
Handlers
:
AUTH_HANDLERS
=
struct
let
do_
login
service
cont
()
=
let
login
service
cont
()
=
let
cont
()
()
=
match
service
with
|
Some
name
->
do_login_using
name
cont
...
...
@@ -161,7 +161,7 @@ module Make (N : NAME) = struct
A
.
logout
cont
()
|
None
->
cont
()
()
let
do_
logout
cont
()
=
let
logout
cont
()
=
match_lwt
Eliom_reference
.
get
user
with
|
Some
u
->
security_log
(
fun
()
->
...
...
src/web/web_auth.mli
View file @
302a3c9a
...
...
@@ -31,5 +31,5 @@ module MakeLinks (N : NAME) : AUTH_LINKS
module
Make
(
C
:
NAME
)
:
sig
val
configure
:
auth_config
list
->
unit
module
Services
:
AUTH_SERVICES
module
Handlers
:
AUTH_HANDLERS
_PUBLIC
module
Handlers
:
AUTH_HANDLERS
end
src/web/web_election.ml
View file @
302a3c9a
...
...
@@ -282,11 +282,11 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
let
login
service
()
=
lwt
cont
=
Eliom_reference
.
get
Web_services
.
cont
in
Auth
.
Handlers
.
do_
login
service
cont
()
Auth
.
Handlers
.
login
service
cont
()
let
logout
()
()
=
lwt
cont
=
Eliom_reference
.
get
Web_services
.
cont
in
Auth
.
Handlers
.
do_
logout
cont
()
Auth
.
Handlers
.
logout
cont
()
module
T
=
Web_templates
...
...
src/web/web_signatures.mli
View file @
302a3c9a
...
...
@@ -91,14 +91,14 @@ type service_handler = unit ->
type
'
a
service_cont
=
(
'
a
->
service_handler
)
->
service_handler
module
type
AUTH_HANDLERS
=
sig
module
type
AUTH_
INSTANCE_
HANDLERS
=
sig
val
login
:
string
service_cont
val
logout
:
unit
service_cont
end
module
type
AUTH_HANDLERS
_PUBLIC
=
sig
val
do_
login
:
string
option
->
unit
service_cont
val
do_
logout
:
unit
service_cont
module
type
AUTH_HANDLERS
=
sig
val
login
:
string
option
->
unit
service_cont
val
logout
:
unit
service_cont
end
module
type
WEB_BALLOT_BOX
=
sig
...
...
@@ -153,10 +153,10 @@ module type NAME = sig
val
kind
:
[
`Site
|
`Election
of
Uuidm
.
t
*
string
]
end
module
type
AUTH_
SERVI
CE
=
module
type
AUTH_
MAKE_INSTAN
CE
=
functor
(
N
:
NAME
)
->
functor
(
S
:
AUTH_SERVICES
)
->
AUTH_HANDLERS
AUTH_
INSTANCE_
HANDLERS
module
type
AUTH_SYSTEM
=
sig
type
config
...
...
@@ -167,5 +167,5 @@ module type AUTH_SYSTEM = sig
attributes
:
(
string
*
string
)
list
->
config
option
val
make
:
config
->
(
module
AUTH_
SERVI
CE
)
val
make
:
config
->
(
module
AUTH_
MAKE_INSTAN
CE
)
end
src/web/web_site_auth.ml
View file @
302a3c9a
...
...
@@ -34,11 +34,11 @@ open Web_services
let
login
service
()
=
lwt
cont
=
Eliom_reference
.
get
Web_services
.
cont
in
A
.
Handlers
.
do_
login
service
cont
()
A
.
Handlers
.
login
service
cont
()
let
logout
()
()
=
lwt
cont
=
Eliom_reference
.
get
Web_services
.
cont
in
A
.
Handlers
.
do_
logout
cont
()
A
.
Handlers
.
logout
cont
()
let
()
=
Any
.
register
~
service
:
site_login
login
let
()
=
Any
.
register
~
service
:
site_logout
logout
Write
Preview
Supports
Markdown
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