forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add single quotes around the credentials_json var (elastic#2712)
This handlebar variable contains a string and is required to be passed as a string to the Beat. It must be properly quoted because it contains JSON which in YAML will be interpretted as an object. In general all handlebar variables that are strings should be single-quoted. To test Fleet's handling of JSON string I used a variety of formats including some that contain newlines, end in news, without newlines, and an invalid credential format (but valid json). One issue is that single quotes are not properly escaped Fleet when evaluating the handlebar template leading to invalid YAML, but this use case should not involve any single-quotes.
- Loading branch information
1 parent
1cb50ec
commit e587a86
Showing
10 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,19 @@ service: gcppubsub-emulator | |
input: gcp-pubsub | ||
vars: | ||
alternative_host: "{{Hostname}}:{{Port}}" | ||
credentials_json: '{\"fake\":\"creds\"}' | ||
credentials_json: |- | ||
{ | ||
"type": "service_account", | ||
"project_id": "foo", | ||
"private_key_id": "x", | ||
"private_key": "", | ||
"client_email": "[email protected]", | ||
"client_id": "0", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://foo.bar/path" | ||
} | ||
project_id: audit | ||
data_stream: | ||
vars: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,19 @@ service: gcppubsub-emulator | |
input: gcp-pubsub | ||
vars: | ||
alternative_host: "{{Hostname}}:{{Port}}" | ||
credentials_json: '{\"fake\":\"creds\"}' | ||
credentials_json: | | ||
{ | ||
"type": "service_account", | ||
"project_id": "foo", | ||
"private_key_id": "x", | ||
"private_key": "", | ||
"client_email": "[email protected]", | ||
"client_id": "0", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://foo.bar/path" | ||
} | ||
project_id: audit | ||
data_stream: | ||
vars: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ service: gcppubsub-emulator | |
input: gcp-pubsub | ||
vars: | ||
alternative_host: "{{Hostname}}:{{Port}}" | ||
credentials_json: '{\"fake\":\"creds\"}' | ||
credentials_json: >- | ||
{"type":"service_account","project_id":"foo","private_key_id":"x","private_key":"","client_email":"[email protected]","client_id":"0","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://foo.bar/path"} | ||
project_id: vpcflow | ||
data_stream: | ||
vars: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters