MCPcopy
hub / github.com/locustio/locust / _construct_basic_auth_str

Function _construct_basic_auth_str

locust/contrib/fasthttp.py:92–98  ·  view source on GitHub ↗

Construct Authorization header value to be used in HTTP Basic Auth

(username, password)

Source from the content-addressed store, hash-verified

90
91
92def _construct_basic_auth_str(username, password):
93 """Construct Authorization header value to be used in HTTP Basic Auth"""
94 if isinstance(username, str):
95 username = username.encode("latin1")
96 if isinstance(password, str):
97 password = password.encode("latin1")
98 return "Basic " + b64encode(b":".join((username, password))).strip().decode("ascii")
99
100
101def insecure_ssl_context_factory():

Callers 2

__init__Method · 0.85
requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…