google-auth-library
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -167,3 +167,3 @@ "use strict"; | ||
// We failed to find the default credentials. Bail out with an error. | ||
throw new Error('Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.'); | ||
throw new Error('Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.'); | ||
} | ||
@@ -170,0 +170,0 @@ // For GCE, just return a default ComputeClient. It will take care of |
@@ -98,12 +98,2 @@ /** | ||
} | ||
export interface TokenInfoRequest { | ||
aud: string; | ||
user_id?: string; | ||
scope: string; | ||
expires_in: number; | ||
azp?: string; | ||
sub?: string; | ||
exp?: number; | ||
access_type?: string; | ||
} | ||
export interface GenerateAuthUrlOpts { | ||
@@ -122,2 +112,15 @@ /** | ||
/** | ||
* The hd (hosted domain) parameter streamlines the login process for G Suite | ||
* hosted accounts. By including the domain of the G Suite user (for example, | ||
* mycollege.edu), you can indicate that the account selection UI should be | ||
* optimized for accounts at that domain. To optimize for G Suite accounts | ||
* generally instead of just one domain, use an asterisk: hd=*. | ||
* Don't rely on this UI optimization to control who can access your app, | ||
* as client-side requests can be modified. Be sure to validate that the | ||
* returned ID token has an hd claim value that matches what you expect | ||
* (e.g. mycolledge.edu). Unlike the request parameter, the ID token claim is | ||
* contained within a security token from Google, so the value can be trusted. | ||
*/ | ||
hd?: string; | ||
/** | ||
* The 'response_type' will always be set to 'CODE'. | ||
@@ -290,3 +293,3 @@ */ | ||
constructor(clientId?: string, clientSecret?: string, redirectUri?: string); | ||
protected static readonly GOOGLE_TOKEN_INFO_URL: string; | ||
protected static readonly GOOGLE_TOKEN_INFO_URL = "https://oauth2.googleapis.com/tokeninfo"; | ||
/** | ||
@@ -419,4 +422,4 @@ * The base URL for auth endpoints. | ||
*/ | ||
verifyIdToken(options: VerifyIdTokenOptions): Promise<LoginTicket | null>; | ||
verifyIdToken(options: VerifyIdTokenOptions, callback: (err: Error | null, login?: LoginTicket | null) => void): void; | ||
verifyIdToken(options: VerifyIdTokenOptions): Promise<LoginTicket>; | ||
verifyIdToken(options: VerifyIdTokenOptions, callback: (err: Error | null, login?: LoginTicket) => void): void; | ||
private verifyIdTokenAsync; | ||
@@ -423,0 +426,0 @@ /** |
@@ -18,11 +18,11 @@ /** | ||
export { Compute, ComputeOptions } from './auth/computeclient'; | ||
export { Credentials } from './auth/credentials'; | ||
export { CredentialBody, CredentialRequest, Credentials, JWTInput } from './auth/credentials'; | ||
export { GoogleAuthOptions } from './auth/googleauth'; | ||
export { IAMAuth } from './auth/iam'; | ||
export { JWTAccess } from './auth/jwtaccess'; | ||
export { JWT } from './auth/jwtclient'; | ||
export { CodeChallengeMethod, OAuth2Client } from './auth/oauth2client'; | ||
export { UserRefreshClient } from './auth/refreshclient'; | ||
export { IAMAuth, RequestMetadata } from './auth/iam'; | ||
export { Claims, JWTAccess } from './auth/jwtaccess'; | ||
export { JWT, JWTOptions } from './auth/jwtclient'; | ||
export { Certificates, CodeChallengeMethod, GenerateAuthUrlOpts, GetTokenOptions, OAuth2Client, OAuth2ClientOptions, RefreshOptions, TokenInfo, VerifyIdTokenOptions } from './auth/oauth2client'; | ||
export { UserRefreshClient, UserRefreshClientOptions } from './auth/refreshclient'; | ||
export { DefaultTransporter } from './transporters'; | ||
declare const auth: GoogleAuth; | ||
export { auth, GoogleAuth }; |
@@ -7,2 +7,42 @@ # Changelog | ||
## v2.0.1 | ||
### Implementation Changes | ||
- fix: verifyIdToken will never return null ([#488](https://github.com/google/google-auth-library-nodejs/pull/488)) | ||
- Update the url to application default credentials ([#470](https://github.com/google/google-auth-library-nodejs/pull/470)) | ||
- Update omitted parameter 'hd' ([#467](https://github.com/google/google-auth-library-nodejs/pull/467)) | ||
### Dependencies | ||
- chore(deps): update dependency nock to v10 ([#501](https://github.com/google/google-auth-library-nodejs/pull/501)) | ||
- chore(deps): update dependency sinon to v7 ([#502](https://github.com/google/google-auth-library-nodejs/pull/502)) | ||
- chore(deps): update dependency typescript to v3.1.3 ([#503](https://github.com/google/google-auth-library-nodejs/pull/503)) | ||
- chore(deps): update dependency gh-pages to v2 ([#499](https://github.com/google/google-auth-library-nodejs/pull/499)) | ||
- chore(deps): update dependency typedoc to ^0.13.0 ([#497](https://github.com/google/google-auth-library-nodejs/pull/497)) | ||
### Documentation | ||
- docs: Remove code format from Application Default Credentials ([#483](https://github.com/google/google-auth-library-nodejs/pull/483)) | ||
- docs: replace google/ with googleapis/ in URIs ([#472](https://github.com/google/google-auth-library-nodejs/pull/472)) | ||
- Fix typo in readme ([#469](https://github.com/google/google-auth-library-nodejs/pull/469)) | ||
- Update samples and docs for 2.0 ([#459](https://github.com/google/google-auth-library-nodejs/pull/459)) | ||
### Internal / Testing Changes | ||
- chore: update issue templates ([#509](https://github.com/google/google-auth-library-nodejs/pull/509)) | ||
- chore: remove old issue template ([#507](https://github.com/google/google-auth-library-nodejs/pull/507)) | ||
- build: run tests on node11 ([#506](https://github.com/google/google-auth-library-nodejs/pull/506)) | ||
- chore(build): drop hard rejection and update gts in the kitchen test ([#504](https://github.com/google/google-auth-library-nodejs/pull/504)) | ||
- chores(build): do not collect sponge.xml from windows builds ([#500](https://github.com/google/google-auth-library-nodejs/pull/500)) | ||
- chores(build): run codecov on continuous builds ([#495](https://github.com/google/google-auth-library-nodejs/pull/495)) | ||
- chore: update new issue template ([#494](https://github.com/google/google-auth-library-nodejs/pull/494)) | ||
- build: fix codecov uploading on Kokoro ([#490](https://github.com/google/google-auth-library-nodejs/pull/490)) | ||
- test: move kitchen sink tests to system-test ([#489](https://github.com/google/google-auth-library-nodejs/pull/489)) | ||
- Update kokoro config ([#482](https://github.com/google/google-auth-library-nodejs/pull/482)) | ||
- fix: export additional typescript types ([#479](https://github.com/google/google-auth-library-nodejs/pull/479)) | ||
- Don't publish sourcemaps ([#478](https://github.com/google/google-auth-library-nodejs/pull/478)) | ||
- test: remove appveyor config ([#477](https://github.com/google/google-auth-library-nodejs/pull/477)) | ||
- Enable prefer-const in the eslint config ([#473](https://github.com/google/google-auth-library-nodejs/pull/473)) | ||
- Enable no-var in eslint ([#471](https://github.com/google/google-auth-library-nodejs/pull/471)) | ||
- Update CI config ([#468](https://github.com/google/google-auth-library-nodejs/pull/468)) | ||
- Retry npm install in CI ([#465](https://github.com/google/google-auth-library-nodejs/pull/465)) | ||
- Update Kokoro config ([#462](https://github.com/google/google-auth-library-nodejs/pull/462)) | ||
## v2.0.0 | ||
@@ -9,0 +49,0 @@ |
{ | ||
"name": "google-auth-library", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Google Inc.", | ||
@@ -30,3 +30,3 @@ "description": "Google APIs Authentication Client Library for Node.js", | ||
"devDependencies": { | ||
"typedoc": "^0.12.0", | ||
"typedoc": "^0.13.0", | ||
"@types/jws": "^3.1.0", | ||
@@ -46,5 +46,4 @@ "@types/lodash.isstring": "^4.0.3", | ||
"codecov": "^3.0.2", | ||
"gh-pages": "^1.2.0", | ||
"gh-pages": "^2.0.0", | ||
"gts": "^0.8.0", | ||
"hard-rejection": "^1.0.0", | ||
"intelli-espower-loader": "^1.0.1", | ||
@@ -56,10 +55,10 @@ "js-green-licenses": "^0.5.0", | ||
"ncp": "^2.0.0", | ||
"nock": "^9.3.0", | ||
"nock": "^10.0.0", | ||
"nyc": "^13.0.0", | ||
"pify": "^4.0.0", | ||
"prettier": "^1.13.4", | ||
"sinon": "^6.0.0", | ||
"sinon": "^7.0.0", | ||
"source-map-support": "^0.5.6", | ||
"tmp": "^0.0.33", | ||
"typescript": "~3.0.0" | ||
"typescript": "~3.1.0" | ||
}, | ||
@@ -70,2 +69,3 @@ "files": [ | ||
"build/src", | ||
"!build/src/**/*.map", | ||
"package.json" | ||
@@ -72,0 +72,0 @@ ], |
@@ -21,3 +21,3 @@ <img src="https://avatars0.githubusercontent.com/u/1342004?v=3&s=96" alt="Google Inc. logo" title="Google" align="right" height="96" width="96"/> | ||
## Upgrading to 1.x | ||
The `1.x` release includes a variety of bug fixes, new features, and breaking changes. Please take care, and see [the release notes](https://github.com/google/google-auth-library-nodejs/releases/tag/v1.0.0) for a list of breaking changes, and the upgrade guide. | ||
The `1.x` release includes a variety of bug fixes, new features, and breaking changes. Please take care, and see [the release notes](https://github.com/googleapis/google-auth-library-nodejs/releases/tag/v1.0.0) for a list of breaking changes, and the upgrade guide. | ||
@@ -38,3 +38,3 @@ ## Ways to authenticate | ||
To use `Application Default Credentials`, You first need to download a set of JSON credentials for your project. Go to **APIs & Auth** > **Credentials** in the [Google Developers Console][devconsole] and select **Service account** from the **Add credentials** dropdown. | ||
To use Application Default Credentials, You first need to download a set of JSON credentials for your project. Go to **APIs & Auth** > **Credentials** in the [Google Developers Console][devconsole] and select **Service account** from the **Add credentials** dropdown. | ||
@@ -166,3 +166,3 @@ > This file is your *only copy* of these credentials. It should never be | ||
#### Handling token events | ||
This library will automatically obtain an `access_token`, and automatically refresh the `access_token` if a `refresh_token` is present. The `refresh_token` is only returned on the [first authorization](https://github.com/google/google-api-nodejs-client/issues/750#issuecomment-304521450), so if you want to make sure you store it safely. An easy way to make sure you always store the most recent tokens is to use the `tokens` event: | ||
This library will automatically obtain an `access_token`, and automatically refresh the `access_token` if a `refresh_token` is present. The `refresh_token` is only returned on the [first authorization](https://github.com/googleapis/google-api-nodejs-client/issues/750#issuecomment-304521450), so if you want to make sure you store it safely. An easy way to make sure you always store the most recent tokens is to use the `tokens` event: | ||
@@ -226,3 +226,3 @@ ```js | ||
// after acquiring an oAuth2Client... | ||
const tokenInfo = await oAuth2client.getTokenInfo('my-access-token'); | ||
const tokenInfo = await oAuth2Client.getTokenInfo('my-access-token'); | ||
@@ -262,3 +262,2 @@ // take a look at the scopes originally provisioned for the access token | ||
); | ||
await client.authorize(); | ||
const url = `https://www.googleapis.com/dns/v1/projects/${keys.project_id}`; | ||
@@ -270,3 +269,2 @@ const res = await client.request({url}); | ||
main().catch(console.error); | ||
``` | ||
@@ -311,3 +309,2 @@ | ||
client.scopes = ['https://www.googleapis.com/auth/cloud-platform']; | ||
await client.authorize(); | ||
const url = `https://www.googleapis.com/dns/v1/projects/${keys.project_id}`; | ||
@@ -359,3 +356,3 @@ const res = await client.request({url}); | ||
[Application Default Credentials]: https://developers.google.com/identity/protocols/application-default-credentials#callingnode | ||
[Application Default Credentials]: https://cloud.google.com/docs/authentication/getting-started | ||
[apptype]: https://user-images.githubusercontent.com/534619/36553844-3f9a863c-17b2-11e8-904a-29f6cd5f807a.png | ||
@@ -365,11 +362,11 @@ [authdocs]: https://developers.google.com/accounts/docs/OAuth2Login | ||
[axiosOpts]: https://github.com/axios/axios#request-config | ||
[bugs]: https://github.com/google/google-auth-library-nodejs/issues | ||
[circle-image]: https://circleci.com/gh/google/google-auth-library-nodejs.svg?style=svg | ||
[circle-url]: https://circleci.com/gh/google/google-auth-library-nodejs | ||
[codecov-image]: https://codecov.io/gh/google/google-auth-library-nodejs/branch/master/graph/badge.svg | ||
[codecov-url]: https://codecov.io/gh/google/google-auth-library-nodejs | ||
[contributing]: https://github.com/google/google-auth-library-nodejs/blob/master/.github/CONTRIBUTING.md | ||
[copying]: https://github.com/google/google-auth-library-nodejs/tree/master/LICENSE | ||
[david-dm-img]: https://david-dm.org/google/google-auth-library-nodejs/status.svg | ||
[david-dm]: https://david-dm.org/google/google-auth-library-nodejs | ||
[bugs]: https://github.com/googleapis/google-auth-library-nodejs/issues | ||
[circle-image]: https://circleci.com/gh/googleapis/google-auth-library-nodejs.svg?style=svg | ||
[circle-url]: https://circleci.com/gh/googleapis/google-auth-library-nodejs | ||
[codecov-image]: https://codecov.io/gh/googleapis/google-auth-library-nodejs/branch/master/graph/badge.svg | ||
[codecov-url]: https://codecov.io/gh/googleapis/google-auth-library-nodejs | ||
[contributing]: https://github.com/googleapis/google-auth-library-nodejs/blob/master/.github/CONTRIBUTING.md | ||
[copying]: https://github.com/googleapis/google-auth-library-nodejs/tree/master/LICENSE | ||
[david-dm-img]: https://david-dm.org/googleapis/google-auth-library-nodejs/status.svg | ||
[david-dm]: https://david-dm.org/googleapis/google-auth-library-nodejs | ||
[node]: http://nodejs.org/ | ||
@@ -379,10 +376,5 @@ [npmimg]: https://img.shields.io/npm/v/google-auth-library.svg | ||
[oauth]: https://developers.google.com/identity/protocols/OAuth2 | ||
[snyk-image]: https://snyk.io/test/github/google/google-auth-library-nodejs/badge.svg | ||
[snyk-url]: https://snyk.io/test/github/google/google-auth-library-nodejs | ||
[stability]: http://nodejs.org/api/stream.html#stream_stream | ||
[snyk-image]: https://snyk.io/test/github/googleapis/google-auth-library-nodejs/badge.svg | ||
[snyk-url]: https://snyk.io/test/github/googleapis/google-auth-library-nodejs | ||
[stackoverflow]: http://stackoverflow.com/questions/tagged/google-auth-library-nodejs | ||
[stream]: http://nodejs.org/api/stream.html#stream_class_stream_readable | ||
[devconsole]: https://console.developer.google.com | ||
[options]: https://github.com/google/google-auth-library-nodejs/tree/master#options | ||
[gcloud]: https://github.com/GoogleCloudPlatform/gcloud-node | ||
[cloudplatform]: https://developers.google.com/cloud/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31
4019
197076
36
371