88
99_CONFIG_ENV_KEY_ACCESS_KEY = "QINIU_ACCESS_KEY"
1010_CONFIG_ENV_KEY_SECRET_KEY = "QINIU_SECRET_KEY"
11- _CONFIG_ENV_KEY_API_KEY = "QINIU_API_KEY"
11+ _CONFIG_ENV_LIVE_API_KEY = "QINIU_LIVE_API_KEY"
12+ _CONFIG_ENV_LIVE_ENDPOINT = "QINIU_LIVE_ENDPOINT"
1213_CONFIG_ENV_KEY_ENDPOINT_URL = "QINIU_ENDPOINT_URL"
1314_CONFIG_ENV_KEY_REGION_NAME = "QINIU_REGION_NAME"
1415_CONFIG_ENV_KEY_BUCKETS = "QINIU_BUCKETS"
2324class Config :
2425 access_key : str
2526 secret_key : str
26- api_key : str
27+ live_api_key : str
28+ live_endpoint : str
2729 endpoint_url : str
2830 region_name : str
2931 buckets : List [str ]
@@ -33,7 +35,8 @@ def load_config() -> Config:
3335 config = Config (
3436 access_key = os .getenv (_CONFIG_ENV_KEY_ACCESS_KEY ),
3537 secret_key = os .getenv (_CONFIG_ENV_KEY_SECRET_KEY ),
36- api_key = os .getenv (_CONFIG_ENV_KEY_API_KEY ),
38+ live_api_key = os .getenv (_CONFIG_ENV_LIVE_API_KEY ),
39+ live_endpoint = os .getenv (_CONFIG_ENV_LIVE_ENDPOINT ),
3740 endpoint_url = os .getenv (_CONFIG_ENV_KEY_ENDPOINT_URL ),
3841 region_name = os .getenv (_CONFIG_ENV_KEY_REGION_NAME ),
3942 buckets = _get_configured_buckets_from_env (),
@@ -43,8 +46,10 @@ def load_config() -> Config:
4346 config .access_key = "YOUR_QINIU_ACCESS_KEY"
4447 if not config .secret_key or len (config .secret_key ) == 0 :
4548 config .secret_key = "YOUR_QINIU_SECRET_KEY"
46- if not config .api_key or len (config .api_key ) == 0 :
47- config .api_key = "YOUR_QINIU_API_KEY"
49+ if not config .live_api_key or len (config .live_api_key ) == 0 :
50+ config .live_api_key = "YOUR_QINIU_LIVE_API_KEY"
51+ if not config .live_endpoint or len (config .live_endpoint ) == 0 :
52+ config .live_endpoint = "mls.cn-east-1.qiniumiku.com"
4853 if not config .endpoint_url or len (config .endpoint_url ) == 0 :
4954 config .endpoint_url = "YOUR_QINIU_ENDPOINT_URL"
5055 if not config .region_name or len (config .region_name ) == 0 :
0 commit comments