Skip to content

Commit 9b57b06

Browse files
inventor96scottleibrand
authored andcommitted
Revert scope promotion
1 parent 2595eca commit 9b57b06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bin/oref0_nightscout_check.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ def startup_checks(args):
9393
def check_permissions():
9494
global token_dict
9595
pg=[]
96-
missing=[]
9796

9897
for perm_group in token_dict['permissionGroups']:
9998
pg.extend(perm_group)
10099

101100
if pg==["*"]: # admin role
102101
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")
103102
else:
103+
missing=[]
104104
for perm in ["api:treatments:read", "api:treatments:create", "api:treatments:read", "api:treatments:create", "api:devicestatus:read", "api:devicestatus:create"]:
105105
logging.debug("Checking %s" % perm)
106106
if perm not in pg:
107107
missing.append(perm)
108108

109-
if len(missing)>0:
110-
logging.error("The following permissions are missing in Nightscout: %s" % missing)
111-
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")
112-
sys.exit(1)
109+
if len(missing)>0:
110+
logging.error("The following permissions are missing in Nightscout: %s" % missing)
111+
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")
112+
sys.exit(1)
113113

114114
logging.info("All permissions in Nightscout are ok")
115115

0 commit comments

Comments
 (0)