-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
updated storyblok detector #3981
base: main
Are you sure you want to change the base?
updated storyblok detector #3981
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kashifkhan0771. Overall, looks great. Just few minor comments.
pkg/detectors/storyblok/storyblok.go
Outdated
} | ||
// docs: https://www.storyblok.com/docs/api/content-delivery/v2/getting-started/authentication | ||
func verifyStoryBlokAccessToken(ctx context.Context, client *http.Client, token string) (bool, error) { | ||
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.storyblok.com/v1/cdn/spaces/me/?token="+token, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: http.GET
func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results []detectors.Result, err error) { | ||
dataStr := string(data) | ||
|
||
matches := keyPat.FindAllStringSubmatch(dataStr, -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put uniqueness logic here to avoid duplicates ?
|
||
// docs: http://storyblok.com/docs/api/management/core-resources/spaces/retrieve-multiple-spaces | ||
func verifyStoryBlokPersonalAccessToken(ctx context.Context, client *http.Client, token string) (bool, error) { | ||
req, err := http.NewRequestWithContext(ctx, "GET", "https://mapi.storyblok.com/v1/spaces/", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: http.GET
Description:
This PR fixes #3909 and oss-136
Tests:
Checklist:
make test-community
)?make lint
this requires golangci-lint)?