@@ -280,7 +280,7 @@ keyrock:
280280 - mysql-db
281281 - authzforce
282282 ports :
283- - " 3005:3005"
283+ - ' 3005:3005'
284284 environment :
285285 - DEBUG=idm:*
286286 - DATABASE_HOST=mysql-db
@@ -328,9 +328,9 @@ orion-proxy:
328328 - keyrock
329329 - authzforce
330330 ports:
331- - " 1027:1027"
331+ - ' 1027:1027'
332332 expose:
333- - " 1027"
333+ - ' 1027'
334334 environment:
335335 - PEP_PROXY_APP_HOST=orion
336336 - PEP_PROXY_APP_PORT=1026
@@ -378,7 +378,7 @@ authzforce:
378378 default:
379379 ipv4_address: 172.18.1.12
380380 ports:
381- - " 8080:8080"
381+ - ' 8080:8080'
382382 volumes:
383383 - ./authzforce/domains:/opt/authzforce-ce-server/data/domains
384384` ` `
@@ -397,23 +397,23 @@ tutorial:
397397 default:
398398 ipv4_address: 172.18.1.7
399399 expose:
400- - " 3000"
401- - " 3001"
400+ - ' 3000'
401+ - ' 3001'
402402 ports:
403- - " 3000:3000"
404- - " 3001:3001"
403+ - ' 3000:3000'
404+ - ' 3001:3001'
405405 environment:
406- - " DEBUG=tutorial:*"
407- - " WEB_APP_PORT=3000"
408- - " KEYROCK_URL=http://localhost"
409- - " KEYROCK_IP_ADDRESS=http://172.18.1.5"
410- - " KEYROCK_PORT=3005"
411- - " KEYROCK_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp"
412- - " KEYROCK_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret"
413- - " CALLBACK_URL=http://localhost:3000/login"
414- - " AUTHZFORCE_ENABLED=true"
415- - " AUTHZFORCE_URL=http://authzforce"
416- - " AUTHZFORCE_PORT=8080"
406+ - ' DEBUG=tutorial:*'
407+ - ' WEB_APP_PORT=3000'
408+ - ' KEYROCK_URL=http://localhost'
409+ - ' KEYROCK_IP_ADDRESS=http://172.18.1.5'
410+ - ' KEYROCK_PORT=3005'
411+ - ' KEYROCK_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp'
412+ - ' KEYROCK_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret'
413+ - ' CALLBACK_URL=http://localhost:3000/login'
414+ - ' AUTHZFORCE_ENABLED=true'
415+ - ' AUTHZFORCE_URL=http://authzforce'
416+ - ' AUTHZFORCE_PORT=8080'
417417` ` `
418418
419419The `tutorial` container is listening on two ports :
@@ -1040,7 +1040,7 @@ whether to continue can be made thereafter.
10401040` ` ` javascript
10411041function authorizeAdvancedXACML(req, res, next, resource = req.url) {
10421042 const keyrockUserUrl =
1043- " http://keyrock/user?access_token=" + req.session.access_token + " &app_id=" + clientId + " &authzforce=true" ;
1043+ ' http://keyrock/user?access_token=' + req.session.access_token + ' &app_id=' + clientId + ' &authzforce=true' ;
10441044
10451045 return oa
10461046 .get(keyrockUserUrl)
@@ -1049,7 +1049,7 @@ function authorizeAdvancedXACML(req, res, next, resource = req.url) {
10491049 return azf.policyDomainRequest(user.app_azf_domain, user.roles, resource, req.method);
10501050 })
10511051 .then((authzforceResponse) => {
1052- res.locals.authorized = authzforceResponse === " Permit" ;
1052+ res.locals.authorized = authzforceResponse === ' Permit' ;
10531053 return next();
10541054 })
10551055 .catch((error) => {
@@ -1066,20 +1066,20 @@ information to supply will depend on business use case - it could be expanded to
10661066relationships between records and so on, but in this very simple example only roles are necessary.
10671067
10681068` ` ` javascript
1069- const xml2js = require(" xml2js" );
1070- const request = require(" request" );
1069+ const xml2js = require(' xml2js' );
1070+ const request = require(' request' );
10711071
10721072function policyDomainRequest(domain, roles, resource, action) {
10731073 let body =
10741074 '<?xml version="1.0" encoding="UTF-8"?>\n ' +
10751075 '<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">\n ';
10761076 // Code to create the XML body for the request is omitted
1077- body = body + " </Request>" ;
1077+ body = body + ' </Request>' ;
10781078
10791079 const options = {
1080- method: " POST" ,
1081- url: " http://authzforceUrl/authzforce-ce/domains/" + domain + " /pdp" ,
1082- headers: { " Content-Type": " application/xml" },
1080+ method: ' POST' ,
1081+ url: ' http://authzforceUrl/authzforce-ce/domains/' + domain + ' /pdp' ,
1082+ headers: { ' Content-Type': ' application/xml' },
10831083 body
10841084 };
10851085
0 commit comments