Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3078 revoke agent tokens #3201

Merged
merged 20 commits into from
Apr 7, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ab4e778
Island: Add Island event for agent timeout
cakekoa Apr 5, 2023
950f300
Island: Send timeout event on agent timeout
cakekoa Apr 5, 2023
691f4e8
Island: Add AuthenticationFacade.remove_user
cakekoa Apr 5, 2023
a445668
Island: Register handlers to remove expired agents
cakekoa Apr 5, 2023
6f52509
Island: Remove unneeded comment in AuthenticationFacade
ilija-lazoroski Apr 6, 2023
2982657
Island: Change agent id type from str to AgentID
ilija-lazoroski Apr 6, 2023
88a4120
UT: Rename remove_user test in authentication_service tests
ilija-lazoroski Apr 6, 2023
0be94b9
UT: Use assert_any_call in AgentHeartbeatMonitor tests
ilija-lazoroski Apr 6, 2023
651e9e3
UT: Fix revoke tokens tests in authentication_service
ilija-lazoroski Apr 6, 2023
b9168f8
Island: Move register_event_handlers to its own module
cakekoa Apr 6, 2023
07ca604
Island: Prevent race condition in remove_user()
cakekoa Apr 6, 2023
b622c3e
Island: Consolidate "unregister agent" handlers
cakekoa Apr 6, 2023
1593c41
Island: Remove agent user on logout
cakekoa Apr 6, 2023
104ae2c
Island: Rename AgentRemover -> AgentUserRemover
cakekoa Apr 7, 2023
f8a1aef
BB: Test agent logout
cakekoa Apr 7, 2023
f7d7b45
Island: Fix agent user removal on logout
cakekoa Apr 7, 2023
c24dbff
UT: Fix logout tests
cakekoa Apr 7, 2023
1017721
BB: Test agent unable to access endpoint after logout
cakekoa Apr 7, 2023
1cb2f4e
BB: Remove extra print statement
mssalvatore Apr 7, 2023
062efc2
BB: Disambiguate island from agent logout tests
mssalvatore Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BB: Test agent unable to access endpoint after logout
cakekoa committed Apr 7, 2023
commit 1017721adcb8a7cea98689ca6a601fbf196d91f1
3 changes: 3 additions & 0 deletions envs/monkey_zoo/blackbox/test_blackbox.py
Original file line number Diff line number Diff line change
@@ -307,6 +307,9 @@ def test_agent__logout(island):
agent_requests.post(GET_AGENTS_ENDPOINT, data=agent_registration_dict)
assert agent_requests.post(LOGOUT_ENDPOINT, data=None).status_code == HTTPStatus.OK
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should attempt to access another endpoint and prove the agent is truly logged out.


# After logout, agent should not be able to access any endpoints
assert agent_requests.get(GET_AGENT_OTP_ENDPOINT).status_code == HTTPStatus.UNAUTHORIZED


# NOTE: These test methods are ordered to give time for the slower zoo machines
# to boot up and finish starting services.