Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion env/lib/python3.8/site-packages/pip/_internal/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def update(self, dest, url, rev_options):
self.run_command(['fetch', '-q', '--tags'], cwd=dest)
else:
self.run_command(['fetch', '-q'], cwd=dest)
# Then reset to wanted revision (maybe even origin/master)
# Then reset to wanted revision (maybe even origin/main)
rev_options = self.resolve_revision(dest, url, rev_options)
cmd_args = ['reset', '--hard', '-q'] + rev_options.to_args()
self.run_command(cmd_args, cwd=dest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ def __init__(self, entries=None):
self.add_entry(entry)

@classmethod
def _build_master(cls):
def _build_main(cls):
"""
Prepare the master working set.
Prepare the main working set.
"""
ws = cls()
try:
Expand Down Expand Up @@ -3239,9 +3239,9 @@ def _initialize(g=globals()):


@_call_aside
def _initialize_master_working_set():
def _initialize_main_working_set():
"""
Prepare the master working set and make the ``require()``
Prepare the main working set and make the ``require()``
API available.

This function has explicit effects on the global state
Expand All @@ -3251,7 +3251,7 @@ def _initialize_master_working_set():
Invocation by other packages is unsupported and done
at their own risk.
"""
working_set = WorkingSet._build_master()
working_set = WorkingSet._build_main()
_declare_state('object', working_set=working_set)

require = working_set.require
Expand Down
10 changes: 5 additions & 5 deletions env/lib/python3.8/site-packages/pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ def __init__(self, entries=None):
self.add_entry(entry)

@classmethod
def _build_master(cls):
def _build_main(cls):
"""
Prepare the master working set.
Prepare the main working set.
"""
ws = cls()
try:
Expand Down Expand Up @@ -3248,9 +3248,9 @@ def _initialize(g=globals()):


@_call_aside
def _initialize_master_working_set():
def _initialize_main_working_set():
"""
Prepare the master working set and make the ``require()``
Prepare the main working set and make the ``require()``
API available.

This function has explicit effects on the global state
Expand All @@ -3260,7 +3260,7 @@ def _initialize_master_working_set():
Invocation by other packages is unsupported and done
at their own risk.
"""
working_set = WorkingSet._build_master()
working_set = WorkingSet._build_main()
_declare_state('object', working_set=working_set)

require = working_set.require
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ def update_dist_caches(dist_path, fix_zipimporter_caches):
# There are several other known sources of stale zipimport.zipimporter
# instances that we do not clear here, but might if ever given a reason to
# do so:
# * Global setuptools pkg_resources.working_set (a.k.a. 'master working
# * Global setuptools pkg_resources.working_set (a.k.a. 'main working
# set') may contain distributions which may in turn contain their
# zipimport.zipimporter loaders.
# * Several zipimport.zipimporter loaders held by local variables further
Expand Down
8 changes: 4 additions & 4 deletions restaurant_bot/env/lib/python3.8/site-packages/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -2135,20 +2135,20 @@ def client_random(self):
_lib.SSL_get_client_random(self._ssl, outp, length)
return _ffi.buffer(outp, length)[:]

def master_key(self):
def main_key(self):
"""
Retrieve the value of the master key for this session.
Retrieve the value of the main key for this session.

:return: A string representing the state
"""
session = _lib.SSL_get_session(self._ssl)
if session == _ffi.NULL:
return None

length = _lib.SSL_SESSION_get_master_key(session, _ffi.NULL, 0)
length = _lib.SSL_SESSION_get_main_key(session, _ffi.NULL, 0)
assert length > 0
outp = _no_zero_allocator("unsigned char[]", length)
_lib.SSL_SESSION_get_master_key(session, outp, length)
_lib.SSL_SESSION_get_main_key(session, outp, length)
return _ffi.buffer(outp, length)[:]

def export_keying_material(self, label, olen, context=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class RefreshOption(_Constants):
'HOSTS': (1 << 3, 'Flush host cache'),
'STATUS': (1 << 4, 'Flush status variables'),
'THREADS': (1 << 5, 'Flush thread cache'),
'SLAVE': (1 << 6, 'Reset master info and restart slave thread'),
'SLAVE': (1 << 6, 'Reset main info and restart subordinate thread'),
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
CR_EMBEDDED_CONNECTION = u"Embedded server"
CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:"
CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to master:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to main:"
CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s"
CR_MALFORMED_PACKET = u"Malformed packet"
CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
CR_EMBEDDED_CONNECTION = u"Embedded server"
CR_PROBE_SLAVE_STATUS = u"Error on SHOW SLAVE STATUS:"
CR_PROBE_SLAVE_HOSTS = u"Error on SHOW SLAVE HOSTS:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to slave:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to master:"
CR_PROBE_SLAVE_CONNECT = u"Error connecting to subordinate:"
CR_PROBE_MASTER_CONNECT = u"Error connecting to main:"
CR_SSL_CONNECTION_ERROR = u"SSL connection error: %-.100s"
CR_MALFORMED_PACKET = u"Malformed packet"
CR_WRONG_LICENSE = u"This client library is licensed only for use with MySQL servers having '%s' license"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def update(self, dest, url, rev_options):
self.run_command(['fetch', '-q', '--tags'], cwd=dest)
else:
self.run_command(['fetch', '-q'], cwd=dest)
# Then reset to wanted revision (maybe even origin/master)
# Then reset to wanted revision (maybe even origin/main)
rev_options = self.resolve_revision(dest, url, rev_options)
cmd_args = make_command('reset', '--hard', '-q', rev_options.to_args())
self.run_command(cmd_args, cwd=dest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ def __init__(self, entries=None):
self.add_entry(entry)

@classmethod
def _build_master(cls):
def _build_main(cls):
"""
Prepare the master working set.
Prepare the main working set.
"""
ws = cls()
try:
Expand Down Expand Up @@ -3248,9 +3248,9 @@ def _initialize(g=globals()):


@_call_aside
def _initialize_master_working_set():
def _initialize_main_working_set():
"""
Prepare the master working set and make the ``require()``
Prepare the main working set and make the ``require()``
API available.

This function has explicit effects on the global state
Expand All @@ -3260,7 +3260,7 @@ def _initialize_master_working_set():
Invocation by other packages is unsupported and done
at their own risk.
"""
working_set = WorkingSet._build_master()
working_set = WorkingSet._build_main()
_declare_state('object', working_set=working_set)

require = working_set.require
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ def __init__(self, entries=None):
self.add_entry(entry)

@classmethod
def _build_master(cls):
def _build_main(cls):
"""
Prepare the master working set.
Prepare the main working set.
"""
ws = cls()
try:
Expand Down Expand Up @@ -3248,9 +3248,9 @@ def _initialize(g=globals()):


@_call_aside
def _initialize_master_working_set():
def _initialize_main_working_set():
"""
Prepare the master working set and make the ``require()``
Prepare the main working set and make the ``require()``
API available.

This function has explicit effects on the global state
Expand All @@ -3260,7 +3260,7 @@ def _initialize_master_working_set():
Invocation by other packages is unsupported and done
at their own risk.
"""
working_set = WorkingSet._build_master()
working_set = WorkingSet._build_main()
_declare_state('object', working_set=working_set)

require = working_set.require
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
class AuthenticationClient(Client):
def __init__(
self, app_id, key, secret, ssl=True, host=None, port=None,
timeout=5, cluster=None, encryption_master_key=None, json_encoder=None, json_decoder=None,
timeout=5, cluster=None, encryption_main_key=None, json_encoder=None, json_decoder=None,
backend=None, **backend_options):
super(AuthenticationClient, self).__init__(
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key,
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_main_key,
json_encoder, json_decoder, backend, **backend_options)

if host:
Expand Down Expand Up @@ -78,7 +78,7 @@ def authenticate(self, channel, socket_id, custom_data=None):

if is_encrypted_channel(channel):
shared_secret = generate_shared_secret(
ensure_binary(channel, "channel"), self._encryption_master_key)
ensure_binary(channel, "channel"), self._encryption_main_key)
shared_secret_b64 = base64.b64encode(shared_secret)
response_payload["shared_secret"] = shared_secret_b64

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Client(object):
def __init__(
self, app_id, key, secret, ssl=True, host=None, port=None,
timeout=5, cluster=None, encryption_master_key=None, json_encoder=None, json_decoder=None,
timeout=5, cluster=None, encryption_main_key=None, json_encoder=None, json_decoder=None,
backend=None, **backend_options):
if backend is None:
from .requests import RequestsBackend
Expand Down Expand Up @@ -45,10 +45,10 @@ def __init__(
self._json_decoder = json_decoder


if encryption_master_key is not None:
encryption_master_key = ensure_binary(encryption_master_key, "encryption_master_key")
if encryption_main_key is not None:
encryption_main_key = ensure_binary(encryption_main_key, "encryption_main_key")

self._encryption_master_key = encryption_master_key
self._encryption_main_key = encryption_main_key

self.http = backend(self, **backend_options)

Expand Down
20 changes: 10 additions & 10 deletions restaurant_bot/env/lib/python3.8/site-packages/pusher/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ def is_encrypted_channel(channel):
return True
return False

def is_encryption_master_key_valid(encryption_master_key):
def is_encryption_main_key_valid(encryption_main_key):
"""
is_encryption_master_key_valid() checks if the provided encryption_master_key is valid by checking its length
is_encryption_main_key_valid() checks if the provided encryption_main_key is valid by checking its length
the key is assumed to be a six.binary_type (python2 str or python3 bytes)
"""
if encryption_master_key is not None and len(encryption_master_key) == 32:
if encryption_main_key is not None and len(encryption_main_key) == 32:
return True

return False

def generate_shared_secret(channel, encryption_master_key):
def generate_shared_secret(channel, encryption_main_key):
"""
generate_shared_secret() takes a six.binary_type (python2 str or python3 bytes) channel name and encryption_master_key
generate_shared_secret() takes a six.binary_type (python2 str or python3 bytes) channel name and encryption_main_key
and returns the sha256 hash in six.binary_type format
"""
if is_encryption_master_key_valid(encryption_master_key):
if is_encryption_main_key_valid(encryption_main_key):
# the key has to be 32 bytes long
hashable = channel + encryption_master_key
hashable = channel + encryption_main_key
return hashlib.sha256(hashable).digest()

raise ValueError("Provided encryption_master_key is not 32 char long")
raise ValueError("Provided encryption_main_key is not 32 char long")

def encrypt(channel, data, encryption_master_key, nonce=None):
def encrypt(channel, data, encryption_main_key, nonce=None):
"""
encrypt() encrypts the provided payload specified in the 'data' parameter
"""
channel = ensure_binary(channel, "channel")
shared_secret = generate_shared_secret(channel, encryption_master_key)
shared_secret = generate_shared_secret(channel, encryption_main_key)
# the box setup to seal/unseal data payload
box = nacl.secret.SecretBox(shared_secret)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
class NotificationClient(Client):
def __init__(
self, app_id, key, secret, ssl=True, host=None, port=None,
timeout=30, cluster=None, encryption_master_key=None, json_encoder=None, json_decoder=None,
timeout=30, cluster=None, encryption_main_key=None, json_encoder=None, json_decoder=None,
backend=None, **backend_options):
super(NotificationClient, self).__init__(
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key,
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_main_key,
json_encoder, json_decoder, backend, **backend_options)

if host:
Expand Down
10 changes: 5 additions & 5 deletions restaurant_bot/env/lib/python3.8/site-packages/pusher/pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Pusher(object):
:param host: Used for custom host destination
:param port: Used for custom port destination
:param timeout: Request timeout (in seconds)
:param encryption_master_key: Used to derive a shared secret between
:param encryption_main_key: Used to derive a shared secret between
server and the clients for payload encryption/decryption
:param cluster: Convention for other clusters than the main Pusher-one.
Eg: 'eu' will resolve to the api-eu.pusherapp.com host
Expand All @@ -46,19 +46,19 @@ class Pusher(object):
"""
def __init__(
self, app_id, key, secret, ssl=True, host=None, port=None,
timeout=5, cluster=None, encryption_master_key=None, json_encoder=None, json_decoder=None,
timeout=5, cluster=None, encryption_main_key=None, json_encoder=None, json_decoder=None,
backend=None, notification_host=None, notification_ssl=True, **backend_options):
self._pusher_client = PusherClient(
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key,
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_main_key,
json_encoder, json_decoder, backend, **backend_options)

self._authentication_client = AuthenticationClient(
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key,
app_id, key, secret, ssl, host, port, timeout, cluster, encryption_main_key,
json_encoder, json_decoder, backend, **backend_options)

self._notification_client = NotificationClient(
app_id, key, secret, notification_ssl, notification_host, port,
timeout, cluster, encryption_master_key, json_encoder, json_decoder, backend,
timeout, cluster, encryption_main_key, json_encoder, json_decoder, backend,
**backend_options)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def __init__(
self, app_id, key, secret, ssl=True,
host=None, port=None,
timeout=5, cluster=None,
encryption_master_key=None,
encryption_main_key=None,
json_encoder=None, json_decoder=None,
backend=None, **backend_options):
super(PusherClient, self).__init__(
app_id, key, secret, ssl, host, port, timeout, cluster,
encryption_master_key, json_encoder, json_decoder,
encryption_main_key, json_encoder, json_decoder,
backend, **backend_options)

if host:
Expand Down Expand Up @@ -90,7 +90,7 @@ def trigger(self, channels, event_name, data, socket_id=None):
raise ValueError("You cannot trigger to multiple channels when using encrypted channels")

if is_encrypted_channel(channels[0]):
data = json.dumps(encrypt(channels[0], data, self._encryption_master_key), ensure_ascii=False)
data = json.dumps(encrypt(channels[0], data, self._encryption_main_key), ensure_ascii=False)

params = {
'name': event_name,
Expand Down Expand Up @@ -125,7 +125,7 @@ def trigger_batch(self, batch=[], already_encoded=False):
raise ValueError("Too much data")

if is_encrypted_channel(event['channel']):
event['data'] = json.dumps(encrypt(event['channel'], event['data'], self._encryption_master_key), ensure_ascii=False)
event['data'] = json.dumps(encrypt(event['channel'], event['data'], self._encryption_main_key), ensure_ascii=False)

params = {
'batch': batch}
Expand Down
Loading