Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 41839200B73 for ; Mon, 29 Aug 2016 19:06:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 40140160AB8; Mon, 29 Aug 2016 17:06:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 88059160A89 for ; Mon, 29 Aug 2016 19:06:06 +0200 (CEST) Received: (qmail 83513 invoked by uid 500); 29 Aug 2016 17:06:05 -0000 Mailing-List: contact dev-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list dev@airflow.incubator.apache.org Received: (qmail 83493 invoked by uid 99); 29 Aug 2016 17:06:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2016 17:06:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 00B1E1A02B7 for ; Mon, 29 Aug 2016 17:06:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id QfVH-cMPGfAM for ; Mon, 29 Aug 2016 17:06:03 +0000 (UTC) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id B8A115F240 for ; Mon, 29 Aug 2016 17:06:02 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id q128so87167078wma.1 for ; Mon, 29 Aug 2016 10:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:mime-version:subject:message-id:date :references:in-reply-to:to; bh=WSskxF8dE6yTkV/1IuxOgHEFZT7F9bx8DEmOJGzDnvo=; b=d6B7IdZ6I0VlIAzUP+2f15zwU/Kjy9FoiUAYyCPbG6SSLgbqSAymKAJ6DuqyzwhVu0 bN7Vz0H22XYQYu9JwjiJOasco4yuT7KUgXTTSrfx0neF3D+sZ5DWeF8kOwwr4BjfTG41 kwzdcvrXHRQDOk+SEJpajSkdhsa8dYtDunb1HN7UGTpsKphlADj3jO1+ASknaUBfZVZk DfCehlyNS3ojh5jFMiUE4dzpEFrpDCsVwYSHv1tMRWrf4pL+cB1qs5B4ZP2rkcILmIbc JFkBp4LX9vicPLcLBVm1SqA7/NwN/+FOdDWo07i/WCyWT/aZRlunXekGarys2Ewe+jEA cgeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:references:in-reply-to:to; bh=WSskxF8dE6yTkV/1IuxOgHEFZT7F9bx8DEmOJGzDnvo=; b=KiLBOQBr0yBnXTnwbZaTlM4hqI3uCeplYiSTLwRKIlJsx9fgCzZGmc2WIxTfpIwUOW h7KLjwDonSaXYXwylR8IZ+RciW/+QdGp1pWesILxB7MqriCCAAZ6Za+5BV3lcMZRa7pC SNrYHDFc5wm1ummbUBWq42jh/BgS5RU2zUxSBHoKJOs35cVaj7I0x9Q9O4udg+1yOT7N dcmIuELT9m/P91lFhHUEIw1ny7qo/f2nd2n1z945z5/MrhRjaKazUE1hG4fVvivqBjHt e5MIe052i+uSDRyeA2qKcIBlRABvNvPNi+wNGqyD6odyVE/F5RUJh54Ox9NQLhTecwJZ h5iw== X-Gm-Message-State: AE9vXwNifGxjfQPC2kmP44IvvieChujP4mvwdvsBIrFLDi3r7Shih2NsfIXZetJMbP5amQ== X-Received: by 10.28.26.5 with SMTP id a5mr11797546wma.27.1472490362146; Mon, 29 Aug 2016 10:06:02 -0700 (PDT) Received: from [10.171.148.247] ([62.140.137.23]) by smtp.gmail.com with ESMTPSA id p1sm35270551wjd.37.2016.08.29.10.06.00 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Aug 2016 10:06:01 -0700 (PDT) From: Bolke de Bruin Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Re: CSRF token issue when using POST in flask_blueprints in the Plugin Message-Id: <50D7360D-822F-4E69-B086-B9BF8D53F573@gmail.com> Date: Mon, 29 Aug 2016 19:06:00 +0200 References: In-Reply-To: To: dev@airflow.incubator.apache.org X-Mailer: iPhone Mail (13G36) archived-at: Mon, 29 Aug 2016 17:06:07 -0000 Add @csrf.exempt=20 http://flask-wtf.readthedocs.io/en/latest/csrf.html Bolke Sent from my iPhone > On 29 aug. 2016, at 14:25, Dmitriy Krasnikov wrot= e: >=20 >=20 >=20 >=20 >=20 > Hi, I was trying to ask this question on Stackoverflow, but I don't think a= nybody monitors it. >=20 > I am trying to leverage plugins in airflow to implement REST calls to meta= database. I created new tables, but while GET works fine, the POST and PUT g= enerate CSRF token missing or incorrect error. >=20 > from airflow.plugins_manager import AirflowPlugin =20 > from flask import Blueprint > asset =3D Blueprint('turbine_plugin', __name__, url_prefix=3D'/api/asset')= >=20 > @asset.route('/', methods=3D['POST']) > def insert(): > """ > Inserts new Asset. > :return: 200 on success. > """ > pass >=20 > class TurbinePlugin(AirflowPlugin): > name =3D "turbine_plugin" > flask_blueprints =3D [asset] >=20 >=20 > what should I include or do to use POST in ariflow plugins, I see in code t= hat app is CSRF protected, but how you get token for REST calls? >=20