Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Backdrop sends Bearer token to Stagecraft #255

Merged
merged 1 commit into from
Mar 18, 2014

Conversation

fawkesley
Copy link
Contributor

The /data-sets endpoint in Stagecraft is protected by a shared bearer token.
Backdrop must send the token when it requests data set metadata from
Stagecraft

  • In BucketRepository, send HTTP requests to Stagecraft instead of
    looking inside Mongo's buckets collection.
  • Selectively handle HTTP 404 from Stagecraft - only /data-sets/<name>
    can legitimately return a 404, all other HTTP errors must bubble up.
  • Fix /data-sets/ vs /data-sets URL in fake Stagecraft
  • Added logging on Stagecraft HTTP responses and their JSON content to
    make them easier to diagnose.
  • Quite a lot of test refactoring - move unit tests that shouldn't have
    been put into integration tests for BucketRepository

Related to https://www.pivotaltracker.com/story/show/67103208
[Delivers #67103208]

@fawkesley fawkesley closed this Mar 13, 2014
@jcbashdown jcbashdown reopened this Mar 14, 2014
@robyoung robyoung self-assigned this Mar 17, 2014

data_sets = _decode_json(_get_url(data_set_url))
json_response = _get_json_url(
data_set_url, self._stagecraft_token) or '[]'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct here? A 404 would imply that you've got the wrong URL path and therefore is an error. No results should return a 200 response containing an empty list.

@fawkesley fawkesley closed this Mar 17, 2014
@fawkesley fawkesley reopened this Mar 17, 2014
The `/data-sets` endpoint in Stagecraft is protected by a shared bearer token.
Backdrop must send the token when it requests data set metadata from
Stagecraft

- In `BucketRepository`, send HTTP requests to Stagecraft instead of
  looking inside Mongo's `buckets` collection.
- Selectively handle HTTP 404 from Stagecraft - only `/data-sets/<name>`
  can legitimately return a 404, all other HTTP errors must bubble up.
- Fix `/data-sets/` vs `/data-sets` URL in fake Stagecraft
- Added logging on Stagecraft HTTP responses and their JSON content to
  make them easier to diagnose.
- Quite a lot of test refactoring - move unit tests that shouldn't have
  been put into integration tests for BucketRepository

Related to https://www.pivotaltracker.com/story/show/67103208
[#67103208]
robyoung added a commit that referenced this pull request Mar 18, 2014
Backdrop sends Bearer token to Stagecraft
@robyoung robyoung merged commit ff443ae into master-stagecraft Mar 18, 2014
@robyoung robyoung deleted the send-auth-token-to-stagecraft branch March 18, 2014 11:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants