def auth_field_and_value(resource):
 if ('|resource' in request.endpoint):
  public_method_list_to_check = 'public_methods'
 else:
  public_method_list_to_check = 'public_item_methods'
 resource_dict = app.config['DOMAIN'][resource]
 auth = resource_auth(resource)
 request_auth_value = (auth.get_request_auth_value() if auth else None)
 auth_field = (resource_dict.get('auth_field', None) if (request.method not in resource_dict[public_method_list_to_check]) else None)
 return (auth_field, request_auth_value)

def auth_field_and_value ( resource ) : if ( '|resource' in request . endpoint ) : public_method_list_to_check = 'public_methods' else : public_method_list_to_check = 'public_item_methods' resource_dict = app . config [ 'DOMAIN' ] [ resource ] auth = resource_auth ( resource ) request_auth_value = ( auth . get_request_auth_value ( ) if auth else None ) auth_field = ( resource_dict . get ( 'auth_field' , None ) if ( request . method not in resource_dict [ public_method_list_to_check ] ) else None ) return ( auth_field , request_auth_value )
if auth is active and the resource requires it .