def continuation(request, context, call_details): state.append(CapturedState( current_identity=api.get_current_identity().to_bytes(), is_superuser=api.is_superuser(), peer_identity=api.get_peer_identity().to_bytes(), peer_ip=api.get_peer_ip(), delegation_token=api.get_delegation_token(), )) return empty_pb2.Empty()
def get(self): self.response.write(ipaddr.ip_to_string(api.get_peer_ip()))
def test_get_peer_ip(self): """IP address is stored in auth context.""" self.call('1.2.3.4', '*****@*****.**') self.assertEqual(ipaddr.ip_from_string('1.2.3.4'), api.get_peer_ip())