Defines tenant management API on AuthRequestHandler.#559
Merged
bojeil-google merged 3 commits intoauth-multi-tenancyfrom Jun 12, 2019
Merged
Defines tenant management API on AuthRequestHandler.#559bojeil-google merged 3 commits intoauth-multi-tenancyfrom
bojeil-google merged 3 commits intoauth-multi-tenancyfrom
Conversation
wuyanna
reviewed
Jun 10, 2019
…est with no type.
wuyanna
approved these changes
Jun 11, 2019
wuyanna
approved these changes
Jun 11, 2019
hiranya911
suggested changes
Jun 12, 2019
Contributor
hiranya911
left a comment
There was a problem hiding this comment.
This looks really good. I just pointed out a few nits.
src/auth/auth-api-request.ts
Outdated
| * @param {TenantOptions} tenantOptions The properties to set on the new tenant to be created. | ||
| * @return {Promise<TenantServerResponse>} A promise that resolves with the newly created tenant object. | ||
| */ | ||
| public createTenant(tenantOptions: TenantOptions): Promise<object> { |
Contributor
There was a problem hiding this comment.
Set return type to Promise<TenantServerResponse>
src/auth/auth-api-request.ts
Outdated
| } catch (e) { | ||
| return Promise.reject(e); | ||
| } | ||
| return this.invokeRequestHandler(this.tenantMgmtResourceBuilder, CREATE_TENANT, request) |
Contributor
There was a problem hiding this comment.
Nit: You can move this inside the try block. Then request can be a const. Here and other places where this pattern is used.
src/auth/auth-api-request.ts
Outdated
| * @param {TenantOptions} tenantOptions The properties to update on the existing tenant. | ||
| * @return {Promise<TenantServerResponse>} A promise that resolves with the modified tenant object. | ||
| */ | ||
| public updateTenant(tenantId: string, tenantOptions: TenantOptions): Promise<object> { |
Contributor
There was a problem hiding this comment.
Set the more specific return type.
|
|
||
| describe('updateTenant', () => { | ||
| const path = '/v2beta1/projects/project_id/tenants/tenant_id'; | ||
| const method = 'PATCH'; |
Contributor
There was a problem hiding this comment.
May be call this patchMethod? That will make the code that uses it more readable:
expect(stub).to.have.been.calledOnce.and.calledWith(callParams(expectedPath, patchMethod, expectedRequest));
|
|
||
| describe('createTenant', () => { | ||
| const path = '/v2beta1/projects/project_id/tenants'; | ||
| const method = 'POST'; |
Contributor
There was a problem hiding this comment.
Nit: Perhaps call it postMethod for clarity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defines tenant management API on AuthRequestHandler.