-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIdentity.alusus
More file actions
60 lines (54 loc) · 1.75 KB
/
Identity.alusus
File metadata and controls
60 lines (54 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright (C) 2026 Sarmad Abdullah
*
* This file is part of Alusus Identity library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
import "Srl/Console";
import "Srl/Time";
import "Srl/Possible";
import "Srl/Net";
import "Srl/errors";
import "Apm";
Apm.importFile("Alusus/Crypto");
Apm.importFile("Alusus/Json");
Apm.importFile("Alusus/Promises");
import "Identity/errors";
import "Identity/Providers/Provider";
import "Identity/Providers/GoogleProvider";
import "Identity/net_helpers";
import "Identity/json_helpers";
import "Identity/dtos";
import "Identity/be_api";
import "Identity/GoogleAuthenticateButton";
import "Identity/rest_api";
import "Identity/fe_api";
@merge module Identity {
use Srl;
use WebPlatform;
use Promises;
function setup(
providers: Array[SrdRef[Provider]],
pkeyFilename: CharsPtr,
loginCallback: closure(AuthenticationResponse): String
) {
Identity.providers = providers;
privateKey~no_deref = Crypto.EvpPkey.readPem(pkeyFilename);
onLogin = loginCallback;
}
function addProvider(provider: SrdRef[Provider]) {
providers.add(provider);
}
}