Exemplo n.º 1
0
def test_bad_url(env_vars, authorizer):
    bad_server = SecretServer(
        f"https://{env_vars['tenant']}.secretservercloud.com/nonexistent",
        authorizer,
    )
    with pytest.raises(SecretServerError):
        bad_server.get_secret(env_vars["secret_id"])
Exemplo n.º 2
0
def test_bad_url(server_json):
    bad_server = SecretServer(
        f"https://{server_json['tenant']}.secretservercloud.com/nonexistent",
        server_json["username"],
        server_json["password"],
    )
    with pytest.raises(SecretServerError):
        bad_server.get_secret(1)
Exemplo n.º 3
0
def tss_backend(**kwargs):
    authorizer = PasswordGrantAuthorizer(kwargs['server_url'], kwargs['username'], kwargs['password'])
    secret_server = SecretServer(kwargs['server_url'], authorizer)
    secret_dict = secret_server.get_secret(kwargs['secret_id'])
    secret = ServerSecret(**secret_dict)

    return secret.fields[kwargs['secret_field']]
Exemplo n.º 4
0
from thycotic.secrets.server import SecretServer

secret_server = SecretServer("https://secretserverurl/SecretServer",
                             "username", "password", "domain")

secret = secret_server.get_secret(1)

print(secret)