peterHoburg / aws-sdk-go-v2-sso-login

Package aws_sdk_go_v2_sso_login implements the AWS SSO OIDC flow, including optionally opening a browser with the AWS SSO auth URL.
https://pkg.go.dev/github.com/peterHoburg/aws-sdk-go-v2-sso-login
Apache License 2.0
3 stars 0 forks source link

Segfault when invoking `Login` with undefined `LoginTimeout` field #35

Closed andriygm closed 2 weeks ago

andriygm commented 3 weeks ago

LoginTimeout should have some default value + there should be some validation to ensure the AccessToken field never gets nil dereferenced.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100758574]

goroutine 1 [running]:
github.com/peterHoburg/aws-sdk-go-v2-sso-login.ssoLoginFlow({0x100a3eff8, 0x100f827c0}, 0x14000261040?, 0x1400020b600, 0x0, 0x0)
        /Users/<user>/go/pkg/mod/github.com/peter!hoburg/aws-sdk-go-v2-sso-login@v0.6.2/cred-workflow.go:380 +0x6b4
github.com/peterHoburg/aws-sdk-go-v2-sso-login.Login({0x100a3eff8, 0x100f827c0}, 0x14000055b88)
        /Users/<user>/go/pkg/mod/github.com/peter!hoburg/aws-sdk-go-v2-sso-login@v0.6.2/cred-workflow.go:135 +0x200
peterHoburg commented 2 weeks ago

Good catch! I will push a fix tonight. Thanks for opening an issue.

peterHoburg commented 2 weeks ago

v0.6.3 contains the fix