Merge pull request #363 from mozilla-services/add-method-to-make_hawk_token

Add a --method parameter to tools/hawk/make_hawk_token.py
This commit is contained in:
Donovan Preston 2019-12-05 14:08:17 -05:00 committed by GitHub
commit 4a9f2cedd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ from webob.request import Request
LEGACY_UID = 1
COL = "col2"
URI = "/1.5/{uid}/storage/{col}/".format(uid=LEGACY_UID, col=COL)
METHOD = "GET"
FXA_UID = "DEADBEEF00004be4ae957006c0ceb620"
FXA_KID = "DEADBEEF00004be4ae957006c0ceb620"
DEVICE_ID = "device1"
@ -48,6 +49,9 @@ def get_args():
parser.add_argument(
'--uri', default=URI,
help="URI path ({})".format(URI))
parser.add_argument(
'--method', default=METHOD,
help="The HTTP Method ({})".format(METHOD))
parser.add_argument(
'--fxa_uid', default=FXA_UID,
help="FxA User ID ({})".format(FXA_UID))
@ -108,6 +112,7 @@ def main():
node=args.node,
uri=args.uri)
req = Request.blank(path)
req.method = args.method
header = hawkauthlib.sign_request(req, token, key)
if not args.as_header:
print("Expires: ", expires)