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

Renaming all uses of authorize to authenticate #846

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ $ npm install --save gcloud
- [gcloud-kvstore][gcloud-kvstore] - Use Datastore as a simple key-value store.
- [hya-wave][hya-wave] - Cloud-based web sample editor. Part of the [hya-io][hya-io] family of products.

## Authorization
## Authentication

With `gcloud-node` it's incredibly easy to get authorized and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
With `gcloud-node` it's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.

### On Google Compute Engine

If you are running this client on Google Compute Engine, we handle authorization for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.

``` js
// Authorizing on a global basis.
// Authenticating on a global basis.
var projectId = process.env.GCLOUD_PROJECT_ID; // E.g. 'grape-spaceship-123'
var gcloud = require('gcloud')({
projectId: projectId
Expand All @@ -62,11 +62,11 @@ If you are not running this client on Google Compute Engine, you need a Google D
* Google Cloud Storage
* Google Cloud Storage JSON API
4. Navigate to **APIs & auth** > **Credentials** and then:
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authorize your requests.
* If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests.
* If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file.

``` js
// Authorizing on a global basis.
// Authenticating on a global basis.
var projectId = process.env.GCLOUD_PROJECT_ID; // E.g. 'grape-spaceship-123'

var gcloud = require('gcloud')({
Expand All @@ -90,8 +90,8 @@ You can also set auth on a per-API-instance basis. The examples below show you h
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).
var bigquery = gcloud.bigquery({
projectId: 'my-project',
keyFilename: '/path/to/keyfile.json'
Expand Down Expand Up @@ -126,8 +126,8 @@ job.getQueryResults().on('data', function(row) {});
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var dataset = gcloud.datastore.dataset({
projectId: 'my-project',
Expand Down Expand Up @@ -177,8 +177,8 @@ dataset.save({
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var dns = gcloud.dns({
keyFilename: '/path/to/keyfile.json',
Expand Down Expand Up @@ -217,8 +217,8 @@ zone.export('/zonefile.zone', function(err) {});
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you
// auth on a global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you
// auth on a global basis (see Authentication section above).

var pubsub = gcloud.pubsub({
projectId: 'my-project',
Expand Down Expand Up @@ -260,8 +260,8 @@ topic.subscribe('new-subscription', function(err, subscription) {
var fs = require('fs');
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var gcs = gcloud.storage({
keyFilename: '/path/to/keyfile.json',
Expand Down Expand Up @@ -311,8 +311,8 @@ localReadStream.pipe(remoteWriteStream);
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var gce = gcloud.compute({
projectId: 'my-project',
Expand Down Expand Up @@ -347,8 +347,8 @@ zone.createVM(name, { os: 'ubuntu' }, function(err, vm, operation) {
```js
var gcloud = require('gcloud');

// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var search = gcloud.search({
keyFilename: '/path/to/keyfile.json',
Expand Down
2 changes: 1 addition & 1 deletion docs/authorization.md → docs/authentication.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## With `gcloud-node`

With `gcloud-node` it's incredibly easy to get authorized and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
With `gcloud-node` it's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.

```hljs-class
var config = {
Expand Down
6 changes: 3 additions & 3 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## How do I use `gcloud` with Google Compute Engine?

If you are running this client on Google Compute Engine, we handle authorization for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.
If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access.

## I'm not using Compute Engine. What do I need to do?

If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account, please see our [Authorization][auth-guide] guide.
If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account, please see our [Authentication][auth-guide] guide.

## Does this replace [Google Cloud Node.js Client][googleapis]?

Expand All @@ -13,4 +13,4 @@ Google Cloud Node.js Client is a client library for using the broad set of Googl
[dev-console]: https://console.developers.google.com/project
[gce-how-to]: https://developers.google.com/compute/docs/authentication#using
[googleapis]: https://github.com/google/google-api-nodejs-client
[auth-guide]: #/authorization
[auth-guide]: #/authentication
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script src="site/components/docs/docs-directives.js"></script>
<script src="site/components/docs/docs-services.js"></script>
<script src="site/components/docs/docs-values.js"></script>
<script src="site/components/authorization/authorization.js"></script>
<script src="site/components/authentication/authentication.js"></script>
<script src="site/components/faq/faq.js"></script>
<script src="site/components/contributing/contributing.js"></script>
<script src="site/components/how-to-get-help/how-to-get-help-directive.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script id="authorization-header.html" type="text/ng-template">
<header header title="Authorization">
<script id="authentication-header.html" type="text/ng-template">
<header header title="Authentication">
<div class="row row--right">
<div class="col margin-vertical">
<a href="https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authorization/readme.md"
<a href="https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md"
class="v-btn">
<img src="site/img/icon-link-github.svg" />
Edit on GitHub
Expand All @@ -13,10 +13,10 @@
</script>

<div subpage
header-templateUrl="authorization-header.html"
title="Authorization">
header-templateUrl="authentication-header.html"
title="Authentication">
<div
gcloud-markdown="https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authorization/readme.md">
gcloud-markdown="https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md">
</div>
<div gcloud-markdown="authorization.md"></div>
<div gcloud-markdown="authentication.md"></div>
</div>
16 changes: 16 additions & 0 deletions docs/site/components/authentication/authentication.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
angular
.module('gcloud.authentication', ['ngRoute', 'gcloud.subpage', 'gcloud.markdown'])
.config(function($routeProvider) {
'use strict';

$routeProvider.when('/authentication', {
controller: 'AuthenticationCtrl',
templateUrl: 'site/components/authentication/authentication.html',
reloadOnSearch: false
});
})

.controller('AuthenticationCtrl', function($scope) {
'use strict';

});
16 changes: 0 additions & 16 deletions docs/site/components/authorization/authorization.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/site/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h3 class="sub-heading">
keyFilename: '/path/to/keyfile.json'
});</div>
<p>
The full set of options which can be passed to gcloud and sub-modules are <a href="#/authorization">outlined here</a>.
The full set of options which can be passed to gcloud and sub-modules are <a href="#/authentication">outlined here</a>.
</p>
</article>
<hr>
Expand Down
4 changes: 2 additions & 2 deletions docs/site/components/language-switcher/language-switcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<h4 class="list-item--heading">Getting Started</h4>
</li>
<li ng-if="extraLinks.length > 0" class="invisible-lg">
<a href="#/authorization" ng-class="{ current: isActiveUrl('/authorization') }" title="Authorization">
Authorization
<a href="#/authentication" ng-class="{ current: isActiveUrl('/authentication') }" title="Authentication">
Authentication
</a>
</li>
<li ng-if="extraLinks.length > 0" class="invisible-lg">
Expand Down
4 changes: 2 additions & 2 deletions docs/site/components/subpage/subpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ <h1 class="logo">
<h4 class="list-item--heading">Getting Started</h4>
</li>
<li>
<a href="#/authorization" ng-class="{ current: isActiveUrl('/authorization') }" title="Authorization">
Authorization
<a href="#/authentication" ng-class="{ current: isActiveUrl('/authentication') }" title="Authentication">
Authentication
</a>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ <h3 class="block-title">What is it?</h3>
to you.</p>

<p><code>gcloud</code> is configured to access Google Cloud Platform
services and authorize (OAuth 2.0) automatically on your behalf.
services and authenticate (OAuth 2.0) automatically on your behalf.
With a one-line install and a private key, you are up and ready
to go. Better yet, if you are running on a Google Compute Engine
instance, the one-line install is enough!</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/home.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular
.module('gcloud', [
'ngRoute',
'gcloud.authorization',
'gcloud.authentication',
'gcloud.docs',
'gcloud.faq',
'gcloud.contributing',
Expand Down
4 changes: 2 additions & 2 deletions lib/bigquery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function BigQuery(options) {
throw util.missingProjectIdError;
}

this.makeAuthorizedRequest_ = util.makeAuthorizedRequestFactory({
this.makeAuthenticatedRequest_ = util.makeAuthenticatedRequestFactory({
credentials: options.credentials,
keyFile: options.keyFilename,
scopes: SCOPES,
Expand Down Expand Up @@ -627,7 +627,7 @@ BigQuery.prototype.makeReq_ = function(method, path, query, body, callback) {
reqOpts.json = body;
}

this.makeAuthorizedRequest_(reqOpts, callback);
this.makeAuthenticatedRequest_(reqOpts, callback);
};

/*! Developer Documentation
Expand Down
2 changes: 1 addition & 1 deletion lib/bigquery/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Table.prototype.createWriteStream = function(metadata) {

dup.once('writing', function() {
util.makeWritableStream(dup, {
makeAuthorizedRequest: that.bigQuery.makeAuthorizedRequest_,
makeAuthenticatedRequest: that.bigQuery.makeAuthenticatedRequest_,
metadata: {
configuration: {
load: metadata
Expand Down
Loading