Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(packages): Fixing users packages #18973

Merged
merged 4 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
)
from superset.security import SupersetSecurityManager
from superset.typing import FlaskResponse
from superset.users.api import CurrentUserRestApi
from superset.utils.core import pessimistic_connection_handling
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value

Expand Down Expand Up @@ -195,6 +194,7 @@ def init_views(self) -> None:
TabStateView,
)
from superset.views.tags import TagView
from superset.views.users.api import CurrentUserRestApi

#
# Setup API views
Expand Down
17 changes: 17 additions & 0 deletions superset/views/users/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
2 changes: 1 addition & 1 deletion superset/users/api.py → superset/views/users/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CurrentUserRestApi(BaseApi):

@expose("/", methods=["GET"])
@safe
def me(self) -> Response:
def get_me(self) -> Response:
"""Get the user object corresponding to the agent making the request
---
get:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/integration_tests/security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def test_views_are_secured(self):
["LocaleView", "index"],
["AuthDBView", "login"],
["AuthDBView", "logout"],
["CurrentUserRestApi", "me"],
["CurrentUserRestApi", "get_me"],
["Dashboard", "embedded"],
["R", "index"],
["Superset", "log"],
Expand Down
17 changes: 17 additions & 0 deletions tests/integration_tests/users/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.