uPyLibs/uJIRA.py

15 lines
576 B
Python

import ussl
import urequests
import usocket
import ubinascii
class client:
def __init__(self, jira_server):
self.base_uri=jira_server
def login(self, params):
self.method = params['method']
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]