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

Feature: added request signing support for Huawei cloud service API #244

Merged
merged 2 commits into from
Nov 27, 2020

Conversation

haihongren
Copy link
Contributor

Feature: Huawei Cloud Service API Signer support

  • Huawei Cloud Service API requires:

    1. The request to be timestamped and signed using their API secret
    2. The signed signatures to be included in the request header
  • This feature added hw_signer section to support this requirement.

    hw_signer:
      key: <YOUR Huawei API KEY>
      secret: <YOUR Huawei API secret>
  • Sample Huawei integration yml

The following example shows how to collect req_hit_rate metric.

name: huaweiCloud
global:
  base_url: https://cdn.myhuaweicloud.com/v1.0/cdn/statistics/domain-summary?&domain_name=<YOUR DOMAIN>&stat_type=
  headers:
    accept: application/json
variable_store:
  startDatetime: ${timestamp:ms-1h}
  endDatetime: ${timestamp:ms}
  params: >
    &start_time=${var:startDatetime}&end_time=${var:endDatetime}&service_area=outside_mainland_china
  key: <YOUR HUAWEI API KEY>
  secret: <YOUR HUAWEI SECRET>

apis:
  - name: huaweiCloud
    event_type: huaweiCloudSample
    url: req_hit_rate${var:params}
    hw_signer:
      key: ${var:key}
      secret: ${var:secret}

@haihongren haihongren requested a review from Kav91 November 13, 2020 01:35
@carlosroman
Copy link
Contributor

Any chance we could get some tests for this?

@haihongren
Copy link
Contributor Author

@carlosroman added test code for the signer. Thanks!

Copy link
Contributor

@brushknight brushknight left a comment

Choose a reason for hiding this comment

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

LGTM

@brushknight brushknight merged commit b84f6d3 into master Nov 27, 2020
@brushknight brushknight deleted the hren/huaweiURLSigner branch November 27, 2020 13:43
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.

3 participants