uPyLibs/uJIRA.py

15 lines
576 B
Python
Raw Permalink Normal View History

import ussl
import urequests
import usocket
2018-06-13 17:58:20 +01:00
import ubinascii
class client:
def __init__(self, jira_server):
self.base_uri=jira_server
def login(self, params):
self.method = params['method']
2018-06-13 17:58:20 +01:00
if self.method != 'basic-auth':
raise ValueError("Authentication method %s not supported by this library." % self.method)
self.basic_auth = "%s:%s" % (params['username'], params['password'])
self.basic_auth = ubinascii.b2a_base64(("%s:%s" % (params['username'], params['password'])).encode()).decode()[:-1]