Esempio n. 1
0
	def post(self):
		auth_code = base64.encodestring(
				hmac.new(ENV.password, 
						unicode( self.request.body ).encode("utf-8"),
						hashlib.sha256).digest()
				).strip()
		if ( auth_code == self.request.headers["Authorization"] ):
			ip = IP_DB.get_by_key_name(ENV.ip_key_name) 
			self.response.out.write(ip.ip)
		else:
			self.error(401)
Esempio n. 2
0
	def post(self): 
		if ( ENV.password_hash == hashlib.sha512(self.request.get('password')).hexdigest() ):
			ip = IP_DB.get_by_key_name(ENV.ip_key_name) 
			self.response.out.write("<b>"+ip.ip+"</b><br>Last Update: "+str(ip.time))
		else:
			self.response.out.write("<h1>Wrong Password</h1>")
Esempio n. 3
0
	def post(self): 
		if ( ENV.password_hash == hashlib.sha512(self.request.get('password')).hexdigest() ):
			ip = IP_DB.get_by_key_name(ENV.ip_key_name) 
			self.redirect("http://"+ip.ip)
		else:
			self.response.out.write("<h1>Wrong Password</h1>")