From 89d63d5ca7e57648b2b81f73bdeda75c59acdedc Mon Sep 17 00:00:00 2001 From: Donovan Preston Date: Thu, 5 Dec 2019 13:23:55 -0500 Subject: [PATCH] Add a --method parameter to tools/hawk/make_hawk_token.py --- tools/hawk/make_hawk_token.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/hawk/make_hawk_token.py b/tools/hawk/make_hawk_token.py index ee6417dd..60e4aaeb 100644 --- a/tools/hawk/make_hawk_token.py +++ b/tools/hawk/make_hawk_token.py @@ -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)