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

Add User-Agent headers to projects #146

Closed
afiune opened this issue Jun 10, 2020 · 0 comments · Fixed by #152
Closed

Add User-Agent headers to projects #146

afiune opened this issue Jun 10, 2020 · 0 comments · Fixed by #152
Assignees
Labels
api Something related to the Go API client cli Something related to the Lacework CLI feat New feature or request

Comments

@afiune
Copy link
Contributor

afiune commented Jun 10, 2020

As a Lacework Engineer,
I would like to track the usage of the Go API abstraction
As well as the usage coming from the Lacework CLI,
So that I can understand how users interact with our tool via the Lacework API.

Proposal Solution

We need to add a default User-Agent header to the Go-API and make it configurable
so that other components from this repository, as well as external components, can
customize this field (e.i. our terraform provider). This will allow us to track the usage
of different components and make sense of how users interact with our tools and APIs.

JIRA: ALLY-135

@afiune afiune added feat New feature or request api Something related to the Go API client cli Something related to the Lacework CLI labels Jun 10, 2020
@afiune afiune changed the title [api][cli] Add User-Agent headers to projects Add User-Agent headers to projects Jun 10, 2020
@afiune afiune self-assigned this Jun 15, 2020
afiune added a commit that referenced this issue Jun 17, 2020
This change also includes the ability to override the User-Agent header
as well as adding any other global header to the Go api client, to
create a new client with a global header use the Option `WithHeader()`
like the following example:
```go
c, err := api.NewClient("test",
	api.WithHeader("User-Agent", "test-agent"),
	api.WithHeader("Custom-ABC", "value-abc"),
	api.WithHeader("Custom-XYZ", "value-xyz"),
)
```

Issue: #146

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
afiune added a commit that referenced this issue Jun 18, 2020
This change also includes the ability to override the User-Agent header
as well as adding any other global header to the Go api client, to
create a new client with a global header use the Option `WithHeader()`
like the following example:
```go
c, err := api.NewClient("test",
	api.WithHeader("User-Agent", "test-agent"),
	api.WithHeader("Custom-ABC", "value-abc"),
	api.WithHeader("Custom-XYZ", "value-xyz"),
)
```

Issue: #146

Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something related to the Go API client cli Something related to the Lacework CLI feat New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant