generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1013-institution_profile-language_and_error
- Loading branch information
Showing
59 changed files
with
740 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.06 MB
.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.16.4-57015b6961-8.zip
Binary file not shown.
Binary file removed
BIN
-516 KB
.yarn/cache/@tanstack-query-core-npm-4.13.4-06c6632de9-5cef6289ef.zip
Binary file not shown.
Binary file removed
BIN
-555 KB
.yarn/cache/@tanstack-query-core-npm-4.29.7-f55047b190-f28441a1fc.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-307 KB
.yarn/cache/@tanstack-react-query-npm-4.13.5-d478a3e963-0e10a0aafa.zip
Binary file not shown.
Binary file removed
BIN
-326 KB
.yarn/cache/@tanstack-react-query-npm-4.29.7-915f204251-9db2fb78e1.zip
Binary file not shown.
Binary file added
BIN
+331 KB
.yarn/cache/@tanstack-react-query-npm-4.36.1-435eddf619-1aff0a4768.zip
Binary file not shown.
Binary file renamed
BIN
+949 KB
...tem-react-https-51efcb97b6-2ef0aeb545.zip → ...tem-react-https-a633c06944-097cf362d5.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import type { GrantTypes } from '@keycloak/keycloak-admin-client/lib/utils/auth'; | ||
|
||
export interface KeycloakCLIConfig { | ||
username: string; | ||
clientId: string; | ||
clientSecret: string; | ||
grantType: GrantTypes; | ||
} | ||
|
||
export interface KeycloakAdminConfig { | ||
username: string; | ||
password: string; | ||
clientId: string; | ||
grantType: GrantTypes; | ||
} | ||
|
||
export interface KeycloakConfig { | ||
target: string; | ||
realm: string; | ||
admin: KeycloakAdminConfig; | ||
cli: KeycloakCLIConfig; | ||
} | ||
|
||
export const config: KeycloakConfig = { | ||
target: process.env.SBL_PLAYWRIGHT_TEST_KC_TARGET ?? 'http://localhost:8880/', | ||
realm: process.env.SBL_PLAYWRIGHT_TEST_KC_REALM ?? 'regtech', | ||
admin: { | ||
username: process.env.SBL_PLAYWRIGHT_TEST_KC_ADMIN_USERNAME ?? 'admin1', | ||
password: process.env.SBL_PLAYWRIGHT_TEST_KC_ADMIN_PASSWORD ?? 'admin', | ||
clientId: | ||
process.env.SBL_PLAYWRIGHT_TEST_KC_ADMIN_CLIENT_ID ?? 'regtech-client', | ||
grantType: (process.env.SBL_PLAYWRIGHT_TEST_KC_ADMIN_GRANT_TYPE ?? | ||
'password') as GrantTypes, | ||
}, | ||
cli: { | ||
username: process.env.SBL_PLAYWRIGHT_TEST_KC_CLI_USERNAME ?? 'admin', | ||
clientSecret: | ||
process.env.SBL_PLAYWRIGHT_TEST_KC_CLI_CLIENT_SECRET ?? 'local_test_only', | ||
clientId: process.env.SBL_PLAYWRIGHT_TEST_KC_CLI_CLIENT_ID ?? 'admin-cli', | ||
grantType: (process.env.SBL_PLAYWRIGHT_TEST_KC_CLI_GRANT_TYPE ?? | ||
'client_credentials') as GrantTypes, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
import axios from 'axios'; | ||
import { config } from './authConstants'; | ||
|
||
export default async function getAdminKeycloakToken(): Promise<string> { | ||
const encodedParameters = new URLSearchParams(); | ||
encodedParameters.set('username', 'admin1'); | ||
encodedParameters.set('password', 'admin'); | ||
encodedParameters.set('grant_type', 'password'); | ||
encodedParameters.set('client_id', 'regtech-client'); | ||
encodedParameters.set('username', config.admin.username); | ||
encodedParameters.set('password', config.admin.password); | ||
encodedParameters.set('grant_type', config.admin.grantType); | ||
encodedParameters.set('client_id', config.admin.clientId); | ||
|
||
const optionsForGetAdminKeycloakToken = { | ||
method: 'POST', | ||
url: 'http://localhost:8880/realms/regtech/protocol/openid-connect/token', | ||
url: `${config.target}/realms/${config.realm}/protocol/openid-connect/token`, | ||
data: encodedParameters, | ||
}; | ||
try { | ||
const { data } = await axios.request(optionsForGetAdminKeycloakToken); | ||
return data.access_token as string; | ||
} catch (error) { | ||
// eslint-disable-next-line no-console | ||
console.log('error when trying to fetch an admin token from keycloak :>> ', error); | ||
console.log( | ||
'error when trying to fetch an admin token from keycloak :>> ', | ||
error, | ||
); | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.