fix: use StrEnum type for GuestTokenResourceType to fix token parsing (#30042)

This commit is contained in:
hao-zhuventures 2024-08-29 13:06:30 -07:00 committed by GitHub
parent 606ddc3181
commit e2c4435cab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -14,12 +14,13 @@
# KIND, either express or implied. See the License for the # KIND, either express or implied. See the License for the
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
from enum import Enum
from typing import Optional, TypedDict, Union from typing import Optional, TypedDict, Union
from flask_appbuilder.security.sqla.models import Role from flask_appbuilder.security.sqla.models import Role
from flask_login import AnonymousUserMixin from flask_login import AnonymousUserMixin
from superset.utils.backports import StrEnum
class GuestTokenUser(TypedDict, total=False): class GuestTokenUser(TypedDict, total=False):
username: str username: str
@ -27,7 +28,7 @@ class GuestTokenUser(TypedDict, total=False):
last_name: str last_name: str
class GuestTokenResourceType(Enum): class GuestTokenResourceType(StrEnum):
DASHBOARD = "dashboard" DASHBOARD = "dashboard"