-
Notifications
You must be signed in to change notification settings - Fork 371
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
docs: add docs and samples #201
Conversation
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.
Commit hygiene: this includes a fix but the abstract suggests that this is a docs-only change. The abstract would be wrong, as per conventional commit guidelines when this is landed. Secondly, even if you are not going to make separate PRs for fix vs. doc, it would be good to put these in separate commits to make reviewing easier. Ideally this should be separate PRs.
README.md
Outdated
level for the application independent of the user. This is the recommended approach to authorize | ||
calls to Cloud APIs, particularly when you're building an application that uses Google Compute | ||
Engine. | ||
They are best suited for cases when the call needs to have the same identity and authorization level for the application independent of the user. This is the recommended approach to authorize calls to Cloud APIs, particularly when you're building an application that uses Google Compute Engine. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
// machine. In that case, the desired scopes must be passed in manually. When the code is | ||
// running in GCE or a Managed VM, the scopes are pulled from the GCE metadata server. | ||
// See https://cloud.google.com/compute/docs/authentication for more information. | ||
if (client.createScopedRequired && client.createScopedRequired()) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
* Create a new OAuth2Client, and go through the OAuth2 content | ||
* workflow. Return the full client to the callback. | ||
*/ | ||
async function getAuthenticatedClient() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
} | ||
|
||
main(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
return client; | ||
} | ||
|
||
main(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
}); | ||
} | ||
|
||
main(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Also, addresses #196 |
README.md
Outdated
Before making your API call, you must be sure the API you're calling has been enabled. Go to **APIs & Auth** > **APIs** in the [Google Developers Console][devconsole] and enable the APIs you'd like to call. For the example below, you must enable the `DNS API`. | ||
|
||
|
||
#### Choosing the correct credential type automatically |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
try { | ||
const adc = await getADC(); | ||
const url = `https://www.googleapis.com/dns/v1/projects/${adc.projectId}`; | ||
const res = await adc.client.request({url}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
||
This client comes with an [OAuth2][oauth] client that allows you to retrieve an access token and refreshes the token and retry the request seamlessly if you also provide an `expiry_date` and the token is expired. The basics of Google's OAuth2 implementation is explained on [Google Authorization and Authentication documentation][authdocs]. | ||
|
||
In the following examples, you may need a `CLIENT_ID`, `CLIENT_SECRET` and `REDIRECT_URL`. You can find these pieces of information by going to the [Developer Console][devconsole], clicking your project --> APIs & auth --> credentials. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Note: test failures are unrelated, and fixed in #209 |
This includes a few things:
Update to a working version of gtoken(handled in fix: use urlencoded content-type for POST #203)Fixes a few bugs with Content-Type(handled in fix: use urlencoded content-type for POST #203)Exposes objects as exports instead of relying on public properties on the GoogleAuth object(handled in BREAKING CHANGE: export class types and remove properties from GoogleAuth #202)