Skip to content

Commit 5fc7adb

Browse files
authored
fix(packages): Fixing users packages (#18973)
* Fixing users packages * Linting me() fn * Fixing tests / moving packages * Fixing imports
1 parent 563cce1 commit 5fc7adb

File tree

6 files changed

+37
-3
lines changed

6 files changed

+37
-3
lines changed

superset/initialization/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
)
5151
from superset.security import SupersetSecurityManager
5252
from superset.typing import FlaskResponse
53-
from superset.users.api import CurrentUserRestApi
5453
from superset.utils.core import pessimistic_connection_handling
5554
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value
5655

@@ -195,6 +194,7 @@ def init_views(self) -> None:
195194
TabStateView,
196195
)
197196
from superset.views.tags import TagView
197+
from superset.views.users.api import CurrentUserRestApi
198198

199199
#
200200
# Setup API views

superset/views/users/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8 -*-
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.

superset/users/api.py renamed to superset/views/users/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CurrentUserRestApi(BaseApi):
3131

3232
@expose("/", methods=["GET"])
3333
@safe
34-
def me(self) -> Response:
34+
def get_me(self) -> Response:
3535
"""Get the user object corresponding to the agent making the request
3636
---
3737
get:
File renamed without changes.

tests/integration_tests/security_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def test_views_are_secured(self):
905905
["LocaleView", "index"],
906906
["AuthDBView", "login"],
907907
["AuthDBView", "logout"],
908-
["CurrentUserRestApi", "me"],
908+
["CurrentUserRestApi", "get_me"],
909909
["Dashboard", "embedded"],
910910
["R", "index"],
911911
["Superset", "log"],
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8 -*-
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.

0 commit comments

Comments
 (0)