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

Split GetCredential into authentication and role switching #1255

Merged
merged 8 commits into from
Feb 28, 2022

Conversation

leuyentran
Copy link
Contributor

@leuyentran leuyentran commented Feb 18, 2022

Change Overview

Split AWS GetCredentials into smaller functions:

  1. authenticateAWSCredentials : authenticate AWS IAM identity either by credentials or via injected token
  2. awsRoleSwitching: after authentication, assume another role if available and allowed

The refactor provides two benefits:

  1. Readability
  2. Match with K10 installation doc
  3. Extendibility: more authentication methods can be added in the future if desired

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Test Plan

For good measure, tested validation of an AWS infra profile which calls GetCredentials

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@leuyentran leuyentran changed the title {WIP} Split GetCredential into authentication and role switching Split GetCredential into authentication and role switching Feb 22, 2022
Copy link
Contributor

@DeepikaDixit DeepikaDixit left a comment

Choose a reason for hiding this comment

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

Will let @pavannd1 have a look

pkg/aws/aws.go Outdated Show resolved Hide resolved
pkg/aws/aws.go Outdated Show resolved Hide resolved
Co-authored-by: Mark Severson <mark@kasten.io>
pkg/aws/aws.go Outdated Show resolved Hide resolved
pkg/aws/aws.go Outdated Show resolved Hide resolved
pkg/aws/aws.go Outdated Show resolved Hide resolved
leuyentran and others added 3 commits February 24, 2022 14:42
Co-authored-by: Pavan Navarathna <pavan@kasten.io>
Co-authored-by: Pavan Navarathna <pavan@kasten.io>
Copy link
Contributor

@pavannd1 pavannd1 left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit d43f27a into master Feb 28, 2022
@mergify mergify bot deleted the refactor-aws-get-credentials branch February 28, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants