Skip to content

Fix incorrect header name for api key in alerting client. #633

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

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Prevent a provider panic in `elasticstack_kibana_data_view` when a `field_format` does not include a `pattern`. ([#619](https://github.com/elastic/terraform-provider-elasticstack/pull/619/files))
- Fixed a bug where the `id` attribute for `elasticstack_kibana_slo` resources was ignored by renaming the attribute to `slo_id`. ([#622](https://github.com/elastic/terraform-provider-elasticstack/pull/622))
- Fixed a bug where the `rule_id` attribute for `elasticstack_kibana_alerting_rule` was ignored. ([#626](https://github.com/elastic/terraform-provider-elasticstack/pull/626))
- Fixed a bug with incorrect HTTP header name for API key for alerting client. ([#633](https://github.com/elastic/terraform-provider-elasticstack/pull/633))
- Fix provider crash when running against Serverless projects ([#630](https://github.com/elastic/terraform-provider-elasticstack/pull/630))

### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ help: ## this help
.PHONY: generate-alerting-client
generate-alerting-client: ## generate Kibana alerting client
@ docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.0.1 generate \
-i https://raw.githubusercontent.com/elastic/kibana/$(SWAGGER_VERSION)/x-pack/plugins/alerting/docs/openapi/bundled.json \
-i /local/generated/alerting/bundled.yaml \
--skip-validate-spec \
--git-repo-id terraform-provider-elasticstack \
--git-user-id elastic \
Expand Down
6 changes: 3 additions & 3 deletions generated/alerting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ r, err := client.Service.Operation(auth, args)
### apiKeyAuth

- **Type**: API key
- **API key parameter name**: ApiKey
- **API key parameter name**: Authorization
- **Location**: HTTP header

Note, each API key must be added to a map of `map[string]APIKey` where the key is: ApiKey and passed in as the auth context for each request.
Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request.

Example

Expand All @@ -190,7 +190,7 @@ auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"ApiKey": {Key: "API_KEY_STRING"},
"Authorization": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
Expand Down
3 changes: 2 additions & 1 deletion generated/alerting/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3618,6 +3618,7 @@ components:
scheme: basic
type: http
apiKeyAuth:
description: "e.g. Authorization: ApiKey base64AccessApiKey"
in: header
name: ApiKey
name: Authorization
type: apiKey
52 changes: 26 additions & 26 deletions generated/alerting/api_alerting.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading