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

feat: get rid of createScopedRequired #318

Merged
merged 9 commits into from
Mar 13, 2018
Merged

feat: get rid of createScopedRequired #318

merged 9 commits into from
Mar 13, 2018

Conversation

JustinBeckwith
Copy link
Contributor

@JustinBeckwith JustinBeckwith commented Mar 10, 2018

Resolves #264

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 10, 2018
@JustinBeckwith
Copy link
Contributor Author

I am very confused and do not know why its showing all these commits. "get rid of createScopedRequired" should be the only one.

@JustinBeckwith JustinBeckwith requested review from ofrobots, jinwoo and a team March 10, 2018 05:10
@codecov-io
Copy link

codecov-io commented Mar 10, 2018

Codecov Report

Merging #318 into next will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##            next     #318      +/-   ##
=========================================
+ Coverage   94.6%   94.84%   +0.24%     
=========================================
  Files         14       14              
  Lines        853      854       +1     
  Branches     193      199       +6     
=========================================
+ Hits         807      810       +3     
+ Misses        46       44       -2
Impacted Files Coverage Δ
src/auth/jwtaccess.ts 98.03% <ø> (-0.08%) ⬇️
src/auth/iam.ts 100% <ø> (+25%) ⬆️
src/auth/computeclient.ts 93.93% <ø> (-0.35%) ⬇️
src/auth/googleauth.ts 94.71% <100%> (+0.2%) ⬆️
src/auth/jwtclient.ts 95.18% <100%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 143f167...84cf775. Read the comment docs.

@@ -1229,6 +1230,13 @@ it('should accept credentials to get a client', async () => {
assert.equal(client.email, 'hello@youarecool.com');
});

it('should allow passing scopes to get a client', async () => {
const scopes = ['http://examples.com/is/a/scope'];

This comment was marked as spam.

This comment was marked as spam.

README.md Outdated
@@ -52,12 +52,14 @@ Rather than manually creating an OAuth2 client, JWT client, or Compute client, t

For example, a JWT auth client will be created when your code is running on your local developer machine, and a Compute client will be created when the same code is running on Google Cloud Platform.

The code below shows how to retrieve a default credential type, depending upon the runtime environment. The createScopedRequired must be called to determine when you need to pass in the scopes manually, and when they have been set for you automatically based on the configured runtime environment.
The code below shows how to retrieve a default credential type, depending upon the runtime environment.

This comment was marked as spam.

JustinBeckwith and others added 9 commits March 12, 2018 18:22
**BREAKING CHANGE**:  Renames the `credential` field on the `ADCResponse` to `client`.  Previous code like this:

```js
const res = await auth.getApplicationDefault();	
const client = res.credential;	
```

Now will look like this:

```js
const res = await auth.getApplicationDefault();	
const client = res.client;	
```
**BREAKING CHANGE**:  Many methods that previously returned `null` may now return `undefined`. 

We had types that were optional or null all over the codebase.  Cleaned this up by removing any null type that was already optional.
**BREAKING CHANGE**:  Renames the `credential` field on the `ADCResponse` to `client`.  Previous code like this:

```js
const res = await auth.getApplicationDefault();	
const client = res.credential;	
```

Now will look like this:

```js
const res = await auth.getApplicationDefault();	
const client = res.client;	
```
@@ -1233,6 +1233,13 @@ it('should allow passing scopes to get a client', async () => {
assert.equal(client.scopes, scopes);
});

it('should allow passing a scope to get a client', async () => {

This comment was marked as spam.

assert.equal(client.scopes, scopes);
});

it('should allow passing a scope to get a client', async () => {

This comment was marked as spam.

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

Successfully merging this pull request may close these issues.

None yet

4 participants