Giter Club home page Giter Club logo

awsweb's People

Contributors

aidansteele avatar tekumara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

awsweb's Issues

Segfault with go-get installed awsweb

I installed awsweb via go get github.com/glassechidna/awsweb instead of using the binary releases and I got this in return:

$ awsweb browser mycompany-prod
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x14b930f]

goroutine 1 [running]:
github.com/glassechidna/awsweb/cmd.doBrowser(0x1884040, 0xc4201a4b70, 0x0, 0x0, 0x7fff5fbff31f, 0xe)
	/Users/romanvg/go/src/github.com/glassechidna/awsweb/cmd/browser.go:69 +0x6f
github.com/glassechidna/awsweb/cmd.init.0.func1(0xc420190c80, 0xc420045420, 0x1, 0x1)
	/Users/romanvg/go/src/github.com/glassechidna/awsweb/cmd/browser.go:43 +0x9e
github.com/spf13/cobra.(*Command).execute(0xc420190c80, 0xc4200453e0, 0x1, 0x1, 0xc420190c80, 0xc4200453e0)
	/Users/romanvg/go/src/github.com/spf13/cobra/command.go:757 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0x18ba280, 0x18ba4e0, 0xc420157f48, 0xc420157f50)
	/Users/romanvg/go/src/github.com/spf13/cobra/command.go:843 +0x334
github.com/spf13/cobra.(*Command).Execute(0x18ba280, 0x0, 0xc420157f48)
	/Users/romanvg/go/src/github.com/spf13/cobra/command.go:791 +0x2b
github.com/glassechidna/awsweb/cmd.Execute()
	/Users/romanvg/go/src/github.com/glassechidna/awsweb/cmd/root.go:40 +0x31
main.main()
	/Users/romanvg/go/src/github.com/glassechidna/awsweb/main.go:20 +0x20

I'm running go 1.9.4, brew-installed today.

Provide way to unset env vars

If you try to run awsweb env a second time in the same shell, all the AWS_* env vars are currently set and the AWS SDK tries to use them. This means you can't retrieve new creds if the current ones are expired.

panic at awscredcache.mfaAuthenticatedCredentials.func1.1

$ awsweb myaccount

Assume Role MFA token code: 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x849f6f]

goroutine 1 [running]:
github.com/glassechidna/awscredcache.mfaAuthenticatedCredentials.func1.1(0xc0001fc000)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:265 +0x4f
github.com/aws/aws-sdk-go/aws/request.(*HandlerList).Run(0xc0001fc2f0, 0xc0001fc000)
        /home/runner/go/pkg/mod/github.com/aws/[email protected]/aws/request/handlers.go:261 +0x98
github.com/aws/aws-sdk-go/aws/request.(*Request).Send.func1(0xc0001fc000)
        /home/runner/go/pkg/mod/github.com/aws/[email protected]/aws/request/request.go:491 +0x39
github.com/aws/aws-sdk-go/aws/request.(*Request).Send(0xc0001fc000, 0xbfdc40, 0xc0001c56b0)
        /home/runner/go/pkg/mod/github.com/aws/[email protected]/aws/request/request.go:504 +0x2b3
github.com/aws/aws-sdk-go/service/sts.(*STS).GetSessionTokenWithContext(0xc0000aa198, 0xc087e0, 0xc0000a6010, 0xc00009d560, 0xc0000aa1a0, 0x1, 0x1, 0x14, 0xc109c0, 0xc0000aa198)
        /home/runner/go/pkg/mod/github.com/aws/[email protected]/service/sts/api.go:1160 +0xae
github.com/glassechidna/awscredcache.mfaAuthenticatedCredentials(0xc0000a95c1, 0x14, 0xc0000a2631, 0x28, 0x0, 0x0, 0xa5636c, 0x14, 0xc000102441, 0x35, ...)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:263 +0x473
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).getProfileConfig(0xc0001c52f0, 0xc0000a70f1, 0x7, 0xc0000a70f1, 0x7, 0x0)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:170 +0x686
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).getProfileConfig(0xc0001c52f0, 0x7fffff5ee53f, 0x7, 0xfaa7e0, 0x7fdada66e7d0, 0x0)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:117 +0x80b
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).Retrieve(0xc0001c52f0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x847459, ...)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:47 +0x58
github.com/glassechidna/awsweb/cmd.doEnv(0xc06720, 0xc0001c52f0, 0x7fffff5ee53f, 0x7, 0xc000024046, 0xc, 0xc00009d300)
        /home/runner/work/awsweb/awsweb/cmd/env.go:57 +0x49
github.com/glassechidna/awsweb/cmd.init.1.func1(0xc0001e3180, 0xc000085ac0, 0x1, 0x1)
        /home/runner/work/awsweb/awsweb/cmd/env.go:45 +0x10e
github.com/spf13/cobra.(*Command).execute(0xc0001e3180, 0xc000085a70, 0x1, 0x1, 0xc0001e3180, 0xc000085a70)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xfa0840, 0x441f0a, 0xf63100, 0xc000040778)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/glassechidna/awsweb/cmd.Execute()
        /home/runner/work/awsweb/awsweb/cmd/root.go:40 +0x31
main.main()
        /home/runner/work/awsweb/awsweb/main.go:20 +0x20

Implement "validate" subcommand

  • Iterate over profiles in ~/.aws/config and show ticks for good-to-go ones, ones that will need MFA code entered on usage and ones that aren't suitable - this last one could be linked to #7.

panic on getProfileConfig

$ awsweb env myaccount
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1 pc=0x834ea7]

goroutine 1 [running]:
github.com/go-ini/ini.(*File).GetSection(0x0, 0xc0000b7101, 0x7, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/go-ini/[email protected]/file.go:113 +0x67
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).getProfileConfig(0xc0001cd200, 0xc0000b7101, 0x7, 0xc0000b7101, 0x7, 0x0)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:143 +0x19c
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).getProfileConfig(0xc0001cd200, 0x7fff69bf0623, 0x3, 0xfaa7e0, 0x7f1248e6e7d0, 0x0)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:117 +0x80b
github.com/glassechidna/awscredcache.(*AwsCacheCredProvider).Retrieve(0xc0001cd200, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x847459, ...)
        /home/runner/go/pkg/mod/github.com/glassechidna/[email protected]/creds.go:47 +0x58
github.com/glassechidna/awsweb/cmd.doEnv(0xc06720, 0xc0001cd200, 0x7fff69bf0623, 0x3, 0x0, 0x0, 0xc0000ad300)
        /home/runner/work/awsweb/awsweb/cmd/env.go:57 +0x49
github.com/glassechidna/awsweb/cmd.init.1.func1(0xc0001cb400, 0xc000097ac0, 0x1, 0x1)
        /home/runner/work/awsweb/awsweb/cmd/env.go:45 +0x10e
github.com/spf13/cobra.(*Command).execute(0xc0001cb400, 0xc000097a70, 0x1, 0x1, 0xc0001cb400, 0xc000097a70)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xfa0840, 0x441f0a, 0xf63100, 0xc000048778)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2ea
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
github.com/glassechidna/awsweb/cmd.Execute()
        /home/runner/work/awsweb/awsweb/cmd/root.go:40 +0x31
main.main()
        /home/runner/work/awsweb/awsweb/main.go:20 +0x20

More useful role session name

Could include account name and role name. The latter is available from a call to STS GetCallerIdentity, but it'd be nice to be able to see account name and role name at a glance in the web console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.