OpenMined / PyGrid-deprecated---see-PySyft-

A Peer-to-peer Platform for Secure, Privacy-preserving, Decentralized Data Science
Apache License 2.0
617 stars 216 forks source link

In _verify_identity method response text is not equal to "OpenGrid" #251

Closed amit-rastogi closed 5 years ago

amit-rastogi commented 5 years ago

When I run gr.GridClient(addr=gr.launch_on_heroku("opengrid10", verbose=True, check_deps=True)) _verify_identity fails with "App is not an OpenGrid app."

def _verify_identity(self):
    r = requests.get(self.addr + "/identity/")
    if r.text != "OpenGrid":
        raise PermissionError("App is not an OpenGrid app.")

After debugging the code I found that in my case response code is 502 and r.text is a bunch of html and its not "OpenGrid", hence its failing. Is this expected behavior or am I missing something?

hereismari commented 5 years ago

Hey @amit-rastogi,

The problem is that: self.addr + "/identity/" is not the best way to concatenate strings to represent a path. This should be changed to os.path.join(self.addr, "/identity/").

More specifically the current version of grid will fail if self.addr ends with "/".

amit-rastogi commented 5 years ago

Thanks @mari-linhares i'll take this up.