From 28592ee1ea1f5cdffcf85472f9de0285d928cf12 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Wed, 3 Aug 2011 16:54:30 +0200 Subject: Imported Upstream version 59 --- misc/dashboard/godashboard/auth.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 misc/dashboard/godashboard/auth.py (limited to 'misc/dashboard/godashboard/auth.py') diff --git a/misc/dashboard/godashboard/auth.py b/misc/dashboard/godashboard/auth.py new file mode 100644 index 000000000..73a54c0d4 --- /dev/null +++ b/misc/dashboard/godashboard/auth.py @@ -0,0 +1,13 @@ +# Copyright 2011 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +import hmac + +# local imports +import key + +def auth(req): + k = req.get('key') + return k == hmac.new(key.accessKey, req.get('builder')).hexdigest() or k == key.accessKey + -- cgit v1.2.3