bedrock.config.keys
1from bedrock.config import get_config_params 2 3 4def split_keys(string_keys): # pragma: unit 5 return [key.strip() for key in string_keys.split(",")] 6 7 8def get_keys(endpoint=None): # pragma: integration 9 config = get_config_params() 10 return _get_keys(endpoint, config.get("allowed_keys", {})) 11 12 13def _get_keys(endpoint, allowed_keys={}): # pragma: unit 14 try: 15 return [ 16 *split_keys(allowed_keys[endpoint]), 17 *split_keys(allowed_keys["global"]) 18 ] 19 except KeyError: 20 try: 21 return split_keys(allowed_keys["global"]) 22 except KeyError: 23 return []
def
split_keys(string_keys):
def
get_keys(endpoint=None):