def _GetXsrfKey():
  """Returns the current key for generating and verifying XSRF tokens."""
  client = memcache.Client()
  xsrf_key = client.get('xsrf_key')
  if not xsrf_key:
    config = models.GetApplicationConfiguration()
    xsrf_key = config.xsrf_key
    client.set('xsrf_key', xsrf_key)
  return xsrf_key
Exemplo n.º 2
0
 def testConfigurationAutomaticallyGenerated(self):
     config = models.GetApplicationConfiguration()
     self.assertIsNotNone(config)
     self.assertIsNotNone(config.xsrf_key)