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

Cross Account - sourceArn #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Cross Account - sourceArn #19

wants to merge 3 commits into from

Conversation

clark42
Copy link

@clark42 clark42 commented Nov 17, 2021

Beginner with golang, I try to fixes #16 by implementing SourceArn, FromArn and ReturnPathArn

About adding some initializations in the configure function in main.go (e58ac12) , I did so because when you provide only SourceArn without FromArn and ReturnPathArn, it seems that it don't work like the documentation says

Copy link
Owner

@blueimp blueimp left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @clark42, much appreciated!

@@ -29,6 +29,9 @@ var (
user = flag.String("u", "", "Authentication username")
allowFrom = flag.String("l", "", "Allowed sender emails regular expression")
denyTo = flag.String("d", "", "Denied recipient emails regular expression")
sourceArn = flag.String("f", "", "The SourceARN (when using with cross accounts) ")
fromArn = flag.String("o", "", "The FromARN (when using with cross accounts)")
rPathArn = flag.String("p", "", "The ReturnPathARN (when using with cross accounts)")
Copy link
Owner

Choose a reason for hiding this comment

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

For consistency, we should call this variable returnPathArn.

@@ -29,6 +29,9 @@ var (
user = flag.String("u", "", "Authentication username")
allowFrom = flag.String("l", "", "Allowed sender emails regular expression")
denyTo = flag.String("d", "", "Denied recipient emails regular expression")
sourceArn = flag.String("f", "", "The SourceARN (when using with cross accounts) ")
fromArn = flag.String("o", "", "The FromARN (when using with cross accounts)")
Copy link
Owner

Choose a reason for hiding this comment

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

Would switch the flags for sourceArn and fromArn, since f is better associated with from.

@@ -29,6 +29,9 @@ var (
user = flag.String("u", "", "Authentication username")
allowFrom = flag.String("l", "", "Allowed sender emails regular expression")
denyTo = flag.String("d", "", "Denied recipient emails regular expression")
sourceArn = flag.String("f", "", "The SourceARN (when using with cross accounts) ")
Copy link
Owner

Choose a reason for hiding this comment

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

Would change the description of all three flags to the following (for consistency with setName):

  • Amazon SES SourceARN
  • Amazon SES FromARN
  • Amazon SES ReturnPathARN

}
if *rPathArn == "" {
rPathArn = nil
}
Copy link
Owner

Choose a reason for hiding this comment

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

Could you elaborate on why you're setting the variables to nil here?

@@ -16,6 +16,9 @@ type Client struct {
setName *string
allowFromRegExp *regexp.Regexp
denyToRegExp *regexp.Regexp
sourceArn *string
fromArn *string
returnPathArn *string
Copy link
Owner

Choose a reason for hiding this comment

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

I think it might be better to create a struct called arns that consists of those three arns and add that as member to this struct. Makes handling the arguments for a lot of the function calls a bit simpler.

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.

Multiple AWS accounts
2 participants