def get_app_scopes()

in src/Saas.Admin/deployment/script/map-to-config-entries-parameters.py [0:0]


def get_app_scopes(
    config: dict, 
    app_name: str,
    keyName: str) -> 'dict[str, dict[str, str]]':
    
    scopes = []

    for app in config['appRegistrations']: 
        if app['name'] == app_name:
            for scope in app['scopes']:
                scopes.append(scope['name'])

    return {
        keyName: {
            'value': json.dumps(scopes)
        }
    }