Skip to content

Commit

Permalink
Merge pull request #186 from grafana/release-v3.11.0
Browse files Browse the repository at this point in the history
Release v3.11.0
  • Loading branch information
mostafa authored Jul 31, 2023
2 parents 842604e + 468e0ee commit 64e9cfb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 86 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: deploy

on: [push, pull_request]
on:
push:
branches:
- main
tags:
- v*
pull_request:

jobs:
test:
Expand All @@ -9,20 +15,17 @@ jobs:
strategy:
matrix:
versions:
- { "djangoVersion": "2.2.28", "pythonVersion": "3.7" }
- { "djangoVersion": "2.2.28", "pythonVersion": "3.8" }
- { "djangoVersion": "2.2.28", "pythonVersion": "3.9" }
- { "djangoVersion": "2.2.28", "pythonVersion": "3.10" }
- { "djangoVersion": "3.2.16", "pythonVersion": "3.7" }
- { "djangoVersion": "3.2.16", "pythonVersion": "3.8" }
- { "djangoVersion": "3.2.16", "pythonVersion": "3.9" }
- { "djangoVersion": "3.2.16", "pythonVersion": "3.10" }
- { "djangoVersion": "4.0.8", "pythonVersion": "3.8" }
- { "djangoVersion": "4.0.8", "pythonVersion": "3.9" }
- { "djangoVersion": "4.0.8", "pythonVersion": "3.10" }
- { "djangoVersion": "4.1.2", "pythonVersion": "3.8" }
- { "djangoVersion": "4.1.2", "pythonVersion": "3.9" }
- { "djangoVersion": "4.1.2", "pythonVersion": "3.10" }
- { "djangoVersion": "3.2.20", "pythonVersion": "3.7" }
- { "djangoVersion": "3.2.20", "pythonVersion": "3.8" }
- { "djangoVersion": "3.2.20", "pythonVersion": "3.9" }
- { "djangoVersion": "3.2.20", "pythonVersion": "3.10" }
- { "djangoVersion": "4.1.10", "pythonVersion": "3.8" }
- { "djangoVersion": "4.1.10", "pythonVersion": "3.9" }
- { "djangoVersion": "4.1.10", "pythonVersion": "3.10" }
- { "djangoVersion": "4.2.3", "pythonVersion": "3.8" }
- { "djangoVersion": "4.2.3", "pythonVersion": "3.9" }
- { "djangoVersion": "4.2.3", "pythonVersion": "3.10" }
- { "djangoVersion": "4.2.3", "pythonVersion": "3.11" }
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand Down Expand Up @@ -63,15 +66,13 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: cyclonedx-django-saml2-auth-${{ github.ref_name }}.json
path:
cyclonedx-django-saml2-auth-${{ github.ref_name }}.json
path: cyclonedx-django-saml2-auth-${{ github.ref_name }}.json
- name: Upload CycloneDX SBOM artifact for requirements_test.txt 💾
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
name: cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json
path:
cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json
path: cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json
- name: Publish package to PyPI 🎉
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ For IdP-initiated SSO, the user will be created if it doesn't exist. Still, for
- Original Author: Fang Li ([@fangli](https://github.com/fangli))
- Maintainer: Mostafa Moradian ([@mostafa](https://github.com/mostafa))
- Version support matrix:
| **Python** | **Django** | **django-saml2-auth** |
| --------------------------- | ---------- | --------------------- |
| 3.7.x, 3.8.x, 3.9.x, 3.10.x | 2.2.x | >=3.4.0 |
| 3.7.x, 3.8.x, 3.9.x, 3.10.x | 3.2.x | >=3.4.0 |
| 3.8.x, 3.9.x, 3.10.x | 4.0.x | >=3.4.0 |
| 3.8.x, 3.9.x, 3.10.x | 4.1.x | >=3.4.0 |

- Release logs are available [here](https://github.com/grafana/django-saml2-auth/releases). The old [release log file](RELEASE-LOG.md) still exist, and will be removed in future releases.
| **Python** | **Django** | **django-saml2-auth** | **End of Support<br/>(django-saml2-auth)** | **End of extended support<br/>(Django)** |
| ---------------------------- | ---------- | --------------------- | ------------------------------------------ | ---------------------------------------- |
| 3.7.x, 3.8.x, 3.9.x, 3.10.x | 2.2.x | >=3.4.0 | 3.10.0 | April 11, 2022 |
| 3.7.x, 3.8.x, 3.9.x, 3.10.x | 3.2.x | >=3.4.0 | | April 2024 |
| 3.8.x, 3.9.x, 3.10.x | 4.0.x | >=3.4.0 | 3.10.0 | April 1, 2023 |
| 3.8.x, 3.9.x, 3.10.x | 4.1.x | >=3.4.0 | | December 2023 |
| 3.8.x, 3.9.x, 3.10.x, 3.11.x | 4.2.x | >=3.4.0 | | April 2026 |

- Release logs are available [here](https://github.com/grafana/django-saml2-auth/releases).

- For contribution, read [contributing guide](CONTRIBUTING.md).

Expand Down
45 changes: 0 additions & 45 deletions RELEASE-LOG.md

This file was deleted.

12 changes: 2 additions & 10 deletions django_saml2_auth/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import jwt
from cryptography.hazmat.primitives import serialization
from dictor import dictor # type: ignore
from django import get_version
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, User
Expand All @@ -22,7 +21,6 @@
from jwt.algorithms import (get_default_algorithms, has_crypto,
requires_cryptography)
from jwt.exceptions import PyJWTError
from pkg_resources import parse_version


def create_new_user(email: str,
Expand Down Expand Up @@ -76,10 +74,7 @@ def create_new_user(email: str,
try:
groups = [Group.objects.get(name=group) for group in user_groups]
if groups:
if parse_version(get_version()) <= parse_version("1.8"):
user.groups = groups
else:
user.groups.set(groups)
user.groups.set(groups)
except Exception as exc:
raise SAMLAuthError("There was an error joining the user to the group.", extra={
"exc": exc,
Expand Down Expand Up @@ -162,10 +157,7 @@ def get_or_create_user(user: Dict[str, Any]) -> Tuple[bool, User]:
if should_create_new_groups:
groups.append(Group.objects.create(name=group_name_django))

if parse_version(get_version()) >= parse_version("2.0"):
target_user.groups.set(groups)
else:
target_user.groups = groups
target_user.groups.set(groups)

return (created, target_user)

Expand Down
6 changes: 3 additions & 3 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pytest==7.3.1
pytest==7.4.0
pytest-django==4.5.2
responses==0.23.1
mypy==1.3.0
mypy==1.4.1
flake8==5.0.4
django-stubs==4.2.0
types-pysaml2==1.0.1
types-setuptools==67.8.0.0
types-setuptools==68.0.0.3
types-pkg-resources==0.1.3
interrogate==1.5.0
coverage==7.2.7
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
setup(
name="grafana_django_saml2_auth",

version="3.10.0",
version="3.11.0",

description="Django SAML2 Authentication Made Easy.",
long_description=long_description,
Expand Down Expand Up @@ -53,6 +53,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],

keywords=[
Expand Down

0 comments on commit 64e9cfb

Please sign in to comment.