]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add external store key func for tls credential resources
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 1 Jul 2025 21:11:41 +0000 (17:11 -0400)
committerAdam King <adking@redhat.com>
Thu, 21 Aug 2025 18:13:55 +0000 (14:13 -0400)
For getting keys for an external store.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit d4819d61d540d5c818351e77d5cea62d9435106d)

src/pybind/mgr/smb/external.py

index ffda3185b8c8f4d4d7dba3d3aa93621733259c92..412efbb4c0ccbff84a039cc5235bc924413ae9f2 100644 (file)
@@ -49,6 +49,18 @@ def spec_backup_key(cluster_id: str) -> EntryKey:
     return (cluster_id, 'spec.smb')
 
 
+def tls_credential_key(
+    cluster_id: str, tls_credential_id: str, cred_type: str
+) -> EntryKey:
+    """Return key identifying a TLS credential in an external store."""
+    suffix = {
+        'cert': 'ssl.crt',
+        'key': 'ssl.key',
+        'ca-cert': 'ca.crt',
+    }[cred_type]
+    return (cluster_id, f'{tls_credential_id}.{suffix}')
+
+
 # Enumerate keys in a store