예제 #1
0
 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()
예제 #2
0
 def get(self):
     self.response.write(ipaddr.ip_to_string(api.get_peer_ip()))
예제 #3
0
 def get(self):
   self.response.write(ipaddr.ip_to_string(api.get_peer_ip()))
예제 #4
0
 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())
예제 #5
0
 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())