Skip to content

Commit

Permalink
Add test to ensure anonymous users cannot provide credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez authored and arash77 committed Jan 20, 2025
1 parent 904202d commit 286a865
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/integration/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ def test_provide_credential(self):
assert len(created_user_credentials[0]["groups"]["default"]["variables"]) == 1
assert len(created_user_credentials[0]["groups"]["default"]["secrets"]) == 3

def test_anon_users_cannot_provide_credentials(self):
payload = self._build_credentials_payload()
response = self._post("/api/users/current/credentials", data=payload, json=True, anon=True)
self._assert_status_code_is(response, 403)

def test_list_user_credentials(self):
source_id = f"test_tool_list_credentials_{uuid4()}"
payload = self._build_credentials_payload(source_id=source_id)
Expand Down

0 comments on commit 286a865

Please sign in to comment.