Skip to content

Migrate Project Config service calls to v2. #665

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

Merged
merged 3 commits into from
Dec 12, 2019
Merged
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
4 changes: 2 additions & 2 deletions src/auth/auth-api-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ export class AuthRequestHandler extends AbstractAuthRequestHandler {
* @return {AuthResourceUrlBuilder} A new project config resource URL builder instance.
*/
protected newProjectConfigUrlBuilder(): AuthResourceUrlBuilder {
return new AuthResourceUrlBuilder(this.projectId, 'v2beta1');
return new AuthResourceUrlBuilder(this.projectId, 'v2');
}

/**
Expand Down Expand Up @@ -1669,7 +1669,7 @@ export class TenantAwareAuthRequestHandler extends AbstractAuthRequestHandler {
* @return {AuthResourceUrlBuilder} A new project config resource URL builder instance.
*/
protected newProjectConfigUrlBuilder(): AuthResourceUrlBuilder {
return new TenantAwareAuthResourceUrlBuilder(this.projectId, 'v2beta1', this.tenantId);
return new TenantAwareAuthResourceUrlBuilder(this.projectId, 'v2', this.tenantId);
}

/**
Expand Down
20 changes: 10 additions & 10 deletions test/unit/auth/auth-api-request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2507,7 +2507,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('getOAuthIdpConfig()', () => {
const providerId = 'oidc.provider';
const path = handler.path('v2beta1', `/oauthIdpConfigs/${providerId}`, 'project_id');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also want to rename the APIs to be consistent with the SAML counterparts here and elsewhere.
oauthIdpConfigs -> inboundOauthConfigs
Check the proto file for confirmation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like oauthIdpConfigs was kept for OnePlatform compliancy.

const path = handler.path('v2', `/oauthIdpConfigs/${providerId}`, 'project_id');
const expectedHttpMethod = 'GET';
const expectedResult = utils.responseFrom({
name: `projects/project1/oauthIdpConfigs/${providerId}`,
Expand Down Expand Up @@ -2565,7 +2565,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {
});

describe('listOAuthIdpConfigs()', () => {
const path = handler.path('v2beta1', '/oauthIdpConfigs', 'project_id');
const path = handler.path('v2', '/oauthIdpConfigs', 'project_id');
const expectedHttpMethod = 'GET';
const nextPageToken = 'PAGE_TOKEN';
const maxResults = 50;
Expand Down Expand Up @@ -2686,7 +2686,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('deleteOAuthIdpConfig()', () => {
const providerId = 'oidc.provider';
const path = handler.path('v2beta1', `/oauthIdpConfigs/${providerId}`, 'project_id');
const path = handler.path('v2', `/oauthIdpConfigs/${providerId}`, 'project_id');
const expectedHttpMethod = 'DELETE';
const expectedResult = utils.responseFrom({});

Expand Down Expand Up @@ -2743,7 +2743,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('createOAuthIdpConfig', () => {
const providerId = 'oidc.provider';
const path = handler.path('v2beta1', `/oauthIdpConfigs?oauthIdpConfigId=${providerId}`, 'project_id');
const path = handler.path('v2', `/oauthIdpConfigs?oauthIdpConfigId=${providerId}`, 'project_id');
const expectedHttpMethod = 'POST';
const configOptions = {
providerId,
Expand Down Expand Up @@ -2835,7 +2835,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('updateOAuthIdpConfig()', () => {
const providerId = 'oidc.provider';
const path = handler.path('v2beta1', `/oauthIdpConfigs/${providerId}`, 'project_id');
const path = handler.path('v2', `/oauthIdpConfigs/${providerId}`, 'project_id');
const expectedHttpMethod = 'PATCH';
const configOptions = {
displayName: 'OIDC_DISPLAY_NAME',
Expand Down Expand Up @@ -3000,7 +3000,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('getInboundSamlConfig()', () => {
const providerId = 'saml.provider';
const path = handler.path('v2beta1', `/inboundSamlConfigs/${providerId}`, 'project_id');
const path = handler.path('v2', `/inboundSamlConfigs/${providerId}`, 'project_id');

const expectedHttpMethod = 'GET';
const expectedResult = utils.responseFrom({
Expand Down Expand Up @@ -3057,7 +3057,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {
});

describe('listInboundSamlConfigs()', () => {
const path = handler.path('v2beta1', '/inboundSamlConfigs', 'project_id');
const path = handler.path('v2', '/inboundSamlConfigs', 'project_id');
const expectedHttpMethod = 'GET';
const nextPageToken = 'PAGE_TOKEN';
const maxResults = 50;
Expand Down Expand Up @@ -3174,7 +3174,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('deleteInboundSamlConfig()', () => {
const providerId = 'saml.provider';
const path = handler.path('v2beta1', `/inboundSamlConfigs/${providerId}`, 'project_id');
const path = handler.path('v2', `/inboundSamlConfigs/${providerId}`, 'project_id');
const expectedHttpMethod = 'DELETE';
const expectedResult = utils.responseFrom({});

Expand Down Expand Up @@ -3229,7 +3229,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('createInboundSamlConfig', () => {
const providerId = 'saml.provider';
const path = handler.path('v2beta1', `/inboundSamlConfigs?inboundSamlConfigId=${providerId}`, 'project_id');
const path = handler.path('v2', `/inboundSamlConfigs?inboundSamlConfigId=${providerId}`, 'project_id');
const expectedHttpMethod = 'POST';
const configOptions = {
providerId,
Expand Down Expand Up @@ -3336,7 +3336,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => {

describe('updateInboundSamlConfig()', () => {
const providerId = 'saml.provider';
const path = handler.path('v2beta1', `/inboundSamlConfigs/${providerId}`, 'project_id');
const path = handler.path('v2', `/inboundSamlConfigs/${providerId}`, 'project_id');

const expectedHttpMethod = 'PATCH';
const configOptions = {
Expand Down