Skip to content

Commit 1ddd82c

Browse files
authored
Merge branch 'master' into fix-marshmallow-schema-fk-key-error
2 parents d2439fb + fd92903 commit 1ddd82c

35 files changed

Lines changed: 425 additions & 178 deletions

.github/workflows/ci.yml

Lines changed: 75 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-22.04
4242
strategy:
4343
matrix:
44-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
44+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4545
env:
4646
SQLALCHEMY_DATABASE_URI:
4747
postgresql+psycopg2://pguser:pguserpassword@127.0.0.1:15432/app
@@ -62,16 +62,24 @@ jobs:
6262
python-version: ${{ matrix.python-version }}
6363
- name: Run openldap
6464
run: |
65-
docker run -d \
66-
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
67-
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
68-
-e LDAP_URI=ldap://openldap:1389 \
69-
-e LDAP_BASE=dc=example,dc=org \
70-
-e LDAP_ADMIN_USERNAME=admin \
71-
-e LDAP_ADMIN_PASSWORD=admin_password \
72-
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
73-
-p 1389:1389 \
74-
bitnamilegacy/openldap:2.6
65+
for attempt in 1 2 3; do
66+
if docker run -d \
67+
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
68+
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
69+
-e LDAP_URI=ldap://openldap:1389 \
70+
-e LDAP_BASE=dc=example,dc=org \
71+
-e LDAP_ADMIN_USERNAME=admin \
72+
-e LDAP_ADMIN_PASSWORD=admin_password \
73+
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
74+
-p 1389:1389 \
75+
bitnamilegacy/openldap:2.6; then
76+
break
77+
fi
78+
if [ "${attempt}" -eq 3 ]; then
79+
exit 1
80+
fi
81+
sleep 5
82+
done
7583
- name: Install dependencies
7684
run: |
7785
sudo apt-get update
@@ -112,16 +120,24 @@ jobs:
112120
python-version: ${{ matrix.python-version }}
113121
- name: Run openldap
114122
run: |
115-
docker run -d \
116-
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
117-
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
118-
-e LDAP_URI=ldap://openldap:1389 \
119-
-e LDAP_BASE=dc=example,dc=org \
120-
-e LDAP_ADMIN_USERNAME=admin \
121-
-e LDAP_ADMIN_PASSWORD=admin_password \
122-
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
123-
-p 1389:1389 \
124-
bitnamilegacy/openldap:2.6
123+
for attempt in 1 2 3; do
124+
if docker run -d \
125+
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
126+
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
127+
-e LDAP_URI=ldap://openldap:1389 \
128+
-e LDAP_BASE=dc=example,dc=org \
129+
-e LDAP_ADMIN_USERNAME=admin \
130+
-e LDAP_ADMIN_PASSWORD=admin_password \
131+
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
132+
-p 1389:1389 \
133+
bitnamilegacy/openldap:2.6; then
134+
break
135+
fi
136+
if [ "${attempt}" -eq 3 ]; then
137+
exit 1
138+
fi
139+
sleep 5
140+
done
125141
- name: Install dependencies
126142
run: |
127143
sudo apt-get update
@@ -141,7 +157,7 @@ jobs:
141157
runs-on: ubuntu-22.04
142158
strategy:
143159
matrix:
144-
python-version: ["3.10", "3.13"]
160+
python-version: ["3.10", "3.11", "3.12", "3.13"]
145161
env:
146162
SQLALCHEMY_DATABASE_URI: |
147163
mysql+mysqldb://mysqluser:mysqluserpassword@127.0.0.1:13306/app?charset=utf8mb4&binary_prefix=true
@@ -163,16 +179,24 @@ jobs:
163179
python-version: ${{ matrix.python-version }}
164180
- name: Run openldap
165181
run: |
166-
docker run -d \
167-
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
168-
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
169-
-e LDAP_URI=ldap://openldap:1389 \
170-
-e LDAP_BASE=dc=example,dc=org \
171-
-e LDAP_ADMIN_USERNAME=admin \
172-
-e LDAP_ADMIN_PASSWORD=admin_password \
173-
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
174-
-p 1389:1389 \
175-
bitnamilegacy/openldap:2.6
182+
for attempt in 1 2 3; do
183+
if docker run -d \
184+
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
185+
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
186+
-e LDAP_URI=ldap://openldap:1389 \
187+
-e LDAP_BASE=dc=example,dc=org \
188+
-e LDAP_ADMIN_USERNAME=admin \
189+
-e LDAP_ADMIN_PASSWORD=admin_password \
190+
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
191+
-p 1389:1389 \
192+
bitnamilegacy/openldap:2.6; then
193+
break
194+
fi
195+
if [ "${attempt}" -eq 3 ]; then
196+
exit 1
197+
fi
198+
sleep 5
199+
done
176200
- name: Install dependencies
177201
run: |
178202
sudo apt-get update
@@ -192,7 +216,7 @@ jobs:
192216
runs-on: ubuntu-22.04
193217
strategy:
194218
matrix:
195-
python-version: ["3.10", "3.13"]
219+
python-version: ["3.10", "3.11", "3.12", "3.13"]
196220
env:
197221
SQLALCHEMY_DATABASE_URI: |
198222
mssql+pyodbc://sa:Password_123@localhost:11433/master?driver=FreeTDS
@@ -212,16 +236,24 @@ jobs:
212236
python-version: ${{ matrix.python-version }}
213237
- name: Run openldap
214238
run: |
215-
docker run -d \
216-
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
217-
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
218-
-e LDAP_URI=ldap://openldap:1389 \
219-
-e LDAP_BASE=dc=example,dc=org \
220-
-e LDAP_ADMIN_USERNAME=admin \
221-
-e LDAP_ADMIN_PASSWORD=admin_password \
222-
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
223-
-p 1389:1389 \
224-
bitnamilegacy/openldap:2.6
239+
for attempt in 1 2 3; do
240+
if docker run -d \
241+
-v '${{ github.workspace }}/docker/openldap/ldifs:/ldifs' \
242+
-v '${{ github.workspace }}/docker/openldap/schemas/memberof.ldif:/opt/bitnami/openldap/etc/schema/memberof.ldif' \
243+
-e LDAP_URI=ldap://openldap:1389 \
244+
-e LDAP_BASE=dc=example,dc=org \
245+
-e LDAP_ADMIN_USERNAME=admin \
246+
-e LDAP_ADMIN_PASSWORD=admin_password \
247+
-e LDAP_EXTRA_SCHEMAS=cosine,inetorgperson,nis,memberof \
248+
-p 1389:1389 \
249+
bitnamilegacy/openldap:2.6; then
250+
break
251+
fi
252+
if [ "${attempt}" -eq 3 ]; then
253+
exit 1
254+
fi
255+
sleep 5
256+
done
225257
- name: Install dependencies
226258
run: |
227259
sudo apt-get update

CHANGELOG.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
Flask-AppBuilder ChangeLog
22
==========================
33

4+
Improvements and Bug fixes on 5.2.2
5+
-----------------------------------
6+
7+
- fix: anchor OAuth email whitelist regex to end of string (#2470) [Daniel Vaz Gaspar]
8+
- fix: switch from uuid1 to uuid4 for better randomness (#2435) [Rin]
9+
- fix: escape special characters in LDAP search filter username (#2469) [Daniel Vaz Gaspar]
10+
- fix: warn when Azure OAuth JWT signature verification is disabled (#2468) [Daniel Vaz Gaspar]
11+
- ci: restore Python 3.11 and 3.12 to CI test matrix (#2467) [Daniel Vaz Gaspar]
12+
- chore: Increase upper bound for Flask-Limiter dependency (#2465) [Erik Cederstrand]
13+
- fix: enforce API login provider validation when AUTH_TYPE has no API provider (#2462) [Daniel Vaz Gaspar]
14+
- fix(ci): update MSSQL Docker image to 2022-latest (#2460) [Daniel Vaz Gaspar]
15+
- chore: remove PSModel/PSSession example classes from package (#2457) [Daniel Vaz Gaspar]
16+
417
Improvements and Bug fixes on 5.2.1
518
-----------------------------------
619

docs/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ Specify a list of OAUTH_PROVIDERS in **config.py** that you want to allow for yo
324324
"client_kwargs": {
325325
"scope": "User.read name preferred_username email profile upn",
326326
"resource": "AZURE_APPLICATION_ID",
327-
# Optionally enforce signature JWT verification
328-
"verify_signature": False
327+
# Recommended: verify Azure JWT signature
328+
"verify_signature": True
329329
},
330330
"request_token_url": None,
331331
"access_token_url": "https://login.microsoftonline.com/AZURE_TENANT_ID/oauth2/token",

flask_appbuilder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "Daniel Vaz Gaspar"
2-
__version__ = "5.2.1"
2+
__version__ = "5.2.2"
33

44
from .actions import action # noqa: F401
55
from .api import ModelRestApi # noqa: F401

flask_appbuilder/_compat.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
Some py2/py3 compatibility support based on a stripped down
4-
version of six so we don't have to depend on a specific version
5-
of it.
3+
Some py2/py3 compatibility support based on a stripped down
4+
version of six so we don't have to depend on a specific version
5+
of it.
66
7-
:copyright: (c) 2013 by Armin Ronacher.
8-
:license: BSD, see LICENSE for more details.
7+
:copyright: (c) 2013 by Armin Ronacher.
8+
:license: BSD, see LICENSE for more details.
99
"""
10+
1011
import sys
1112

1213
PY2 = sys.version_info[0] == 2

flask_appbuilder/baseviews.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def create_blueprint(
8686
endpoint: Optional[str] = None,
8787
static_folder: Optional[str] = None,
8888
):
89-
...
89+
pass
9090

9191
def get_uninit_inner_views(self):
9292
"""

flask_appbuilder/cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from .const import AUTH_DB, AUTH_LDAP, AUTH_OAUTH, AUTH_REMOTE_USER
1616

17-
1817
SQLA_REPO_URL = (
1918
"https://github.com/dpgaspar/Flask-AppBuilder-Skeleton/archive/refs/heads/v5.zip"
2019
)

flask_appbuilder/filemanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def resize(self, image, size):
197197
:param image: The image object
198198
:param size: size is PIL tuple (width, height, force) ex: (200,100,True)
199199
"""
200-
(width, height, force) = size
200+
width, height, force = size
201201

202202
if image.size[0] > width or image.size[1] > height:
203203
if force:
@@ -224,7 +224,7 @@ def get_save_format(self, filename, image):
224224

225225

226226
def uuid_namegen(file_data):
227-
return str(uuid.uuid1()) + "_sep_" + file_data.filename
227+
return str(uuid.uuid4()) + "_sep_" + file_data.filename
228228

229229

230230
def get_file_original_name(name):

flask_appbuilder/models/generic/filters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from ..filters import BaseFilter, BaseFilterConverter
44

5-
65
__all__ = [
76
"GenericFilterConverter",
87
"FilterNotContains",

flask_appbuilder/models/mixins.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from sqlalchemy.orm import relationship
88
import sqlalchemy.types as types
99

10-
1110
log = logging.getLogger(__name__)
1211

1312

0 commit comments

Comments
 (0)