From 9b57b0633a8ead913cb85bf3201c477ae17f7945 Mon Sep 17 00:00:00 2001 From: Caleb Hornbeck Date: Mon, 25 Mar 2024 19:42:10 -0600 Subject: [PATCH] Revert scope promotion --- bin/oref0_nightscout_check.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/oref0_nightscout_check.py b/bin/oref0_nightscout_check.py index 9bd8ff464..6d640da4d 100755 --- a/bin/oref0_nightscout_check.py +++ b/bin/oref0_nightscout_check.py @@ -93,7 +93,6 @@ def startup_checks(args): def check_permissions(): global token_dict pg=[] - missing=[] for perm_group in token_dict['permissionGroups']: pg.extend(perm_group) @@ -101,15 +100,16 @@ def check_permissions(): if pg==["*"]: # admin role logging.warning("The use of the admin role for token based authentication is not recommended, see https://openaps.readthedocs.io/en/master/docs/walkthrough/phase-1/nightscout-setup.md#switching-from-api_secret-to-token-based-authentication-for-your-rig") else: + missing=[] for perm in ["api:treatments:read", "api:treatments:create", "api:treatments:read", "api:treatments:create", "api:devicestatus:read", "api:devicestatus:create"]: logging.debug("Checking %s" % perm) if perm not in pg: missing.append(perm) - if len(missing)>0: - logging.error("The following permissions are missing in Nightscout: %s" % missing) - logging.error("Please follow instructions at https://openaps.readthedocs.io/en/master/docs/walkthrough/phase-1/nightscout-setup.md#switching-from-api_secret-to-token-based-authentication-for-your-rig") - sys.exit(1) + if len(missing)>0: + logging.error("The following permissions are missing in Nightscout: %s" % missing) + logging.error("Please follow instructions at https://openaps.readthedocs.io/en/master/docs/walkthrough/phase-1/nightscout-setup.md#switching-from-api_secret-to-token-based-authentication-for-your-rig") + sys.exit(1) logging.info("All permissions in Nightscout are ok")