2018-06-12 18:00:00 +01:00
|
|
|
import ussl
|
|
|
|
import urequests
|
|
|
|
import usocket
|
2018-06-13 17:58:20 +01:00
|
|
|
import ubinascii
|
2018-06-12 18:00:00 +01:00
|
|
|
|
|
|
|
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]
|