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 base64 encoded api_token as basic auth header to JobBoard#apply_to_job method #31

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MrISH
Copy link

@MrISH MrISH commented Mar 1, 2018

POST requests to Job Applications endpoint require api_token to be base64 encoded, and Content-Type to be set as 'application/json'.
Being able to run specs required updating webmock version and codeclimate ruby-test-reporter config.

@@ -54,6 +54,10 @@ def get_from_job_board_api(url, options = {})
end
end

def post_headers
{ 'Authorization' => 'Basic ' + Base64.encode64(api_token), 'Content-Type' => 'application/json' }
Copy link

Choose a reason for hiding this comment

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

Shouldn't it be the base64 of api_token + ':' ? (to be a username with no password)

Copy link
Author

Choose a reason for hiding this comment

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

I won't disagree with you - I will test when I get a chance.
Just working from the API docs https://github.com/grnhse/greenhouse-api-docs/blob/master/source/includes/job-board/_applications.md#request-headers
and it seems to work fine without.

@Ryman
Copy link

Ryman commented Jul 3, 2018

@capablemonkey can somebody at Greenhouse review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants