diff --git a/examples/config files - basic/user-sync-config.yml b/examples/config files - basic/user-sync-config.yml index b5b11635..4709f7a0 100644 --- a/examples/config files - basic/user-sync-config.yml +++ b/examples/config files - basic/user-sync-config.yml @@ -362,3 +362,8 @@ invocation_defaults: # For argument --users, the default is 'all'. # for CSV input, use an array - ['file', 'users.csv'] users: mapped + +# Storage location of UMAPI cache. This contains cached users, groups and user assignent info +# The cache will refresh after 24 hours +cache: + path: cache/umapi \ No newline at end of file diff --git a/user_sync/config/user_sync.py b/user_sync/config/user_sync.py index ae451508..10437128 100644 --- a/user_sync/config/user_sync.py +++ b/user_sync/config/user_sync.py @@ -46,6 +46,7 @@ class UMAPIConfigLoader(ConfigLoader): '/directory_users/connectors/*': (True, False, None), '/directory_users/extension': (True, False, None), '/logging/file_log_directory': (False, False, "logs"), + '/cache/path': (False, False, None), } # like ROOT_CONFIG_PATH_KEYS, but for non-root configuration files @@ -78,6 +79,7 @@ class UMAPIConfigLoader(ConfigLoader): 'users': ['all'] } + default_cache_path = "cache/umapi" def __init__(self, args): """ Load the config files and invocation options. diff --git a/user_sync/engine/umapi.py b/user_sync/engine/umapi.py index 2f3612a5..fbdab2a8 100644 --- a/user_sync/engine/umapi.py +++ b/user_sync/engine/umapi.py @@ -60,6 +60,7 @@ class RuleProcessor(object): 'test_mode': False, 'update_user_info': False, 'username_filter_regex': None, + 'cache': None, } def __init__(self, caller_options):