Closed theho closed 7 years ago
A quick two-line 'hack' in connection.py, line 92
if ACCESS_KEYS.get('session_token'):
headers.update({'X-Parse-Session-Token': ACCESS_KEYS.get('session_token')})
in my code: class sessionToken: def init(self, token): self.token = token def enter(self): parse_rest.connection.ACCESS_KEYS.update({'session_token': self.token}) def exit(self, type, value, traceback): del parse_rest.connection.ACCESS_KEYS['session_token']
with sessionToken('abcdef'): x = Appointment.Query.all().limit(5) for p in x: print(p)
Any plans for supporting something similar to Parse.become ?
Am thinking something like,
register(APPLICATION_ID, REST_API_KEY, master_key=None, session_token='')
Then all subsequent requests would be by whichever user the token belongs to.
I suppose ultimately, would like to have
with sessionToken('token123'): Appointment.Query.all() ...