#!/usr/bin/env python3
# ---------------------------------------
# simple script that just takes in a 
# username and password and encodes it
# and spits out an HTTP Basic Auth header
# ---------------------------------------
import base64
import argparse

parser = argparse.ArgumentParser(description='generates an HTML basic authorization header')

parser.add_argument('u', metavar='username', help='the username')
parser.add_argument('p', metavar='password', help='the password')

args = parser.parse_args()

authString = "%s:%s" % (args.u,args.p)
encAuthString = base64.b64encode( bytes(authString, 'UTF-8') )

print( "Authorization: Basic %s" % (encAuthString.decode('UTF-8')) )
