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

[AV-79411] Add a Custom User-Agent HTTP header for Terraform Provider Client #200

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

l0n3star
Copy link
Contributor

@l0n3star l0n3star commented May 31, 2024

Jira

Description

Use custom user agent in HTTP header so we can identify requests from terraform.

Type of Change

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Manual Testing Approach

How was this change tested and do you have evidence? (REQUIRED: Select at least 1)

  • Manually tested
  • Unit tested
  • Acceptance tested
  • Unable to test / will not test (Please provide comments in section below)

Testing

Tested by retrieving org details from terraform. This uses ExecuteWithRetry.

Validated with tcpdump we get custom user agent:

Transmission Control Protocol, Src Port: 60791, Dst Port: 8084, Seq: 1, Ack: 1, Len: 328
Hypertext Transfer Protocol
    GET /v4/organizations/ffffffff-aaaa-1414-eeee-000000000000 HTTP/1.1\r\n
    Host: localhost:8084\r\n
    User-Agent: terraform-provider-couchbase-capella/1.2.0\r\n
    Authorization: Bearer <token>\r\n
    Accept-Encoding: gzip\r\n

Required Checklist:

  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if required)
  • I have run make fmt and formatted my code

Further comments

@l0n3star l0n3star added the enhancement New feature or request label May 31, 2024
@l0n3star l0n3star requested review from a team as code owners May 31, 2024 17:26
@l0n3star l0n3star changed the title AV-79411 add user agent to http header AV-79411 use custom user agent in HTTP header May 31, 2024
@l0n3star l0n3star changed the title AV-79411 use custom user agent in HTTP header AV-79411 custom user agent in HTTP header Jun 3, 2024
Copy link
Contributor

@ajsqr ajsqr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@a-atri a-atri left a comment

Choose a reason for hiding this comment

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

looks good to me

@l0n3star l0n3star merged commit 3076697 into main Jun 6, 2024
4 checks passed
@aniket-Kumar-c aniket-Kumar-c changed the title AV-79411 custom user agent in HTTP header [AV-79411] Custom user agent in HTTP header Sep 11, 2024
@aniket-Kumar-c aniket-Kumar-c changed the title [AV-79411] Custom user agent in HTTP header [AV-79411] Add a Custom User-Agent HTTP header for Terraform Provider Client Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants