+ if @object.info[:ping_secret] == params[:ping_secret]
+ render json: @object.as_api_response(:superuser)
+ else
+ raise "Invalid ping_secret after ping"
+ end
+ end
+
+ def find_objects_for_index
+ if current_user.andand.is_admin || !current_user.andand.is_active
+ super
+ else
+ # active non-admin users can list nodes that are (or were
+ # recently) working
+ @objects = model_class.where('last_ping_at >= ?', Time.now - 1.hours)
+ end