There is a security vulnerability in SSH key-generation using GitKraken < v8.0.1. If you used this tool to create SSH keys, please update GitKraken and regenerate. If you need help with this, contact forum-support@opengroup.org

Commit 6a08eca9 authored by Daniel Scholl's avatar Daniel Scholl
Browse files

Merge branch 'master' into 'fix-context-path-entitlement'

# Conflicts:
#   devops/development-pipeline.yml
parents d828676b 4173a41b
Pipeline #3445 passed with stages
in 45 minutes and 54 seconds
......@@ -170,6 +170,8 @@ The following table lists the properties that are required when you create a use
##### Response
If successful, this method returns 201 response code and user object in the response body.
If the user profile already exists, this method returns a 409 response code and an error message in the response body.
##### Example: Create a user
##### Request
......
......@@ -381,15 +381,6 @@ public class EntitlementsApiTests {
assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus());
}
@Test
public void givenValidIntegrationTesterAndUserInfoExists_whenCallCreateProfile_thenBadRequest() throws Exception {
String path = "profile";
String json = TestUserInfoData.getJsonFromTestFile("test_userinfo_OneTenantItem");
ClientResponse response = TestUtils.send(path, "POST",
TestUtils.getHeaders(), json, "");
assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus());
}
@Test
public void givenAnonymous_whenCallDeleteProfile_thenForbidden() throws Exception {
String path = "profile/" + TEST_REGULAR_USER_ID;
......@@ -538,7 +529,7 @@ public class EntitlementsApiTests {
}
@Test
public void givenValidIntegrationTesterAndServicePrincipalExists_whenCallCreateProfile_thenBadRequest() throws Exception {
public void givenValidIntegrationTesterAndServicePrincipalExists_whenCallCreateProfile_thenConflict() throws Exception {
String path = "profile";
if (isSetupEnabled()) {
setUp(TEST_SP_ID, TestType.DELETE);
......@@ -548,7 +539,7 @@ public class EntitlementsApiTests {
ClientResponse response = TestUtils.send(path, "POST",
TestUtils.getHeaders(), json, "");
assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatus());
assertEquals(HttpStatus.SC_CONFLICT, response.getStatus());
if (isTeardownEnabled()) {
tearDown(TEST_SP_ID, TestType.DELETE);
......
......@@ -51,6 +51,7 @@ public class EntitlementsAzure
private static final String SC_BAD_REQUEST_REASON = "bad request";
private static final String SC_NOT_FOUND_REASON = "not found";
private static final String SC_FORBIDDEN_REASON = "forbidden";
private static final String SC_CONFLICT_REASON = "resource already existed";
protected enum UserType {
REGULAR_USER,
......@@ -316,7 +317,7 @@ public class EntitlementsAzure
userInfoRepository.create(userInfoDoc);
return userInfoDoc;
} else
throw new AppException(HttpStatus.SC_BAD_REQUEST, SC_BAD_REQUEST_REASON, String.format("user profile already exists for '%s'",userInfoDoc.getUid()));
throw new AppException(HttpStatus.SC_CONFLICT, SC_CONFLICT_REASON, String.format("user profile already exists for '%s'",userInfoDoc.getUid()));
}
/**
......
......@@ -206,7 +206,7 @@ public class EntitlementsAzureTests {
}
@Test
public void givenServicePrincipalInJwtAndProfileExists_whenCreateProfile_thenBadRequest() {
public void givenServicePrincipalInJwtAndProfileExists_whenCreateProfile_thenConflict() {
setField(sut, TestUtils.SERVICE_DOMAIN_NAME, TestUtils.getDomain());
//serviceprincipal in JWT
createAADUserPrincipalSetSecurityContext(TestUtils.APPID, TestUtils.getAppId(), TestUtils.OID, TestUtils.getOid());
......@@ -222,7 +222,7 @@ public class EntitlementsAzureTests {
sut.createUserInfo(userInfoDoc);
} catch (AppException ae)
{
assertEquals(HttpStatus.SC_BAD_REQUEST, ae.getError().getCode());
assertEquals(HttpStatus.SC_CONFLICT, ae.getError().getCode());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment