2
* Copyright (C) 2006-2009 Citrix Systems Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published
6
* by the Free Software Foundation; version 2.1 only. with the special
7
* exception on linking described in file LICENSE.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Lesser General Public License for more details.
15
* @group Access Control
22
let call_with_exception_handler fn =
24
| Extauth.Extauth_is_disabled ->
25
raise (Api_errors.Server_error(Api_errors.auth_is_disabled, []))
26
| Extauth.Unknown_extauth_type msg ->
27
raise (Api_errors.Server_error(Api_errors.auth_unknown_type, [msg]))
29
| Auth_signature.Subject_cannot_be_resolved ->
30
raise (Api_errors.Server_error(Api_errors.subject_cannot_be_resolved, []))
31
| Auth_signature.Auth_service_error (errtag,msg) ->
32
raise (Api_errors.Server_error(Api_errors.auth_service_error, [msg]))
34
raise (Api_errors.Server_error(Api_errors.auth_service_error, [ExnHelper.string_of_exn e]))
36
(* PRECONDITION: All of these additional calls require a valid session to be presented.*)
37
(* ==> the session validity is already checked in every server.ml call by using Session_check.check *)
39
let get_subject_identifier ~__context ~subject_name =
40
call_with_exception_handler (fun () -> ((Ext_auth.d()).get_subject_identifier subject_name))
42
let get_group_membership ~__context ~subject_identifier =
43
call_with_exception_handler (fun () -> ((Ext_auth.d()).query_group_membership subject_identifier))
45
let get_subject_information_from_identifier ~__context ~subject_identifier =
46
call_with_exception_handler (fun () -> ((Ext_auth.d()).query_subject_information subject_identifier))