

def parse_discovery_service_request(self, url='', query=''):
    if url:
        part = urlparse(url)
        dsr = parse_qs(part[4])
    elif query:
        dsr = parse_qs(query)
    else:
        dsr = {
            
        }
    for key in ['isPassive', 'return', 'returnIDParam', 'policy']:
        try:
            assert (len(dsr[key]) == 1)
            dsr[key] = dsr[key][0]
        except KeyError:
            pass
    if ('return' in dsr):
        part = urlparse(dsr['return'])
        if part.query:
            qp = parse_qs(part.query)
            if ('returnIDParam' in dsr):
                assert (dsr['returnIDParam'] not in qp.keys())
            else:
                assert ('entityID' not in qp.keys())
    else:
        raise VerificationError("Missing mandatory parameter 'return'")
    if ('policy' not in dsr):
        dsr['policy'] = IDPDISC_POLICY
    try:
        assert (dsr['isPassive'] in ['true', 'false'])
    except KeyError:
        pass
    if (('isPassive' in dsr) and (dsr['isPassive'] == 'true')):
        dsr['isPassive'] = True
    else:
        dsr['isPassive'] = False
    if (not ('returnIDParam' in dsr)):
        query['returnIDParam'] = 'entityID'
    return dsr

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/discovery.py DiscoveryServer.parse_discovery_service_request/VarMisuse@308/432 `dsr`->`query`