Skip to content

Commit 52a898e

Browse files
Modify fakeportal so that it can talk to spring too
1 parent b61d50c commit 52a898e

File tree

8 files changed

+15
-8
lines changed

8 files changed

+15
-8
lines changed

selenium/bin/components/fakeportal

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ init_fakeportal() {
3232
print "> CLIENT_ID: ${CLIENT_ID}"
3333
print "> CLIENT_SECRET: ${CLIENT_SECRET}"
3434
print "> RABBITMQ_URL: ${RABBITMQ_URL}"
35+
print "> IDP_TOKEN_ENDPOINT: ${IDP_TOKEN_ENDPOINT}"
36+
print "> IDP: ${IDP}"
3537
}
3638
start_fakeportal() {
3739
begin "Starting fakeportal ..."
@@ -48,11 +50,11 @@ start_fakeportal() {
4850
--env PORT=3000 \
4951
--env RABBITMQ_URL="${RABBITMQ_URL_FOR_FAKEPORTAL}" \
5052
--env PROXIED_RABBITMQ_URL="${RABBITMQ_URL}" \
51-
--env UAA_URL="${UAA_URL_FOR_FAKEPORTAL}" \
53+
--env IDP_TOKEN_ENDPOINT="${IDP_TOKEN_ENDPOINT}" \
5254
--env CLIENT_ID="${CLIENT_ID}" \
5355
--env CLIENT_SECRET="${CLIENT_SECRET}" \
54-
--env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_uaa_certificate.pem \
55-
-v ${TEST_CONFIG_DIR}/uaa:/etc/uaa \
56+
--env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_${IDP}_certificate.pem \
57+
-v ${TEST_CONFIG_DIR}/${IDP}:/etc/${IDP} \
5658
-v ${FAKEPORTAL_DIR}:/code/fakeportal \
5759
mocha-test:${mocha_test_tag} run fakeportal
5860

selenium/fakeportal/app.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ app.get('/favicon.ico', (req, res) => res.status(204));
2828

2929

3030
app.listen(port);
31-
console.log('Express started on port ' + port);
31+
console.log('Express started on port ' + port + " using ")
32+
console.log(" - idp_token_endpoint: " + idp_token_endpoint)
33+
console.log(" - rabbitmq_url: " + rabbitmq_url)
34+
console.log(" - proxied_rabbitmq_url: " + proxied_rabbitmq_url)
3235

3336
function default_if_blank(value, defaultValue) {
3437
if (typeof value === "undefined" || value === null || value == "") {
@@ -40,14 +43,14 @@ function default_if_blank(value, defaultValue) {
4043

4144
function access_token(id, secret) {
4245
const req = new XMLHttpRequest();
43-
const url = idp_token_endpoint; // uaa_url + '/oauth/token';
46+
const url = idp_token_endpoint
4447
const params = 'client_id=' + id +
4548
'&client_secret=' + secret +
4649
'&grant_type=client_credentials' +
4750
'&token_format=jwt' +
4851
'&response_type=token';
4952

50-
console.debug("Sending " + url + " with params "+ params);
53+
console.debug("Sending " + url + " with params " + params);
5154

5255
req.open('POST', url, false);
5356
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

selenium/test/oauth/env.docker.uaa

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export UAA_URL=https://uaa:8443
2-
export IDP_TOKEN_ENDPOINT=$UAA_URL/oauth/token
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export IDP_TOKEN_ENDPOINT=https://uaa:8443/oauth/token
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export IDP_TOKEN_ENDPOINT=https://uaa:8443/oauth/token

selenium/test/oauth/env.local.uaa

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export UAA_URL=https://localhost:8443
2-
export IDP_TOKEN_ENDPOINT=$UAA_URL/oauth/token

selenium/test/oauth/env.spring

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export OAUTH_SERVER_CONFIG_DIR=${OAUTH_SERVER_CONFIG_BASEDIR}/oauth/spring
22
export OAUTH_SCOPES="openid profile"
33
export OAUTH_CLIENT_ID=rabbitmq_client_code
4+
export IDP=spring

selenium/test/oauth/env.uaa

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export OAUTH_SERVER_CONFIG_DIR=${OAUTH_SERVER_CONFIG_BASEDIR}/oauth/uaa
33
export OAUTH_CLIENT_SECRET=rabbitmq_client_code
44
export OAUTH_CLIENT_ID=rabbitmq_client_code
55
export OAUTH_SCOPES="openid profile rabbitmq.*"
6+
export IDP=uaa

0 commit comments

Comments
 (0)