def _require_auth(fnc):
 @wraps(fnc)
 @_assure_identity
 def _wrapped(*args, **kwargs):
  if (not identity.authenticated):
   msg = ("Authentication required before calling '%s'." % fnc.__name__)
   raise exc.NotAuthenticated(msg)
  return fnc(*args, **kwargs)
 return _wrapped

def _require_auth ( fnc ) : @ wraps ( fnc ) @ _assure_identity def _wrapped ( * args , ** kwargs ) : if ( not identity . authenticated ) : msg = ( "Authentication required before calling '%s'." % fnc . __name__ ) raise exc . NotAuthenticated ( msg ) return fnc ( * args , ** kwargs ) return _wrapped
authentication decorator .