Skip to content

Commit

Permalink
Merge pull request #89 from WebFuzzing/ocvn-add-user
Browse files Browse the repository at this point in the history
Adding a new user to ocvn.
  • Loading branch information
arcuri82 authored Nov 5, 2024
2 parents 2d288c2 + 04f3117 commit c06a11b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ public void resetStateOfSUT() {

@Override
public List<AuthenticationDto> getInfoForAuthentication() {
return Arrays.asList(AuthUtils.getForDefaultSpringFormLogin("ADMIN", "admin", "admin"));

return Arrays.asList(
AuthUtils.getForDefaultSpringFormLogin("ADMIN", "admin", "admin"),
AuthUtils.getForDefaultSpringFormLogin("user1", "user1", "password"));
}


Expand Down
30 changes: 30 additions & 0 deletions jdk_8_maven/em/embedded/rest/ocvn/src/main/resources/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,37 @@ VALUES
'admin',
NULL
);
-- Adding a new user called user1 with password "password". User details are stored in the database.
INSERT INTO PERSON
(
CHANGE_PASSWORD,
COUNTRY,
EMAIL,
ENABLED,
FIRST_NAME,
LAST_NAME,
PASSWORD,
TITLE,
USERNAME,
GROUP_ID
)
VALUES
(
false,
NULL,
NULL,
true,
NULL,
NULL,
'b65d4278fb536a6e1ea23c87988f5d79ef743ccb07b2067ad8ebd52f1a0c067e5bc3b7f76eca3abc',
NULL,
'user1',
NULL
);

INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,2);
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,1);
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,3);

-- user1 has user privilege only
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(2,1);
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ public SutInfoDto.OutputFormat getPreferredOutputFormat() {

@Override
public List<AuthenticationDto> getInfoForAuthentication() {
return Arrays.asList(AuthUtils.getForDefaultSpringFormLogin("ADMIN", "admin", "admin"));

return Arrays.asList(
AuthUtils.getForDefaultSpringFormLogin("ADMIN", "admin", "admin"),
AuthUtils.getForDefaultSpringFormLogin("user1", "user1", "password"));
}


Expand Down
52 changes: 41 additions & 11 deletions jdk_8_maven/em/external/rest/ocvn/src/main/resources/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,48 @@ INSERT INTO PERSON
)
VALUES
(
false,
NULL,
NULL,
true,
NULL,
NULL,
'61f3d99fb8ddfa54b714e84a0238e575930fda10e09dbd030b92edf1cf77c4d947e506e26ae9bf33',
NULL,
'admin',
NULL
);
false,
NULL,
NULL,
true,
NULL,
NULL,
'61f3d99fb8ddfa54b714e84a0238e575930fda10e09dbd030b92edf1cf77c4d947e506e26ae9bf33',
NULL,
'admin',
NULL
);
-- Adding a new user called user1 with password "password". User details are stored in the database.
INSERT INTO PERSON
(
CHANGE_PASSWORD,
COUNTRY,
EMAIL,
ENABLED,
FIRST_NAME,
LAST_NAME,
PASSWORD,
TITLE,
USERNAME,
GROUP_ID
)
VALUES
(
false,
NULL,
NULL,
true,
NULL,
NULL,
'b65d4278fb536a6e1ea23c87988f5d79ef743ccb07b2067ad8ebd52f1a0c067e5bc3b7f76eca3abc',
NULL,
'user1',
NULL
);

INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,2);
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,1);
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(1,3);

-- user1 has user privilege only
INSERT INTO PERSON_ROLES(PERSON_ID,ROLES_ID)VALUES(2,1);

0 comments on commit c06a11b

Please sign in to comment.