Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-ariyaratne authored Nov 29, 2024
2 parents 3239f63 + 91ac977 commit e3135dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,60 +187,9 @@ public void testUpdateActionWithInvalidID() {
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));

// Update Action Endpoint Authentication Properties with an invalid action id.
AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + TEST_ACTION_INVALID_ID + ACTION_BEARER_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));
}

@Test(dependsOnMethods = {"testUpdateActionWithInvalidID"})
public void testUpdateActionWithInvalidEndpointAuthProperties() {

AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_USERNAME_INVALID_AUTH_PROPERTY, TEST_USERNAME_AUTH_PROPERTY_VALUE);
put(TEST_PASSWORD_AUTH_PROPERTY, TEST_PASSWORD_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId2 + ACTION_BASIC_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_BAD_REQUEST)
.body("description", equalTo("Required authentication properties are not " +
"provided or invalid."));
}

@Test(dependsOnMethods = {"testUpdateActionWithInvalidEndpointAuthProperties"})
public void testUpdateActionWithEmptyEndpointAuthPropertyValues() {

AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_USERNAME_AUTH_PROPERTY, "");
put(TEST_PASSWORD_AUTH_PROPERTY, TEST_PASSWORD_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId2 + ACTION_BASIC_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_BAD_REQUEST)
.body("description", equalTo("Authentication property values cannot be empty."));
}

@Test(dependsOnMethods = {"testUpdateActionWithEmptyEndpointAuthPropertyValues"})
public void testActivateActionWithInvalidID() {

getResponseOfPost(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,45 +324,6 @@ public void testUpdateAction() {
}

@Test(dependsOnMethods = {"testUpdateAction"})
public void testUpdateEndpointAuthentication() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.uri", equalTo(TEST_ENDPOINT_URI))
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));
}

@Test(dependsOnMethods = {"testUpdateEndpointAuthentication"})
public void testUpdateEndpointAuthProperties() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_UPDATED_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));
}

@Test(dependsOnMethods = {"testUpdateEndpointAuthProperties"})
public void testDeactivateAction() {

getResponseOfPost(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
Expand Down Expand Up @@ -434,29 +395,7 @@ public void testCreateActionWithExtraEndpointAuthProperties() {
.statusCode(HttpStatus.SC_CREATED)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BASIC.toString()));

testActionId = responseOfPost.getBody().jsonPath().getString("id");
}

@Test(dependsOnMethods = {"testCreateActionWithExtraEndpointAuthProperties"})
public void testUpdateActionWithExtraEndpointAuthProperties() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
put(TEST_USERNAME_AUTH_PROPERTY, TEST_USERNAME_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));

// Delete, created action.
deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH , testActionId);
deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH , responseOfPost.getBody().jsonPath().getString("id"));
}
}
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2361,11 +2361,11 @@
<identity.carbon.auth.saml2.version>5.9.7</identity.carbon.auth.saml2.version>
<identity.carbon.auth.mutual.ssl.version>5.5.0</identity.carbon.auth.mutual.ssl.version>
<identity.carbon.auth.iwa.version>5.5.2</identity.carbon.auth.iwa.version>
<identity.carbon.auth.rest.version>1.9.13</identity.carbon.auth.rest.version>
<identity.carbon.auth.rest.version>1.9.14</identity.carbon.auth.rest.version>


<!-- Identity Inbound Versions -->
<identity.inbound.auth.oauth.version>7.0.191</identity.inbound.auth.oauth.version>
<identity.inbound.auth.oauth.version>7.0.192</identity.inbound.auth.oauth.version>
<identity.inbound.auth.saml.version>5.11.46</identity.inbound.auth.saml.version>
<identity.inbound.auth.openid.version>5.10.2</identity.inbound.auth.openid.version>
<identity.inbound.auth.sts.version>5.11.12</identity.inbound.auth.sts.version>
Expand All @@ -2380,7 +2380,7 @@
<identity.userstore.remote.version>5.2.5</identity.userstore.remote.version>

<!-- Identity Data Publisher Versions -->
<identity.data.publisher.authentication.version>5.7.3</identity.data.publisher.authentication.version>
<identity.data.publisher.authentication.version>5.7.4</identity.data.publisher.authentication.version>
<identity.data.publisher.oauth.version>1.7.4</identity.data.publisher.oauth.version>
<identity.data.publisher.audit.version>1.4.6</identity.data.publisher.audit.version>

Expand Down Expand Up @@ -2412,7 +2412,7 @@
<provisioning.connector.google.version>5.2.5</provisioning.connector.google.version>
<provisioning.connector.salesforce.version>5.2.9</provisioning.connector.salesforce.version>
<provisioning.connector.scim.version>5.3.5</provisioning.connector.scim.version>
<provisioning.connector.scim2.version>2.0.6</provisioning.connector.scim2.version>
<provisioning.connector.scim2.version>2.0.7</provisioning.connector.scim2.version>

<!-- Local Authenticator Versions -->
<identity.local.auth.basicauth.version>6.8.17</identity.local.auth.basicauth.version>
Expand Down Expand Up @@ -2444,7 +2444,7 @@
<authenticator.auth.otp.commons.version>1.0.7</authenticator.auth.otp.commons.version>

<identity.org.mgt.version>1.4.55</identity.org.mgt.version>
<identity.org.mgt.core.version>1.1.18</identity.org.mgt.core.version>
<identity.org.mgt.core.version>1.1.19</identity.org.mgt.core.version>
<identity.organization.login.version>1.1.41</identity.organization.login.version>
<identity.oauth2.grant.organizationswitch.version>1.1.27</identity.oauth2.grant.organizationswitch.version>

Expand All @@ -2456,7 +2456,7 @@

<!-- Identity REST API feature -->
<identity.api.dispatcher.version>2.0.17</identity.api.dispatcher.version>
<identity.server.api.version>1.2.254</identity.server.api.version>
<identity.server.api.version>1.2.255</identity.server.api.version>
<identity.user.api.version>1.3.45</identity.user.api.version>

<identity.agent.sso.version>5.5.9</identity.agent.sso.version>
Expand All @@ -2466,9 +2466,9 @@
<conditional.authentication.functions.version>1.2.67</conditional.authentication.functions.version>

<!-- Identity Portal Versions -->
<identity.apps.console.version>2.35.13</identity.apps.console.version>
<identity.apps.myaccount.version>2.13.19</identity.apps.myaccount.version>
<identity.apps.core.version>2.8.2</identity.apps.core.version>
<identity.apps.console.version>2.35.14</identity.apps.console.version>
<identity.apps.myaccount.version>2.13.20</identity.apps.myaccount.version>
<identity.apps.core.version>2.8.3</identity.apps.core.version>
<identity.apps.tests.version>1.6.378</identity.apps.tests.version>

<!-- Charon -->
Expand Down

0 comments on commit e3135dd

Please sign in to comment.