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

Move credentials endpoints to ecs-agent module #3698

Merged
merged 4 commits into from
May 17, 2023

Conversation

amogh09
Copy link
Contributor

@amogh09 amogh09 commented May 15, 2023

Summary

Move v1 and v2 TMDS credentials endpoint handlers from agent module to ecs-agent module.

Implementation details

  • Moved v1 and v2 credentials endpoint handlers from agent module to ecs-agent module.
    • agent/handlers/v1/credentials_handler.go to ecs-agent/tmds/handlers/v1/credentials_handler.go.
    • agent/handlers/v2/credentials_handler.go to ecs-agent/tmds/handlers/v2/credentials_handler.go.
  • Added new unit tests to ecs-agent module for both credentials endpoint handlers. Although agent module has TMDS tests covering these endpoints, we want to have unit tests in ecs-agent module that exclusively cover these handlers too.
  • Moved GetCredentialsEventType function from agent/logger/audit/entry_types.go to ecs-agent/logger/audit/audit_log.go. This function returns an appropriate audit log event type for the provided role type (task role or execution role) and is used by credentials endpoint handlers too. Also moved the corresponding audit log event type constants that this function returns.
  • Moved ZeroOrNil util function from agent/utils/utils.go to ecs-agent/utils/utils.go as it is used by credentials handlers.

Testing

In addition to new unit tests, also performed manual stress testing for the two changed endpoints. There is no obvious change in performance seen.

New tests cover the changes: yes

Description for the changelog

Move v1 and v2 TMDS credentials endpoints to ecs-agent module.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 changed the base branch from master to dev May 15, 2023 20:58
@amogh09 amogh09 changed the title Move credentials endpoints Move credentials endpoints to ecs-agent module May 16, 2023
@amogh09 amogh09 marked this pull request as ready for review May 16, 2023 18:18
@amogh09 amogh09 requested a review from a team as a code owner May 16, 2023 18:18
@amogh09 amogh09 merged commit 70992c9 into aws:dev May 17, 2023
RichaGangwar pushed a commit to RichaGangwar/amazon-ecs-agent that referenced this pull request May 18, 2023
…#3698)

wsclient: Add config in ClientFactory, remove unnecessary comments, add test descriptions
Realmonia pushed a commit to Realmonia/amazon-ecs-agent that referenced this pull request May 21, 2023
@ubhattacharjya ubhattacharjya mentioned this pull request May 24, 2023
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