@@ -280,7 +280,7 @@ keyrock:
280
280
- mysql-db
281
281
- authzforce
282
282
ports :
283
- - " 3005:3005"
283
+ - ' 3005:3005'
284
284
environment :
285
285
- DEBUG=idm:*
286
286
- DATABASE_HOST=mysql-db
@@ -328,9 +328,9 @@ orion-proxy:
328
328
- keyrock
329
329
- authzforce
330
330
ports:
331
- - " 1027:1027"
331
+ - ' 1027:1027'
332
332
expose:
333
- - " 1027"
333
+ - ' 1027'
334
334
environment:
335
335
- PEP_PROXY_APP_HOST=orion
336
336
- PEP_PROXY_APP_PORT=1026
@@ -378,7 +378,7 @@ authzforce:
378
378
default:
379
379
ipv4_address: 172.18.1.12
380
380
ports:
381
- - " 8080:8080"
381
+ - ' 8080:8080'
382
382
volumes:
383
383
- ./authzforce/domains:/opt/authzforce-ce-server/data/domains
384
384
` ` `
@@ -397,23 +397,23 @@ tutorial:
397
397
default:
398
398
ipv4_address: 172.18.1.7
399
399
expose:
400
- - " 3000"
401
- - " 3001"
400
+ - ' 3000'
401
+ - ' 3001'
402
402
ports:
403
- - " 3000:3000"
404
- - " 3001:3001"
403
+ - ' 3000:3000'
404
+ - ' 3001:3001'
405
405
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'
417
417
` ` `
418
418
419
419
The `tutorial` container is listening on two ports :
@@ -1040,7 +1040,7 @@ whether to continue can be made thereafter.
1040
1040
` ` ` javascript
1041
1041
function authorizeAdvancedXACML(req, res, next, resource = req.url) {
1042
1042
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' ;
1044
1044
1045
1045
return oa
1046
1046
.get(keyrockUserUrl)
@@ -1049,7 +1049,7 @@ function authorizeAdvancedXACML(req, res, next, resource = req.url) {
1049
1049
return azf.policyDomainRequest(user.app_azf_domain, user.roles, resource, req.method);
1050
1050
})
1051
1051
.then((authzforceResponse) => {
1052
- res.locals.authorized = authzforceResponse === " Permit" ;
1052
+ res.locals.authorized = authzforceResponse === ' Permit' ;
1053
1053
return next();
1054
1054
})
1055
1055
.catch((error) => {
@@ -1066,20 +1066,20 @@ information to supply will depend on business use case - it could be expanded to
1066
1066
relationships between records and so on, but in this very simple example only roles are necessary.
1067
1067
1068
1068
` ` ` javascript
1069
- const xml2js = require(" xml2js" );
1070
- const request = require(" request" );
1069
+ const xml2js = require(' xml2js' );
1070
+ const request = require(' request' );
1071
1071
1072
1072
function policyDomainRequest(domain, roles, resource, action) {
1073
1073
let body =
1074
1074
'<?xml version="1.0" encoding="UTF-8"?>\n ' +
1075
1075
'<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false">\n ';
1076
1076
// Code to create the XML body for the request is omitted
1077
- body = body + " </Request>" ;
1077
+ body = body + ' </Request>' ;
1078
1078
1079
1079
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' },
1083
1083
body
1084
1084
};
1085
1085
0 commit comments