-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure_auth.py
54 lines (41 loc) · 1.28 KB
/
configure_auth.py
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
import asyncio
import os
import secrets
from gel import create_async_client
async def main():
client = create_async_client()
auth_signing_key = os.getenv(
"GEL_AUTH_SIGNING_KEY", secrets.token_urlsafe(32)
)
await client.execute(
f"""
configure current branch reset ext::auth::AuthConfig;
configure current branch reset ext::auth::ProviderConfig;
configure current branch reset ext::auth::EmailPasswordProviderConfig;
configure current branch reset cfg::EmailProviderConfig;
configure current branch set
ext::auth::AuthConfig::auth_signing_key := "{auth_signing_key}";
configure current branch set
ext::auth::AuthConfig::app_name := "Fast Jelly";
configure current branch set
ext::auth::AuthConfig::allowed_redirect_urls := {{"http://localhost:8000"}};
configure current branch insert
ext::auth::EmailPasswordProviderConfig {{
require_verification := true,
}};
configure current branch insert
cfg::SMTPProviderConfig {{
name := "mailpit",
host := "localhost",
port := 1025,
username := "smtpuser",
password := "smtppassword",
sender := "[email protected]",
validate_certs := false,
}};
configure current branch set
cfg::current_email_provider_name := "mailpit";
"""
)
if __name__ == "__main__":
asyncio.run(main())