[ Avaa Bypassed ]




Upload:

Command:

www-data@3.139.85.192: ~ $
# Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
try:
    from collections.abc import Mapping
except ImportError:
    from collections import Mapping


class AuthContext(Mapping):
    ''' Holds a set of keys and values relevant to authorization.

    It is passed as an argument to authorization checkers, so that the checkers
    can access information about the context of the authorization request.
    It is immutable - values can only be added by copying the whole thing.
    '''
    def __init__(self, somedict=None):
        if somedict is None:
            somedict = {}
        self._dict = dict(somedict)
        self._hash = None

    def with_value(self, key, val):
        ''' Return a copy of the AuthContext object with the given key and
        value added.
        '''
        new_dict = dict(self._dict)
        new_dict[key] = val
        return AuthContext(new_dict)

    def __getitem__(self, key):
        return self._dict[key]

    def __len__(self):
        return len(self._dict)

    def __iter__(self):
        return iter(self._dict)

    def __hash__(self):
        if self._hash is None:
            self._hash = hash(frozenset(self._dict.items()))
        return self._hash

    def __eq__(self, other):
        return self._dict == other._dict


class ContextKey(object):
    '''Provides a unique key suitable for use as a key into AuthContext.'''

    def __init__(self, name):
        '''Creates a context key using the given name. The name is
     only for informational purposes.
     '''
        self._name = name

    def __str__(self):
        return '%s#%#x' % (self._name, id(self))

    def __repr__(self):
        return 'context_key(%r, %#x)' % (self._name, id(self))

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 1.56 KB 0644
_auth_context.py File 1.71 KB 0644
_caveat.py File 4.11 KB 0644
_checkers.py File 8.02 KB 0644
_conditions.py File 515 B 0644
_declared.py File 2.78 KB 0644
_namespace.py File 5.33 KB 0644
_operation.py File 586 B 0644
_time.py File 2.13 KB 0644
_utils.py File 377 B 0644