return filtered
+class MirrorTLSCredentials(Mirror):
+ """Mirroring configuration for objects in the tls_credentials namespace."""
+
+ def __init__(self, store: ConfigStore) -> None:
+ super().__init__('tls_credentials', store)
+
+ def filter_object(self, obj: Simplified) -> Simplified:
+ """Filter tls_credential for sqlite3 store."""
+ filtered = copy.deepcopy(obj)
+ if filtered.get('credential_type') and filtered.get('value'):
+ filtered.pop('value', None)
+ return filtered
+
+
def _tables(
*,
specialize: bool = True,
srt,
SimpleTable('join_auths', 'join_auths'),
SimpleTable('users_and_groups', 'users_and_groups'),
+ SimpleTable('tls_creds', 'tls_creds'),
]
return (opts or {}).get('mirror_users_and_groups') != 'no'
+def _mirror_tls_credentials(opts: Optional[Dict[str, str]] = None) -> bool:
+ return (opts or {}).get('mirror_tls_credentials') != 'no'
+
+
def mgr_sqlite3_db(
mgr: Any, opts: Optional[Dict[str, str]] = None
) -> SqliteStore:
mirrors.append(MirrorJoinAuths(mirror_store))
if _mirror_users_and_groups(opts):
mirrors.append(MirrorUsersAndGroups(mirror_store))
+ if _mirror_tls_credentials(opts):
+ mirrors.append(MirrorTLSCredentials(mirror_store))
return SqliteMirroringStore(mgr, tables, mirrors)