feat: Avoid use the secret value in the DevOps scm verify API.
Created by: mangoGoForward
Signed-off-by: mango xu.weiKyrie@foxmail.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
Please see #2893 (closed)
Which issue(s) this PR fixes:
Fixes #2893 (closed)
Special notes for reviewers:
The request Payload screenshot like below:
Does this PR introduced a user-facing change?
None
Additional documentation, usage docs, etc.:
合并请求报告
动态
Created by: LinuxSuRen
Review: Changes requested
hi @mangoGoForward thanks for your time. I'm sorry that I didn't update the description in time. But the new API was
/v1alpha3/scms/github/verify
See the details from https://github.com/kubesphere/ks-devops/pull/439
The old API does not support it yet. See the following screenshot:
Created by: mangoGoForward
hi @mangoGoForward thanks for your time. I'm sorry that I didn't update the description in time. But the new API was
/v1alpha3/scms/github/verify
See the details from kubesphere/ks-devops#439
The old API does not support it yet. See the following screenshot:
I noticed that the API of
/v1alpha3/scms/github/verify
has two query parameters,please correct me, there are two things:
- update API version.
- add this two parameters instead of
accessToken
.
But I'm confused that the API why would throw the error of
accessToken is required
?Created by: mangoGoForward
Updated, please see 1ac41c45.
Created by: LinuxSuRen
Review: Changes requested
I got some problems when I test this PR manually.
Sorry about I didn't provide clear information about the API. See https://github.com/kubesphere/ks-devops/pull/439
The API takes
secret
andsecretNamespace
as the query parameters instead of payload.The second problem is that I didn't get any tips when there is an error code. It will make users feel confused.
Sorry again for the inconvenience. I'll try to fix it based on your PR.
Created by: mangoGoForward
The API takes
secret
andsecretNamespace
as the query parameters instead of payload.Sorry, I have not noticed that the API use query parameters instead of payload, but the API method is
POST
, may use query body better.The second problem is that I didn't get any tips when there is an error code. It will make users feel confused.
I will check.
Created by: LinuxSuRen
hi @mangoGoForward thanks for helping us to figure out the difference between the secret type. See the corresponding PR https://github.com/kubesphere/ks-devops/pull/487/files
Created by: LinuxSuRen
Give the upstream project go-scm does not support listing repositories from a user or organization for now. I guess this PR needs to be held.
/hold
Created by: LinuxSuRen
Review: Approved
I have tested it manually. It works well with the last commit. See the following screenshot:
/lgtm /approve