-
Notifications
You must be signed in to change notification settings - Fork 20
Feature/add nomad token support #5
base: master
Are you sure you want to change the base?
Feature/add nomad token support #5
Conversation
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Serhii Shuiar seems not to be a GitHub user. Have you signed the CLA already but the status is still pending? Recheck it. |
@@ -136,6 +136,9 @@ def request(verb, path, data = {}, headers = {}) | |||
# Get a list of headers | |||
headers = DEFAULT_HEADERS.merge(headers) | |||
|
|||
# Dynamically read Nomad ACL token | |||
headers = headers.merge({"X-Nomad-Token" => nomad_token}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind guarding this so if nomad_token
is nil the header is excluded.
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra newline
@@ -31,7 +31,7 @@ class Response | |||
|
|||
# Parses the value as a string, converting "" to nil (go compat). | |||
string_as_nil: ->(item) { | |||
if item.nil? || item.strip.empty? | |||
if item.nil? || item.to_s.strip.empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! One small change to exclude the header if it's nil, and a question about casting the string_as_nil to a string
No description provided.