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

[BUG] Incorrect claim causes panic #91

Open
george-zubrienko opened this issue Jun 18, 2024 · 0 comments
Open

[BUG] Incorrect claim causes panic #91

george-zubrienko opened this issue Jun 18, 2024 · 0 comments
Assignees
Labels
code/bug Something isn't working

Comments

@george-zubrienko
Copy link

Description

Trying to add a claim and failing to type correctly causes a huge panic print :)

Steps to reproduce the issue

Use "boxer-claim.awsp.sneaksanddata.com/.*" instead of "boxer-claim.awsp.sneaksanddata.com/.*:.*"

snd claim add -u [email protected] --claims-provider azuread -c "boxer-claim.awsp.sneaksanddata.com/.*" -e production

Get paniced:

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/SneaksAndData/esd-services-api-client-go/claim.preparePayload({0xc000452130, 0x1, 0xc00051fab0?}, {0x9d82ca, 0x6})
        /home/runner/go/pkg/mod/github.com/!sneaks!and!data/[email protected]/claim/main.go:59 +0x125
github.com/SneaksAndData/esd-services-api-client-go/claim.Service.AddClaim({0xc0004521a0?, {0xc0004560f0?, 0x99e080?}}, {0x7ffc4854f5c6, 0xc}, {0x7ffc4854f5e5, 0x7}, {0xc000452130, 0x1, 0x1})
        /home/runner/go/pkg/mod/github.com/!sneaks!and!data/[email protected]/claim/main.go:37 +0x13c
snd-cli/pkg/cmd/claim.addClaimRun({0xacadf0?, 0xc000124708?}, {0x7ffc4854f5c6, 0xc}, {0x7ffc4854f5e5, 0x7}, {0xc000452130?, 0xac5fe0?, 0xc000492d20?})
        /home/runner/work/snd-cli-go/snd-cli-go/pkg/cmd/claim/add.go:44 +0x6d
snd-cli/pkg/cmd/claim.NewCmdAddClaim.func1(0xc0001d3e00?, {0x9d25c1?, 0x4?, 0x9d25c5?})
        /home/runner/work/snd-cli-go/snd-cli-go/pkg/cmd/claim/add.go:31 +0x106
github.com/spf13/cobra.(*Command).execute(0xc00049c300, {0xc000034180, 0x8, 0x8})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc000470c00)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
main.main()
        /home/runner/work/snd-cli-go/snd-cli-go/cmd/snd-cli/main.go:30 +0xb7

Describe the results you expected

Something like this:

> snd claim add -u [email protected] --claims-provider azuread -c "boxer-claim.awsp.sneaksanddata.com/.*" -e production
Invalid command: Missing allowed methods for the path: GET, POST etc. Please review your claim string

SnD CLI version you are using

1.2.2

@george-zubrienko george-zubrienko added the code/bug Something isn't working label Jun 18, 2024
@adelinag08 adelinag08 self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants