Skip to content

Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.

fix: require the AWS secret when offering Bedrock setup (#246)

Rudy Mizrahi Celeklic1741d78496a
diff --git a/ifixai/cli/init.py b/ifixai/cli/init.py
index 64d66f0..4b537cb 100644
--- a/ifixai/cli/init.py
+++ b/ifixai/cli/init.py
@@ -28,10 +28,11 @@ PROVIDER_ENV_KEYS: dict[str, str] = {
"cloudflare": "CLOUDFLARE_API_TOKEN",
}
-# Settings a provider cannot make a call without that are not its secret.
+# Additional settings or credentials required to make a provider call.
# Listed beside the key by `ifixai init` and the setup wizard.
PROVIDER_COMPANION_ENV_KEYS: dict[str, tuple[str, ...]] = {
"cloudflare": ("CLOUDFLARE_ACCOUNT_ID",),
+ "bedrock": ("AWS_SECRET_ACCESS_KEY",),
}
diff --git a/ifixai/tests/test_init_bedrock_credentials.py b/ifixai/tests/test_init_bedrock_credentials.py
new file mode 100644
index 0000000..5db0fd3
--- /dev/null
+++ b/ifixai/tests/test_init_bedrock_credentials.py
@@ -0,0 +1,13 @@
+import pytest
+
+from ifixai.cli.init import detect_available_providers
+
+
[email protected]('secret,present', [(None, False), ('', False), ('owned-secret', True)])
+def test_init_requires_both_aws_credential_variables(monkeypatch, secret, present):
+ monkeypatch.setenv('AWS_ACCESS_KEY_ID', 'owned-id')
+ if secret is None:
+ monkeypatch.delenv('AWS_SECRET_ACCESS_KEY', raising=False)
+ else:
+ monkeypatch.setenv('AWS_SECRET_ACCESS_KEY', secret)
+ assert (('bedrock', 'AWS_ACCESS_KEY_ID') in detect_available_providers()) is present