From commits-return-1965-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Tue Dec 18 19:56:07 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 88C71180669 for ; Tue, 18 Dec 2018 19:56:06 +0100 (CET) Received: (qmail 40469 invoked by uid 500); 18 Dec 2018 18:56:05 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 40460 invoked by uid 99); 18 Dec 2018 18:56:05 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2018 18:56:05 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 25BAC85286; Tue, 18 Dec 2018 18:56:05 +0000 (UTC) Date: Tue, 18 Dec 2018 18:56:04 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: Pass security manager to QUERY_LOGGER (#6548) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154515936473.15583.6060353997512096971@gitbox.apache.org> From: beto@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fe994900ecc2c400867a5deb6a2bba8ebedab986 X-Git-Newrev: 672c470e79797290c96c61a0ee05788143f32736 X-Git-Rev: 672c470e79797290c96c61a0ee05788143f32736 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. beto pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 672c470 Pass security manager to QUERY_LOGGER (#6548) 672c470 is described below commit 672c470e79797290c96c61a0ee05788143f32736 Author: Beto Dealmeida AuthorDate: Tue Dec 18 10:55:58 2018 -0800 Pass security manager to QUERY_LOGGER (#6548) * Pass security manager to log_query * Fix lint --- superset/config.py | 9 ++++++++- superset/models/core.py | 2 +- superset/sql_lab.py | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/superset/config.py b/superset/config.py index 37afdd5..988df25 100644 --- a/superset/config.py +++ b/superset/config.py @@ -285,7 +285,14 @@ BACKUP_COUNT = 30 # Custom logger for auditing queries. This can be used to send ran queries to a # structured immutable store for auditing purposes. The function is called for # every query ran, in both SQL Lab and charts/dashboards. -# def QUERY_LOGGER(database, query, schema=None, user=None, client=None): +# def QUERY_LOGGER( +# database, +# query, +# schema=None, +# user=None, +# client=None, +# security_manager=None, +# ): # pass # Set this API key to enable Mapbox visualizations diff --git a/superset/models/core.py b/superset/models/core.py index 6f520aa..97dd54a 100644 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -813,7 +813,7 @@ class Database(Model, AuditMixinNullable, ImportMixin): def _log_query(sql): if log_query: - log_query(engine.url, sql, schema, username, __name__) + log_query(engine.url, sql, schema, username, __name__, security_manager) with closing(engine.raw_connection()) as conn: with closing(conn.cursor()) as cursor: diff --git a/superset/sql_lab.py b/superset/sql_lab.py index 0c76c7c..5b3f927 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -189,6 +189,7 @@ def execute_sql( query.schema, user_name, __name__, + security_manager, ) db_engine_spec.execute(cursor, query.executed_sql, async_=True) logging.info('Handling cursor')