Skip to content

Commit 1da4aad

Browse files
committed
Merge remote-tracking branch 'upstream/master' into frontend-ng
2 parents a75d94d + 317ab0e commit 1da4aad

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

roadrecon/roadtools/roadrecon/plugins/policies.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,20 @@ def _parse_appcrit(self, crit):
222222
ot += ', '.join([escape(action) for action in clist])
223223
else:
224224
if 'All' in clist:
225-
ot += 'All applications'
225+
ot += 'All resources'
226226
break
227227
if 'None' in clist:
228228
ot += 'None'
229229
break
230230
if 'Office365' in clist:
231-
ot += 'All Office 365 applications'
231+
ot += 'All Office 365 applications '
232+
if 'MicrosoftAdminPortals' in clist:
233+
ot += 'All Microsoft Admin Portals '
232234
objects = self._get_application(clist)
233235
if objects is not None:
234236
if len(objects) > 0:
235237
if ctype == 'Applications':
236-
ot += 'Applications: '
238+
ot += 'Resources: '
237239
ot += ', '.join([escape(uobj.displayName) for uobj in objects])
238240
return ot
239241

@@ -510,9 +512,9 @@ def main(self, should_print=False):
510512
print(policy.objectId)
511513
detail = json.loads(policy.policyDetail[0])
512514
if detail['State'] == 'Reporting':
513-
out['name'] += ' (<strong>Report only</strong>)'
515+
out['name'] += ' (<i>Report only</i>)'
514516
elif detail['State'] != 'Enabled':
515-
out['name'] += ' (<strong>Disabled</strong>)'
517+
out['name'] += ' (<i>Disabled</i>)'
516518
if should_print:
517519
pp.pprint(detail)
518520
try:
@@ -524,6 +526,7 @@ def main(self, should_print=False):
524526
print('Invalid policy - no conditions')
525527
continue
526528
out['who'] = self._parse_who(conditions)
529+
out['status'] = escape(detail['State'])
527530
out['applications'] = self._parse_application(conditions)
528531
out['authflows'] = self._parse_authflows(conditions)
529532
out['platforms'] = self._parse_platform(conditions)
@@ -601,7 +604,9 @@ def main(self, should_print=False):
601604
for out in ol:
602605
table = '<thead><tr><td colspan="2">{0}</td></tr></thead><tbody>'.format(out['name'])
603606
table += '<tr><td>Applies to</td><td>{0}</td></tr>'.format(out['who'])
604-
table += '<tr><td>Applications</td><td>{0}</td></tr>'.format(out['applications'])
607+
if out['status'] != 'Enabled':
608+
table += '<tr><td>Policy state</td><td>{0}</td></tr>'.format(out['status'])
609+
table += '<tr><td>Resources</td><td>{0}</td></tr>'.format(out['applications'])
605610
if out['platforms'] != '':
606611
table += '<tr><td>On platforms</td><td>{0}</td></tr>'.format(out['platforms'])
607612
if out['devices'] != '':

roadtx/roadtools/roadtx/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ def main():
221221
appauth_parser.add_argument('--cert-pfx', action='store', metavar='file', help='Application cert and key as PFX file')
222222
appauth_parser.add_argument('--pfx-pass', action='store', metavar='password', help='PFX file password')
223223
appauth_parser.add_argument('--pfx-base64', action='store', metavar='BASE64', help='PFX file as base64 string')
224+
appauth_parser.add_argument('--assertion', action='store', metavar='JWT', help='Signed JWT assertion for cert based auth')
224225
appauth_parser.add_argument('--cae',
225226
action='store_true',
226227
help='Request Continuous Access Evaluation tokens (requires use of scope parameter instead of resource)')
@@ -802,6 +803,11 @@ def main():
802803
auth.authenticate_as_app_native_v2(client_secret=args.password)
803804
else:
804805
auth.authenticate_as_app_native(client_secret=args.password)
806+
elif args.assertion:
807+
if args.scope:
808+
auth.authenticate_as_app_native_v2(assertion=args.assertion)
809+
else:
810+
auth.authenticate_as_app_native(assertion=args.assertion)
805811
else:
806812
if not auth.loadappcert(args.cert_pem, args.key_pem, args.cert_pfx, args.pfx_pass, args.pfx_base64):
807813
return

0 commit comments

Comments
 (0)