-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Noah Stride <[email protected]>
- Loading branch information
1 parent
90b4b92
commit f3af76a
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,55 @@ | ||
package main | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
"os" | ||
"time" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
version = "dev" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Hello, World!") | ||
rootCmd := &cobra.Command{ | ||
Use: "aws-spiffe-workload-helper", | ||
Short: "TODO", // TODO(strideynet): Helpful, short description. | ||
Long: `TODO`, // TODO(strideynet): Helpful, long description. | ||
Version: version, | ||
} | ||
|
||
var ( | ||
roleARN string | ||
region string | ||
profileARN string | ||
sessionDuration time.Duration | ||
trustAnchorARN string | ||
roleSessionName string | ||
) | ||
x509CredentialProcessCmd := &cobra.Command{ | ||
Use: "x509-credential-process", | ||
Short: "TODO", // TODO(strideynet): Helpful, short description. | ||
Long: `TODO`, // TODO(strideynet): Helpful, long description. | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("Hello, World!") | ||
}, | ||
} | ||
rootCmd.AddCommand(x509CredentialProcessCmd) | ||
// TODO(strideynet): Review flag help strings. | ||
x509CredentialProcessCmd.Flags().StringVar(&roleARN, "role-arn", "", "TODO. Required.") | ||
x509CredentialProcessCmd.MarkFlagRequired("role-arn") | ||
x509CredentialProcessCmd.Flags().StringVar(®ion, "region", "", "TODO") | ||
x509CredentialProcessCmd.Flags().StringVar(&profileARN, "profile-arn", "", "TODO. Required.") | ||
x509CredentialProcessCmd.MarkFlagRequired("profile-arn") | ||
x509CredentialProcessCmd.Flags().DurationVar(&sessionDuration, "session-duration", 0, "TODO") | ||
x509CredentialProcessCmd.Flags().StringVar(&trustAnchorARN, "trust-anchor-arn", "", "TODO. Required.") | ||
x509CredentialProcessCmd.MarkFlagRequired("trust-anchor-arn") | ||
x509CredentialProcessCmd.Flags().StringVar(&roleSessionName, "role-session-name", "", "TODO") | ||
|
||
if err := rootCmd.Execute(); err != nil { | ||
fmt.Println(err.Error()) | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
module github.com/spiffe/aws-spiffe-workload-helper | ||
|
||
go 1.22.5 | ||
|
||
require ( | ||
github.com/inconshreveable/mousetrap v1.1.0 // indirect | ||
github.com/spf13/cobra v1.8.1 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= | ||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= | ||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= | ||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= | ||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= | ||
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= | ||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= | ||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |