diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..697f24a --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,45 @@ +name: Python CI + +on: + workflow_dispatch: + +jobs: + package_repository: + runs-on: fool-runners + steps: + - name: Assume role + with: + role-to-assume: arn:aws:iam::653197303645:role/tmf/github-runner-role + aws-region: us-east-1 + uses: aws-actions/configure-aws-credentials@v4 + + - name: set_vars + id: set_vars + shell: bash + run: | + CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain tmf --query authorizationToken --output text) + echo "token=${CODEARTIFACT_AUTH_TOKEN}" >> $GITHUB_OUTPUT + + - name: Checkout code + uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install python dependencies + run: | + pip install -U pip + pip install . + pip install build + pip install setuptools_scm + pip install twine + + - name: Upload package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + run: | + python -m build --sdist --wheel --outdir dist/ . + twine upload --skip-existing --repository-url https://tmf-653197303645.d.codeartifact.us-east-1.amazonaws.com/pypi/fool-python/ -u aws -p ${{needs.package_repository.outputs.codeartifact_auth_token}} dist/* diff --git a/django_saml2_auth/views.py b/django_saml2_auth/views.py index 89abcfc..f3cca70 100644 --- a/django_saml2_auth/views.py +++ b/django_saml2_auth/views.py @@ -11,7 +11,7 @@ from django.http import HttpResponseRedirect from django.shortcuts import render from django.template import TemplateDoesNotExist -from django.utils.http import is_safe_url +from django.utils.http import url_has_allowed_host_and_scheme as is_safe_url from django.views.decorators.csrf import csrf_exempt from pkg_resources import parse_version import jwt diff --git a/setup.py b/setup.py index 95252d8..da85ee3 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name='django_saml2_auth', - version='2.3.9', + version='2.3.10', description='Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta', long_description=long_description,