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

3078 revoke agent tokens #3201

merged 20 commits into from
Apr 7, 2023

Conversation

cakekoa
Copy link
Contributor

@cakekoa cakekoa commented Apr 5, 2023

What does this PR do?

Fixes part of #3078 by removing users for agents that have shut down or timed out.

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • Any other testing performed?

    Manually tested agent user removed after agent shutdown and when agent times out
    Ran the logout BB test to test that the agent user is removed after agent logs out

  • If applicable, add screenshots or log transcripts of the feature working

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.04 🎉

Comparison is base (768a656) 73.02% compared to head (e63d78f) 73.07%.

❗ Current head e63d78f differs from pull request most recent head 1017721. Consider uploading reports for the commit 1017721 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3201      +/-   ##
===========================================
+ Coverage    73.02%   73.07%   +0.04%     
===========================================
  Files          469      470       +1     
  Lines        13566    13599      +33     
===========================================
+ Hits          9907     9937      +30     
- Misses        3659     3662       +3     

see 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ilija-lazoroski ilija-lazoroski force-pushed the 3078-revoke-agent-tokens branch from 2f2fdce to 0687547 Compare April 6, 2023 08:41
@cakekoa cakekoa force-pushed the 3078-revoke-agent-tokens branch from 0687547 to ff31553 Compare April 6, 2023 11:53
@cakekoa cakekoa marked this pull request as ready for review April 6, 2023 12:06
@cakekoa cakekoa force-pushed the 3078-revoke-agent-tokens branch from 8299a91 to e63d78f Compare April 6, 2023 14:08
@mssalvatore
Copy link
Collaborator

Fix commit with TEMP prefix

@cakekoa cakekoa force-pushed the 3078-revoke-agent-tokens branch from f4f53d9 to 5405dab Compare April 6, 2023 16:14
@cakekoa cakekoa requested a review from mssalvatore April 6, 2023 16:14
island_event_queue.subscribe(IslandEventTopic.AGENT_TIMED_OUT, agent_remover.remove_on_timeout)


class AgentRemover:
Copy link
Collaborator

Choose a reason for hiding this comment

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

AgentUserRemover. This name makes it seem like we're removing agents from the AgentRepository.

@cakekoa cakekoa force-pushed the 3078-revoke-agent-tokens branch from 5405dab to dadb05b Compare April 7, 2023 12:56
@cakekoa cakekoa force-pushed the 3078-revoke-agent-tokens branch from dadb05b to c24dbff Compare April 7, 2023 16:22
Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

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

Approved with one minor comment.

}

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.

@mssalvatore mssalvatore merged commit 3b0cff0 into develop Apr 7, 2023
@mssalvatore mssalvatore deleted the 3078-revoke-agent-tokens branch April 7, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants