-
Notifications
You must be signed in to change notification settings - Fork 293
*: bump jwt (#12343) #12345
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
base: release-6.5
Are you sure you want to change the base?
*: bump jwt (#12343) #12345
Conversation
Signed-off-by: ti-chi-bot <[email protected]>
This cherry pick PR is for a release branch and has not yet been approved by triage owners. To merge this cherry pick:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@wk989898 This PR has conflicts, I have hold it. |
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary of ChangesHello @ti-chi-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on updating several Go module dependencies across the project, including a significant bump to the JWT library. Additionally, it introduces a new OAuth2 server component, which appears to be a standalone utility or example, demonstrating OAuth2 functionality with JWT token generation. These changes aim to keep the project's dependencies current and potentially introduce new capabilities or address security concerns. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request updates JWT dependencies and introduces a test OAuth2 server. However, it has critical issues with unresolved merge conflicts in go.mod
and go.sum
that must be addressed before merging. Additionally, there are a couple of improvements suggested for the newly added test server code concerning command-line flag configuration and HTTP response handling.
<<<<<<< HEAD | ||
github.com/aws/aws-sdk-go v1.44.259 | ||
======= | ||
github.com/apache/pulsar-client-go v0.13.0 | ||
github.com/aws/aws-sdk-go v1.55.5 | ||
github.com/aws/aws-sdk-go-v2 v1.38.1 | ||
github.com/aws/aws-sdk-go-v2/config v1.27.37 | ||
github.com/aws/aws-sdk-go-v2/credentials v1.17.35 | ||
>>>>>>> 4b7fe4b517 (*: bump jwt (#12343)) |
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.
<<<<<<< HEAD | ||
github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= | ||
======= | ||
github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= | ||
github.com/apache/arrow/go/v12 v12.0.1/go.mod h1:weuTY7JvTG/HDPtMQxEUp7pU73vkLWMLpY67QwZ/WWw= | ||
github.com/apache/pulsar-client-go v0.13.0 h1:XB8jbcVgBZlRkswtTFj6Xy3Hv0mtpvT8xn/ovT1c0I0= | ||
github.com/apache/pulsar-client-go v0.13.0/go.mod h1:btNzPWaKtG9geL6naJNYwXnqJJ/codYM41awyZxZLQ4= | ||
>>>>>>> 4b7fe4b517 (*: bump jwt (#12343)) |
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.
"SJhX36_KapYSybBtJq35lxX_Brr4LRURSkm7QmXJGmy8pUFW9EIOcVQPsykz9-jj", "Secret to sign token") | ||
cmd.Flags().StringVar(&serverConfig.clientID, "client-id", "1234", "Client ID of oauth2") | ||
cmd.Flags().StringVar(&serverConfig.clientSecret, "client-secret", "e0KVlA2EiBfjoN13olyZd2kv1KL", "Client secret of oauth2") | ||
cmd.Flags().IntVar(&serverConfig.port, "log-file", 9096, "log file path") |
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.
The command-line flag is misconfigured. The flag name is log-file
and the description is log file path
, but it configures the server port (serverConfig.port
). This is misleading and should be corrected to reflect its actual purpose.
cmd.Flags().IntVar(&serverConfig.port, "log-file", 9096, "log file path") | |
cmd.Flags().IntVar(&serverConfig.port, "port", 9096, "Port for the oauth2 server") |
_, _ = w.Write([]byte(fmt.Sprintf(openIDConfiguration, serverConfig.port, serverConfig.port, serverConfig.port))) | ||
w.WriteHeader(200) |
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.
In Go's net/http
package, the response header should be written before the response body. Calling w.Write()
implicitly sends a 200 OK
status header, making the subsequent call to w.WriteHeader(200)
redundant and ineffective. It's also good practice to set the Content-Type
header for JSON responses. The suggested change corrects this and uses fmt.Fprintf
for cleaner code.
_, _ = w.Write([]byte(fmt.Sprintf(openIDConfiguration, serverConfig.port, serverConfig.port, serverConfig.port))) | |
w.WriteHeader(200) | |
w.Header().Set("Content-Type", "application/json") | |
fmt.Fprintf(w, openIDConfiguration, serverConfig.port, serverConfig.port, serverConfig.port) |
@ti-chi-bot: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #12343
What problem does this PR solve?
Issue Number: close #12340 ref #12249
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note