|
1 | 1 | set define on |
2 | 2 | define OFFICE_EROC=&1 |
| 3 | +declare |
| 4 | + type office_list_t is table of varchar2(16); |
| 5 | + |
| 6 | + procedure add_full_admin(p_user varchar2, p_offices office_list_t) is |
| 7 | + begin |
| 8 | + for i in 1 .. p_offices.count loop |
| 9 | + cwms_sec.add_cwms_user(p_user, NULL, p_offices(i)); |
| 10 | + cwms_sec.add_user_to_group(p_user, 'All Users', p_offices(i)); |
| 11 | + cwms_sec.add_user_to_group(p_user, 'CWMS Users', p_offices(i)); |
| 12 | + cwms_sec.add_user_to_group(p_user, 'TS ID Creator', p_offices(i)); |
| 13 | + cwms_sec.add_user_to_group(p_user, 'CWMS User Admins', p_offices(i)); |
| 14 | + cwms_sec.add_user_to_group(p_user, 'CWMS PD Users', p_offices(i)); |
| 15 | + end loop; |
| 16 | + end; |
3 | 17 | begin |
4 | 18 | cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','All Users', 'HQ'); |
5 | 19 | cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','All Users', 'SPK'); |
| 20 | + cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','All Users', 'MVP'); |
| 21 | + cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','All Users', 'LRL'); |
6 | 22 | cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','CWMS Users', 'HQ'); |
7 | 23 | cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','CWMS User Admins', 'HQ'); |
8 | | - |
| 24 | + cwms_sec.add_user_to_group('&&OFFICE_EROC.webtest','CWMS PD Users', 'HQ'); |
9 | 25 |
|
10 | | - cwms_sec.add_cwms_user('l2hectest',NULL,'SPK'); |
11 | | - cwms_sec.update_edipi('l2hectest',1234567890); |
12 | | - cwms_sec.add_user_to_group('l2hectest','All Users', 'SPK'); |
13 | | - cwms_sec.add_user_to_group('l2hectest','CWMS Users', 'SPK'); |
14 | | - cwms_sec.add_user_to_group('l2hectest','TS ID Creator','SPK'); |
15 | | - cwms_sec.add_user_to_group('l2hectest','CWMS User Admins', 'SPK'); |
| 26 | + add_full_admin('l2hectest', office_list_t('SPK')); |
| 27 | + cwms_sec.update_edipi('l2hectest', 1234567890); |
16 | 28 |
|
17 | | - cwms_sec.add_cwms_user('l1hectest',NULL,'SPL'); |
| 29 | + cwms_sec.add_cwms_user('l1hectest', NULL, 'SPL'); |
18 | 30 | -- intentionally no extra permissions. |
19 | | - --cwms_sec.add_user_to_group('l2hectest','CWMS Users', 'SPL'); |
20 | 31 |
|
21 | | - cwms_sec.add_cwms_user('m5hectest',NULL,'SWT'); |
| 32 | + cwms_sec.add_cwms_user('m5hectest', NULL, 'SWT'); |
22 | 33 | cwms_sec.add_user_to_group('m5hectest','All Users', 'SWT'); |
23 | 34 | cwms_sec.add_user_to_group('m5hectest','CWMS Users', 'SWT'); |
24 | 35 | execute immediate 'grant execute on cwms_20.cwms_upass to web_user'; |
25 | 36 |
|
26 | | - |
27 | 37 | cwms_sec.add_cwms_user('m5testadmin', NULL, 'LRL'); |
28 | 38 | cwms_sec.add_user_to_group('m5testadmin','All Users', 'LRL'); |
29 | 39 | cwms_sec.add_user_to_group('m5testadmin','CWMS Users', 'LRL'); |
30 | 40 | cwms_sec.add_user_to_group('m5testadmin','CWMS User Admins', 'LRL'); |
| 41 | + cwms_sec.add_user_to_group('m5testadmin','CWMS PD Users', 'LRL'); |
| 42 | + |
| 43 | + add_full_admin('q0hectest', office_list_t('LRL', 'SPK', 'MVP')); |
31 | 44 |
|
32 | | - cwms_sec.add_cwms_user('q0hectest', NULL, 'LRL'); |
33 | | - cwms_sec.add_user_to_group('q0hectest','All Users', 'LRL'); |
34 | | - cwms_sec.add_user_to_group('q0hectest','CWMS Users', 'LRL'); |
35 | | - cwms_sec.add_user_to_group('q0hectest','TS ID Creator','LRL'); |
36 | | - cwms_sec.add_user_to_group('q0hectest','CWMS User Admins', 'LRL'); |
37 | | - |
38 | | - cwms_sec.add_cwms_user('q0hectest', NULL, 'SPK'); |
39 | | - cwms_sec.add_user_to_group('q0hectest','All Users', 'SPK'); |
40 | | - cwms_sec.add_user_to_group('q0hectest','CWMS Users', 'SPK'); |
41 | | - cwms_sec.add_user_to_group('q0hectest','TS ID Creator','SPK'); |
42 | | - cwms_sec.add_user_to_group('q0hectest','CWMS User Admins', 'SPK'); |
43 | | - |
44 | | - cwms_sec.add_cwms_user('q0hectest', NULL, 'MVP'); |
45 | | - cwms_sec.add_user_to_group('q0hectest','All Users', 'MVP'); |
46 | | - cwms_sec.add_user_to_group('q0hectest','CWMS Users', 'MVP'); |
47 | | - cwms_sec.add_user_to_group('q0hectest','TS ID Creator','MVP'); |
48 | | - cwms_sec.add_user_to_group('q0hectest','CWMS User Admins', 'MVP'); |
49 | | - |
50 | | - insert into cwms_20.at_api_keys (userid, key_name, apikey) values ('Q0HECTEST', 'testkey', '0123456789abcdef0123456789abcdef'); |
51 | | - insert into cwms_20.at_api_keys (userid, key_name, apikey) values ('L2HECTEST', 'testkey2', '1234567890abcdef1234567890abcdef'); |
| 45 | + insert into cwms_20.at_api_keys (userid, key_name, apikey, created, expires) values ('Q0HECTEST', 'testkey', 'ak1_CYflBX6c$argon2id$v=19$m=19456,t=2,p=1$8Wh8X9m+O81UvrbCJ/eOFQ$+E0Rp3jhjduIHxaqmzx+OLR43B3HdcMuDyn8cO5/69s', sysdate, sysdate + 365); |
| 46 | + -- key is ak1_CYflBX6cQOHlJkkcsA6NPvJ7npm1kynzfUsa45ncIPcGNewkcvK2ounQN8MaDj8Wkc8o0HiZvLkETpGrGkl3OvJD9Nt0vQCIPLBeqQiLGBQHsPDZmk1gEkVCzubSyfKy31bagcf0jrajn6zCcRAv1tpMpnucFCkUwCpTYwNCfCnPkqukNVpOyTv7I2II8NIxBQmQOZPc09yOrKPkQpj1sHM4NNxIcUfTZrPpidT1QGjhfVaaWW1AiqodkxXPxlTqvuRLz9bL |
| 47 | + |
| 48 | + insert into cwms_20.at_api_keys (userid, key_name, apikey, created, expires) values ('L2HECTEST', 'testkey2', 'ak1_3rF3RXlB$argon2id$v=19$m=19456,t=2,p=1$xxL2ItUkn3gC1LT5F8Wb0g$2az8A0GpJVVhbaccD4ICVWvnM2uoKzU652r9jemE9qg', sysdate, sysdate + 365); |
| 49 | + -- key is ak1_3rF3RXlBRpWiWNdBhrX5LwNnbwyPX7J9MDro8b3aoRVp2bM4FRZPsOZOoFtjVuwt9bNnniWqzIaCfTzKNUqdp43ItSk7oFLdqf05gVhM5UtaLZa2BN7KNdb7hSxYu6FQJkt8haSQK3swUaC9qlRFLIPMerbjxxIF8UnuQ7Oe54uyiN7JJaaHErI0m7qo7ir2bkxHvC0aWw9UkT9Z8RKfWeaQBIizqZnicqmXgsekLvqwkZ2jJrLUw180aFr5g7rCEsRtVtRE |
52 | 50 | -- Non-admin API key for the L1 with reduced permissions |
53 | 51 | -- Used by CDA user-management tests that verify 403 handling |
54 | | - insert into cwms_20.at_api_keys (userid, key_name, apikey) values ('L1HECTEST', 'non_admin_test_key', 'fedcba9876543210fedcba9876543210'); |
55 | | - |
| 52 | + insert into cwms_20.at_api_keys (userid, key_name, apikey, created, expires) values ('L1HECTEST', 'non_admin_test_key', 'ak1_SZUNxN3n$argon2id$v=19$m=19456,t=2,p=1$KAlZGdgEboEHvEVcpNGD0g$pPCCkQfOx8v5HNpwPadJNUHGI0I40a7HgcZ7JsTE6T0', sysdate, sysdate + 365); |
| 53 | + -- key is ak1_SZUNxN3nDx0NpUfOJxpOuGqbqRKdYjbx86x6YVISLb9DiBi3Io5o6T6UFvkHknjIRnRO6oQfA1q6rP4XRDYMH9Hlr4ndffL6NjxPUaBZLSnqukV0uGuZKOUWBB04L5SyloJniOHkFe6ymvB9tzeziGYwzrDv3k6lzacG9vftHkCHB1QbjwwCC0sDkFvuwCe9qnyx5us11qL0YAfKXhe0fBCA2TmNDz8WXfw1HfBnAKx6WD7KqHngplWu4miOvkNverxFmAdJ |
56 | 54 | end; |
57 | 55 | / |
58 | 56 | quit; |
0 commit comments