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

fix(*) validate the token in kuma-dp #1136

Merged
merged 4 commits into from
Nov 11, 2020
Merged

Conversation

nickolaev
Copy link
Contributor

Summary

Validate the DP token in kuma-dp

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
@nickolaev nickolaev requested a review from a team as a code owner November 9, 2020 13:26

rawToken, err := ioutil.ReadFile(path)
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need more context

errors.Wrap(err, "could not read the token in the file %s")


_, _, err = new(jwt.Parser).ParseUnverified(string(rawToken), &jwt.MapClaims{})
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors.Wrap(err, "token in the file %s is not valid JWT token. Double check blank characters in the file")

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Nikolay Nikolaev added 2 commits November 11, 2020 10:14
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
@nickolaev nickolaev merged commit 395bf78 into master Nov 11, 2020
@nickolaev nickolaev deleted the fix/dp_token_validate branch November 11, 2020 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants