Store and pull tenant creds from Key Vault.
The tenant ID should be hashed and used as the key for the JSON blob of relevant creds for any given tenant. Azure CSP interface methods that need to source creds should call the internal `_source_creds` method, either with a `tenant_id` or no parameters. That method will source the creds. If a tenant ID is provided, it will source them from the Key Vault. If not provided, it will return the default creds for the app registration in the home tenant.
This commit is contained in:
16
tests/utils/test_hash.py
Normal file
16
tests/utils/test_hash.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
|
||||
from atst.utils import sha256_hex
|
||||
|
||||
|
||||
def test_sha256_hex():
|
||||
sample = "".join(
|
||||
random.choices(string.ascii_uppercase + string.digits, k=random.randrange(200))
|
||||
)
|
||||
hashed = sha256_hex(sample)
|
||||
assert re.match("^[a-zA-Z0-9]+$", hashed)
|
||||
assert len(hashed) == 64
|
||||
hashed_again = sha256_hex(sample)
|
||||
assert hashed == hashed_again
|
Reference in New Issue
Block a user