Beispiel #1
0
    def test_file_contents(self):

        secrets_vaults = [{
            "type": "b64",
            "name": "my-file",
            "configs": {
                "vault-path": "yac/tests/vault/vectors/b64_vault.yaml"
            }
        }]

        vaults = SecretVaults(secrets_vaults)
        vaults.initialize({})

        self.assertTrue(vaults.get("my-file", "secret1") == "secret1 value")

        self.assertTrue(vaults.get("my-file", "secret2.prod") == "prod value")

        self.assertTrue(vaults.get("my-file", "secret3[1]") == "val2")
Beispiel #2
0
    def test_json_file_source(self):

        secrets_vaults = [
          {
              "type": "file",
              "name": "file-1",
              "configs": {
                "vault-path": "yac/tests/vault/vectors/file_vault.json"
              }

          }
        ]

        vaults = SecretVaults(secrets_vaults)
        vaults.initialize({})
        # get the results keepass vault and assert that it is available
        vault = vaults.get_vault('file-1')

        self.assertTrue(vault)