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

feat: add allowed/forbidden account id fields, verify func #638

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Sep 1, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates hashicorp/terraform#33688

Adds AllowedAccountIds and ForbiddenAccountIds fields to the base Config struct, along with a method to verify whether a given account is permitted. This will centralize the logic currently implemented in AWS Provider to allow for re-use with other upstream interfaces.

@jar-b jar-b requested a review from a team as a code owner September 1, 2023 00:32
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% git checkout f-verify-allowed-accounts
branch 'f-verify-allowed-accounts' set up to track 'origin/f-verify-allowed-accounts'.
Switched to a new branch 'f-verify-allowed-accounts'
ewbankkit@ewbankkit-C02F408DML85 aws-sdk-go-base % go test -v ./internal/config 
=== RUN   TestConfig_VerifyAccountIDAllowed
=== RUN   TestConfig_VerifyAccountIDAllowed/empty
=== RUN   TestConfig_VerifyAccountIDAllowed/allowed
=== RUN   TestConfig_VerifyAccountIDAllowed/not_allowed
=== RUN   TestConfig_VerifyAccountIDAllowed/forbidden
=== RUN   TestConfig_VerifyAccountIDAllowed/not_forbidden
=== RUN   TestConfig_VerifyAccountIDAllowed/allowed_and_forbidden
--- PASS: TestConfig_VerifyAccountIDAllowed (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/empty (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/allowed (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/not_allowed (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/forbidden (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/not_forbidden (0.00s)
    --- PASS: TestConfig_VerifyAccountIDAllowed/allowed_and_forbidden (0.00s)
PASS
ok  	github.com/hashicorp/aws-sdk-go-base/v2/internal/config	0.432s

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.

2 participants