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

datastore: don't require auth with local datastore server #940

Merged
merged 1 commit into from
Nov 12, 2015

Conversation

stephenplusplus
Copy link
Contributor

Fixes #936

When a service object is created (such as a Dataset object), we have the choice of telling our "makeAuthenticatedRequestFactory" function that we don't care about the authentication part via an option called customEndpoint. A Dataset is the one place we use this option in the event a user is trying to communicate with their own Datastore server.

We were skipping the auth when:

  • A user instantiated a Dataset providing an apiEndpoint option:

    var dataset = datastore.dataset({ apiEndpoint: 'http://localhost:8080' });

But, we also need to support when:

  • A user has the DATASTORE_HOST env var set

We have had half of the puzzle solved; we detect the presence of that env var and send the API requests to it accordingly. But, we forgot to update customEndpoint, the option that skips authenticating.

// @brainsiq

@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Nov 12, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 12, 2015
*/
Dataset.determineApiEndpoint_ = function(options) {
var apiEndpoint = 'https://www.googleapis.com';
Dataset.prototype.determineApiEndpoint_ = function(customApiEndpoint) {

This comment was marked as spam.

This comment was marked as spam.

@jgeewax
Copy link
Contributor

jgeewax commented Nov 12, 2015

LGTM

callmehiphop added a commit that referenced this pull request Nov 12, 2015
datastore: don't require auth with local datastore server
@callmehiphop callmehiphop merged commit 7374122 into googleapis:master Nov 12, 2015
@callmehiphop
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants