Skip to content

Commit

Permalink
Merge branch 'issue-161-flask' into 'main'
Browse files Browse the repository at this point in the history
update to flask 3

See merge request yaal/canaille!163
  • Loading branch information
azmeuk committed Dec 14, 2023
2 parents c563646 + a2683df commit 23923a6
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 35 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
Changed
*******

- Convert all the png in webp. :pr:`182`
- Convert all the png in webp. :pr:`162`
- Update to flask 3 :issue:`161` :pr:`163`

[0.0.37] - 2023-12-01
=====================

Fixed
*****

- Handle 4xx and 5xx error codes with htmx. :issue:`171` :pr:`181`
- Handle 4xx and 5xx error codes with htmx. :issue:`171` :pr:`161`

[0.0.36] - 2023-12-01
=====================
Expand Down
29 changes: 15 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ include = ["canaille/translations/*/LC_MESSAGES/*.mo"]

[tool.poetry.dependencies]
python = "^3.8"
flask = ">=2.2.2 <2.3"
flask-wtf = "^1.1.1"
flask = "^3.0.0"
flask-wtf = "^1.2.1"
wtforms = "^3.1.1"
werkzeug = ">=2.2.2 <2.3"

# extra : front
email_validator = {version = "^2.0.0", optional=true}
Expand Down
1 change: 1 addition & 0 deletions tests/app/test_mails.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@pytest.fixture
def configuration(configuration, httpserver):
configuration["SERVER_NAME"] = f"{httpserver.host}:{httpserver.port}"
configuration["WTF_CSRF_ENABLED"] = False
return configuration


Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def configuration(smtpd):
smtpd.config.use_starttls = True
conf = {
"SECRET_KEY": gen_salt(24),
"SERVER_NAME": "canaille.test",
"JAVASCRIPT": False,
"LOGO": "/static/img/canaille-head.webp",
"TIMEZONE": "UTC",
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_registration_with_email_validation(testclient, backend, smtpd):
hash=payload.build_hash(),
_external=True,
)
text_mail = str(smtpd.messages[0].get_payload()[0]).replace("=\n", "")
text_mail = smtpd.messages[0].get_payload()[0].get_payload(decode=True).decode()
assert registration_url in text_mail

assert not models.User.query()
Expand Down
4 changes: 2 additions & 2 deletions tests/oidc/test_dynamic_client_registration_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_get(testclient, backend, client, user):
"https://mydomain.tld/redirect2",
],
"registration_access_token": "static-token",
"registration_client_uri": f"http://localhost/oauth/register/{client.client_id}",
"registration_client_uri": f"http://canaille.test/oauth/register/{client.client_id}",
"token_endpoint_auth_method": "client_secret_basic",
"grant_types": [
"password",
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_update(testclient, backend, client, user):
"client_secret_expires_at": 0,
"redirect_uris": ["https://newname.example.org/callback"],
"registration_access_token": "static-token",
"registration_client_uri": f"http://localhost/oauth/register/{client.client_id}",
"registration_client_uri": f"http://canaille.test/oauth/register/{client.client_id}",
"token_endpoint_auth_method": "none",
"grant_types": ["refresh_token"],
"response_types": ["code", "token"],
Expand Down
26 changes: 13 additions & 13 deletions tests/oidc/test_well_known.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def test_oauth_authorization_server(testclient):
res = testclient.get("/.well-known/oauth-authorization-server", status=200).json
assert "https://auth.mydomain.tld" == res["issuer"]
assert res == {
"authorization_endpoint": "http://localhost/oauth/authorize",
"authorization_endpoint": "http://canaille.test/oauth/authorize",
"code_challenge_methods_supported": ["plain", "S256"],
"introspection_endpoint": "http://localhost/oauth/introspect",
"introspection_endpoint": "http://canaille.test/oauth/introspect",
"issuer": "https://auth.mydomain.tld",
"jwks_uri": "http://localhost/oauth/jwks.json",
"registration_endpoint": "http://localhost/oauth/register",
"jwks_uri": "http://canaille.test/oauth/jwks.json",
"registration_endpoint": "http://canaille.test/oauth/register",
"response_types_supported": [
"code",
"token",
Expand All @@ -27,7 +27,7 @@ def test_oauth_authorization_server(testclient):
"phone",
"groups",
],
"token_endpoint": "http://localhost/oauth/token",
"token_endpoint": "http://canaille.test/oauth/token",
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"private_key_jwt",
Expand All @@ -36,15 +36,15 @@ def test_oauth_authorization_server(testclient):
],
"token_endpoint_auth_signing_alg_values_supported": ["RS256", "ES256"],
"ui_locales_supported": g.available_language_codes,
"userinfo_endpoint": "http://localhost/oauth/userinfo",
"userinfo_endpoint": "http://canaille.test/oauth/userinfo",
}


def test_openid_configuration(testclient):
res = testclient.get("/.well-known/openid-configuration", status=200).json
assert "https://auth.mydomain.tld" == res["issuer"]
assert res == {
"authorization_endpoint": "http://localhost/oauth/authorize",
"authorization_endpoint": "http://canaille.test/oauth/authorize",
"claims_supported": [
"sub",
"iss",
Expand All @@ -65,12 +65,12 @@ def test_openid_configuration(testclient):
"nonce",
],
"code_challenge_methods_supported": ["plain", "S256"],
"end_session_endpoint": "http://localhost/oauth/end_session",
"end_session_endpoint": "http://canaille.test/oauth/end_session",
"id_token_signing_alg_values_supported": ["RS256", "ES256", "HS256"],
"introspection_endpoint": "http://localhost/oauth/introspect",
"introspection_endpoint": "http://canaille.test/oauth/introspect",
"issuer": "https://auth.mydomain.tld",
"jwks_uri": "http://localhost/oauth/jwks.json",
"registration_endpoint": "http://localhost/oauth/register",
"jwks_uri": "http://canaille.test/oauth/jwks.json",
"registration_endpoint": "http://canaille.test/oauth/register",
"response_types_supported": [
"code",
"token",
Expand All @@ -88,7 +88,7 @@ def test_openid_configuration(testclient):
"groups",
],
"subject_types_supported": ["pairwise", "public"],
"token_endpoint": "http://localhost/oauth/token",
"token_endpoint": "http://canaille.test/oauth/token",
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"private_key_jwt",
Expand All @@ -97,5 +97,5 @@ def test_openid_configuration(testclient):
],
"token_endpoint_auth_signing_alg_values_supported": ["RS256", "ES256"],
"ui_locales_supported": g.available_language_codes,
"userinfo_endpoint": "http://localhost/oauth/userinfo",
"userinfo_endpoint": "http://canaille.test/oauth/userinfo",
}

0 comments on commit 23923a6

Please sign in to comment.