Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\
.get('authorization')
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
:return: None
"""
user_name, password = WebAppOperations.get_site_credential(self.__cmd.cli_ctx,
self.__resource_group_name,
self.bot_site_name,
None)
# Store the password for download_bot_zip:
self.__password = password
self.__scm_url = WebAppOperations.get_scm_url(self.__cmd,
self.__resource_group_name,
self.bot_site_name,
None)
self.__auth_headers = urllib3.util.make_headers(basic_auth='{0}:{1}'.format(user_name, password))
self.__initialized = True
raise MissingRequiredArgument('property email must be provided')
payload['email'] = email
if target_id is None:
raise MissingRequiredArgument('property target_id must be provided')
payload['target_id'] = target_id
if user_id is None:
raise MissingRequiredArgument('property user_id must be provided')
payload['user_id'] = user_id
if email is not None:
payload['email'] = email
if target_id is not None:
payload['target_id'] = target_id
if user_id is not None:
payload['user_id'] = user_id
uri = '%s/v1/email/create' % self.endpoint
hdrs = urllib3.util.make_headers(
basic_auth='%s:%s' % (self.key, self.secret),
)
if self.debug:
print('POST %s' % uri)
hdrs['Content-Type']= 'application/json'
res = self.http.request('POST', uri, headers=hdrs, body=json.dumps(payload))
if self.debug:
print(res)
self.res = res
if res.status != 200:
self.extract_error(res)
return None
return json.loads(res.data)
except BaseException as e:
if self.debug:
print("error during http access: " + repr(e))
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def get_basic_auth_token(self):
"""
Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(basic_auth=self.username + ':' + self.password)\
.get('authorization')
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')