]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: token_factory claims can have case_sensitive flag
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Mon, 13 Nov 2023 23:51:10 +0000 (12:51 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Nov 2023 22:37:32 +0000 (22:37 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/token_factory.py

index 4f3147cfe28d212fe5cee1ab31addcead237bbd2..b2d17b4356c92cf33fe058e97237a70a3f6e9d4c 100644 (file)
@@ -30,7 +30,7 @@ CLAIM_VAL_TYPES = {
 }
 
 
-def list_to_claim(k, v):
+def list_to_claim(k, v, case_sensitive=False):
     if isinstance(v, security.CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1):
         # make the name match
         v.name = k
@@ -56,6 +56,8 @@ def list_to_claim(k, v):
     c.value_type = CLAIM_VAL_TYPES[t]
     c.values = v
     c.value_count = len(v)
+    if case_sensitive:
+        c.flags |= security.CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE
 
     return c