Skip to content

Commit

Permalink
Fixed typo in the rest modules. #1139
Browse files Browse the repository at this point in the history
  • Loading branch information
zigfridus committed Jan 2, 2024
1 parent 5ad7b40 commit 95bde06
Show file tree
Hide file tree
Showing 25 changed files with 133 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void calling_with_api_X_0_and_valid_userid_and_email_returns_HTTP_400_BAD
this.mockMvc.perform(
post(https(PORT_USED).buildUserSignUpUrl()).
contentType(MediaType.APPLICATION_JSON_VALUE).
content("{\"apiVersion\":\"X.0\",\"userId\":\"\",\"emailAdress\":\"test@test.com\"}")
content("{\"apiVersion\":\"X.0\",\"userId\":\"\",\"emailAddress\":\"test@test.com\"}")
).
andExpect(status().isBadRequest()
);
Expand Down
86 changes: 43 additions & 43 deletions sechub-api-java/src/main/resources/reduced-openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2029,7 +2029,7 @@
{
"name": "userId",
"in": "path",
"description": "The userId of the user whose email adress will be changed",
"description": "The userId of the user whose email address will be changed",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -2883,6 +2883,38 @@
}
}
},
"UserDetails": {
"title": "UserDetails",
"type": "object",
"properties": {
"projects": {
"type": "array",
"description": "The projects the user has access to",
"items": {
"type": "string"
}
},
"superAdmin": {
"type": "boolean",
"description": "True, when this user is a super administrator"
},
"userId": {
"type": "string",
"description": "The name of the user"
},
"email": {
"type": "string",
"description": "The mail address of the user"
},
"ownedProjects": {
"type": "array",
"description": "The projects the user is owner of",
"items": {
"type": "string"
}
}
}
},
"api-admin-project-projectId-104816866": {
"type": "object"
},
Expand Down Expand Up @@ -3104,38 +3136,6 @@
"title": "FullScanDataZIP",
"type": "object"
},
"UserDetails": {
"title": "UserDetails",
"type": "object",
"properties": {
"projects": {
"type": "array",
"description": "The projects the user has access to",
"items": {
"type": "string"
}
},
"superAdmin": {
"type": "boolean",
"description": "True, when this user is a super administrator"
},
"userId": {
"type": "string",
"description": "The name of the user"
},
"email": {
"type": "string",
"description": "The mail adress of the user"
},
"ownedProjects": {
"type": "array",
"description": "The projects the user is owner of",
"items": {
"type": "string"
}
}
}
},
"ServerVersion": {
"title": "ServerVersion",
"type": "object"
Expand Down Expand Up @@ -3438,16 +3438,6 @@
}
}
},
"JobId": {
"title": "JobId",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"description": "A unique job id"
}
}
},
"ExecutionProfileCreate": {
"title": "ExecutionProfileCreate",
"type": "object",
Expand Down Expand Up @@ -3498,6 +3488,16 @@
}
}
},
"JobId": {
"title": "JobId",
"type": "object",
"properties": {
"jobId": {
"type": "string",
"description": "A unique job id"
}
}
},
"JobStatus": {
"title": "JobStatus",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public String revokeAddminRightsFrom(String targetUser) {

public String createNewUserSignup(String name, String email) {

String json = "{\"apiVersion\":\"1.0\",\r\n" + " \"userId\":\"" + name + "\",\r\n" + " \"emailAdress\":\"" + email + "\"}";
String json = "{\"apiVersion\":\"1.0\",\r\n" + " \"userId\":\"" + name + "\",\r\n" + " \"emailAddress\":\"" + email + "\"}";
return getRestHelper().postJson(getUrlBuilder().buildUserSignUpUrl(), json);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public FetchMockMailsAction(UIContext context) {

@Override
protected void executeImplAfterRestHelperSwitched(ActionEvent e) {
Optional<String> emailAdress = getUserInput("Please enter userid to fetch mock mails", InputCacheIdentifier.EMAILADRESS);
if (!emailAdress.isPresent()) {
Optional<String> emailAddress = getUserInput("Please enter userid to fetch mock mails", InputCacheIdentifier.EMAILADDRESS);
if (!emailAddress.isPresent()) {
return;
}
List<MockEmailEntry> data = IntegrationTestContext.get().emailAccess().getMockMailListFor(emailAdress.get());
List<MockEmailEntry> data = IntegrationTestContext.get().emailAccess().getMockMailListFor(emailAddress.get());
for (MockEmailEntry entry : data) {
outputAsTextOnSuccess(entry.fullToString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ private List<String> loadSignupUserIds() {
while (iditerator.hasNext()) {
JsonNode dNode = iditerator.next();
String userId = dNode.get("userId").asText();
String emailAdress = dNode.get("emailAdress").asText();
ids.add(userId + " <" + emailAdress + ">");
String emailAddress = dNode.get("emailAddress").asText();
ids.add(userId + " <" + emailAddress + ">");
}
outputAsTextOnSuccess("Found " + ids.size() + " watting signups.");
outputAsTextOnSuccess("Found " + ids.size() + " waiting signups.");
return ids;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public AnonymousRequestNewAPITokenUserAction(UIContext context) {

@Override
public void execute(ActionEvent e) {
Optional<String> email = getUserInput("Email of user requesting new API token", InputCacheIdentifier.EMAILADRESS);
Optional<String> email = getUserInput("Email of user requesting new API token", InputCacheIdentifier.EMAILADDRESS);
if (!email.isPresent()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void execute(ActionEvent e) {
return;
}

Optional<String> email = getUserInput("Give Email of new user", InputCacheIdentifier.EMAILADRESS);
Optional<String> email = getUserInput("Give Email of new user", InputCacheIdentifier.EMAILADDRESS);
if (!email.isPresent()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public ShowUserDetailForEmailAddressAction(UIContext context) {

@Override
public void execute(ActionEvent e) {
Optional<String> emailAddress = getUserInput("Please enter email address", InputCacheIdentifier.EMAILADRESS);
Optional<String> emailAddress = getUserInput("Please enter email address", InputCacheIdentifier.EMAILADDRESS);
if (!emailAddress.isPresent()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private void createDefaults() {
set(InputCacheIdentifier.PDS_SECHUB_JOBUUID, UUID.randomUUID().toString());
set(InputCacheIdentifier.PDS_PRODUCT_ID, "PDS_INTTEST_PRODUCT_CODESCAN");

set(InputCacheIdentifier.EMAILADRESS, "sechub@example.org");
set(InputCacheIdentifier.EMAILADDRESS, "sechub@example.org");
set(InputCacheIdentifier.PROJECT_MOCK_CONFIG_JSON,
"{ \n" + " \"apiVersion\" : \"1.0\",\n" + "\n" + " \"codeScan\" : {\n" + " \"result\" : \"yellow\" \n" + " },\n"
+ " \"webScan\" : {\n" + " \"result\" : \"green\" \n" + " },\n" + " \"infraScan\" : {\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public enum InputCacheIdentifier {

USERNAME,

EMAILADRESS,
EMAILADDRESS,

WHITELIST_URI,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
[[sechub-doclink-uc-user-requests-new-apittoken]]
It shall be possible to achieve this by calling REST API and also by just visiting
static sechub website and entering mail adress and post request by simple web form.
static sechub website and entering email address and post request by simple web form.

When user exists a new one time token will be created and sent to user per email - so same way as done when a new
user signup is accepted by admin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please make sure that the SQL statements work with both of them.
* We are using PostgreSQL which does automatically use lower_case names
* Numbering starts at `01`; maximum is `99`
* Naming scheme for constraints: `c<number>_<table name>_<constraint title>` +
Example: `c01_adm_user_emailadress`
Example: `c01_adm_user_emailaddress`
* Naming scheme for indices: `i<number>_<table name>_<index title>` +
Example: `i01_statistic_job_run_data_filter`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void calling_with_api_1_0_and_valid_userid_and_email_returns_HTTP_200() t
/* execute */
/* @formatter:off */
this.mockMvc.perform(
post(apiEndpoint,"emailAdress@test.com").
post(apiEndpoint,"emailAddress@test.com").
contentType(MediaType.APPLICATION_JSON_VALUE)
).
andExpect(status().isOk()).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void restdoc_admin_updates_user_email_address() throws Exception {

),
pathParameters(
parameterWithName(USER_ID.paramName()).description("The userId of the user whose email adress will be changed"),
parameterWithName(USER_ID.paramName()).description("The userId of the user whose email address will be changed"),
parameterWithName(EMAIL_ADDRESS.paramName()).description("The new email address")

)
Expand Down Expand Up @@ -368,7 +368,7 @@ public void restdoc_show_user_details() throws Exception {
),
responseFields(
fieldWithPath(UserDetailInformation.PROPERTY_USERNAME).description("The name of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_EMAIL).description("The mail adress of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_EMAIL).description("The mail address of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_SUPERADMIN).description("True, when this user is a super administrator"),
fieldWithPath(UserDetailInformation.PROPERTY_PROJECTS).description("The projects the user has access to"),
fieldWithPath(UserDetailInformation.PROPERTY_OWNED_PROJECTS).description("The projects the user is owner of")
Expand Down Expand Up @@ -424,7 +424,7 @@ public void restdoc_show_user_details_for_email_address() throws Exception {
),
responseFields(
fieldWithPath(UserDetailInformation.PROPERTY_USERNAME).description("The name of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_EMAIL).description("The mail adress of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_EMAIL).description("The mail address of the user"),
fieldWithPath(UserDetailInformation.PROPERTY_SUPERADMIN).description("True, when this user is a super administrator"),
fieldWithPath(UserDetailInformation.PROPERTY_PROJECTS).description("The projects the user has access to"),
fieldWithPath(UserDetailInformation.PROPERTY_OWNED_PROJECTS).description("The projects the user is owner of")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void signupNewUser() throws SecHubClientException {

UserSignup signUp = new UserSignup();
signUp.setApiVersion("1.0");
signUp.setEmailAdress(userName + "@example.com");
signUp.setEmailAddress(userName + "@example.com");
signUp.setUserId(userName);
client.createSignup(signUp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void superadmin_can_fetch_user_list_and_list_contains_user1_and_user2() {
}

@Test
public void superadmin_can_change_user_email_adress_of_user2() {
public void superadmin_can_change_user_email_address_of_user2() {
/* prepare */
TestUserDetailInformation details = as(SUPER_ADMIN).fetchUserDetails(USER_2);
String formerEmailAddress = details.getEmail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class UserRequestsNewAPITokenIntTest {
public IntegrationTestSetup setup = IntegrationTestSetup.forScenario(Scenario2.class);

@Test
public void an_anonymous_user_can_trigger_new_api_token_request_for_existing_user_email_adress_leads_to_mail_with_link_to_fetch_new_apitoken() {
public void an_anonymous_user_can_trigger_new_api_token_request_for_existing_user_email_address_leads_to_mail_with_link_to_fetch_new_apitoken() {
/* check preconditions */
String email = USER_1.getEmail();
assertTrue(email.endsWith("_user1@example.org"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public List<URI> getURIs() {
}

@Override
public List<InetAddress> getInetAdresses() {
public List<InetAddress> getInetAddresses() {
if (config == null) {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface NetworkLocationProvider {

List<URI> getURIs();

List<InetAddress> getInetAdresses();
List<InetAddress> getInetAddresses();

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public NetworkTargetInfo createInfo(NetworkTargetType targetType, UUIDTraceLogID
List<URI> uris = networkLocationProvider.getURIs();
registerURIs(traceLogId, support, registry, uris);

List<InetAddress> inetAdresses = networkLocationProvider.getInetAdresses();
List<InetAddress> inetAdresses = networkLocationProvider.getInetAddresses();
registerInetAdresses(traceLogId, support, registry, inetAdresses);

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public List<URI> getURIs() {
}

@Override
public List<InetAddress> getInetAdresses() {
public List<InetAddress> getInetAddresses() {
/*
* SecHubWebScanConfiguration configuration currently has no IPs inside, so we
* do not provide this
Expand Down
Loading

0 comments on commit 95bde06

Please sign in to comment.