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

feat(ssl): Add API interfaces for managing SSL certificates #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eust-w
Copy link

@eust-w eust-w commented Aug 8, 2024

  • Add CertListReq and CertListResp for retrieving SSL certificate lists
  • Add CertDetailResp and RealCertDetailResp for retrieving SSL certificate details
  • Implement GetCertList and GetCertDetail methods for fetching SSL certificate lists and details
  • Add UploadCertReq and UploadCertResp for uploading SSL certificates
  • Implement UploadCert method for uploading SSL certificates
  • Implement DeleteCert method for deleting SSL certificates

Refs #136

Copy link

qiniu-prow bot commented Aug 8, 2024

Hi @eust-w. Thanks for your PR.

I'm waiting for a qiniu member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@eust-w
Copy link
Author

eust-w commented Aug 8, 2024

PTAL @bachue

@eust-w
Copy link
Author

eust-w commented Aug 8, 2024

I didn't add tests with mocks because I didn't see any. If you have any good suggestions, please let me know.

- Add CertListReq and CertListResp for retrieving SSL certificate lists
- Add CertDetailResp and RealCertDetailResp for retrieving SSL certificate details
- Implement GetCertList and GetCertDetail methods for fetching SSL certificate lists and details
- Add UploadCertReq and UploadCertResp for uploading SSL certificates
- Implement UploadCert method for uploading SSL certificates
- Implement DeleteCert method for deleting SSL certificates

Refs qiniu#136
}
req.Header.Add("Authorization", "QBox "+accessToken)
req.Header.Add("Content-Type", "application/json")
resp, respErr := http.DefaultClient.Do(req)

Choose a reason for hiding this comment

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

每个接口都调用go标准包的接口,拿到结果后做unmarshal,建议封装一下,参考一下上面的postRequest

defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("unexpected status code: %d", resp.StatusCode)
return

Choose a reason for hiding this comment

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

另外,针对新增的接口需要补充单元测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants