-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
54 lines (41 loc) · 1.44 KB
/
config.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 os
from dotenv import load_dotenv
load_dotenv("test.env")
def trygetenv(name: str) -> str:
try:
return os.environ[name]
except KeyError:
message = f"Missing expected environment variable: {name}"
raise ValueError(message)
class RabbitMQConfig:
"""
Simple configuration class loading RMQ settings from the environment.
Enter your credentials
"""
host = trygetenv("RMQ_HOSTNAME")
port = trygetenv("RMQ_PORT")
vhost = trygetenv("RMQ_VHOST")
exchange = trygetenv("RMQ_EXCHANGE")
queue = trygetenv("RMQ_QUEUE")
ca_file = trygetenv("RMQ_CA_FILE")
cert_file = trygetenv("RMQ_CERT_FILE")
key_file = trygetenv("RMQ_KEY_FILE")
# uncomment following line if you encounter troubles with certification authority validation
# CA_FILE = "../cacert.pem"
class GeoDataLakeConfig:
"""
Simple configuration class loading GeoData Lake settings from the environment.
Enter your credentials
"""
PROJECT = trygetenv("PROJECT")
CKAN_URL = trygetenv("CKAN_URL")
class OAuth2Config:
"""
Simple configuration class loading OAuth2 settings from the environment.
Enter your credentials
"""
OAUTH_URL = trygetenv("OAUTH_URL")
OAUTH_API_KEY = trygetenv("OAUTH_API_KEY")
OAUTH_APP_ID = trygetenv("OAUTH_APP_ID")
OAUTH_USER = trygetenv("OAUTH_USER")
OAUTH_PWD = trygetenv("OAUTH_PWD")