diff --git a/.github/workflows/api-pull-request.yml b/.github/workflows/api-pull-request.yml index 734401d4571e..eaf2cb72c26b 100644 --- a/.github/workflows/api-pull-request.yml +++ b/.github/workflows/api-pull-request.yml @@ -43,6 +43,7 @@ jobs: - name: Install poetry run: pipx install poetry + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/platform-docker-publish-all-features-image.yml b/.github/workflows/platform-docker-publish-all-features-image.yml index 60ccddafeda4..e8d1fed8e299 100644 --- a/.github/workflows/platform-docker-publish-all-features-image.yml +++ b/.github/workflows/platform-docker-publish-all-features-image.yml @@ -121,7 +121,8 @@ jobs: context: . build-args: | SAML_INSTALLED=1 - POETRY_OPTS=--with saml,auth-controller + POETRY_OPTS=--with saml,auth-controller,ldap + GH_TOKEN=${{ secrets.GH_PRIVATE_ACCESS_TOKEN }} stop-runner: needs: [start-runner, build-dockerhub] diff --git a/Dockerfile b/Dockerfile index e9ab0a4e176f..d983ae6e66ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,11 @@ ARG POETRY_VIRTUALENVS_CREATE=false RUN make install-poetry ENV PATH="$PATH:/root/.local/bin" +ARG GH_TOKEN +RUN if [ -n "${GH_TOKEN}" ]; \ + then echo "https://${GH_TOKEN}:@github.com" > ${HOME}/.git-credentials \ + && git config --global credential.helper store; fi; + ARG POETRY_OPTS RUN make install-packages opts="${POETRY_OPTS}" diff --git a/api/Dockerfile b/api/Dockerfile index 862e6e2bbd4b..abd1af5c3c8b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -9,6 +9,11 @@ ARG POETRY_VIRTUALENVS_CREATE=false RUN make install-poetry ENV PATH="$PATH:/root/.local/bin" +ARG GH_TOKEN +RUN if [ -n "${GH_TOKEN}" ]; \ + then echo "https://${GH_TOKEN}:@github.com" > ${HOME}/.git-credentials \ + && git config --global credential.helper store; fi; + ARG POETRY_OPTS RUN make install-packages opts="${POETRY_OPTS}" diff --git a/api/poetry.lock b/api/poetry.lock index 37457b73f408..829809547016 100644 --- a/api/poetry.lock +++ b/api/poetry.lock @@ -1067,6 +1067,22 @@ files = [ {file = "django_ordered_model-3.4.3-py3-none-any.whl", hash = "sha256:5aa58277b81b4ca93fb18caf15069af604bac5c5146d2c29aae56da07a86ef1b"}, ] +[[package]] +name = "django-python3-ldap" +version = "0.15.5" +description = "Django LDAP user authentication backend for Python 3." +optional = false +python-versions = "*" +files = [ + {file = "django-python3-ldap-0.15.5.tar.gz", hash = "sha256:44cac6638184cdefb2ed2934a6ca20c9c2512d36bc3ddb801d26fcf119cfbc0f"}, + {file = "django_python3_ldap-0.15.5-py3-none-any.whl", hash = "sha256:7f1142a3ca4500fe433d2c5d5aadb9fafa21774a36d37acb4a939c7cff130a0c"}, +] + +[package.dependencies] +django = ">=1.11" +ldap3 = ">=2.5,<3" +pyasn1 = ">=0.4.6,<0.5" + [[package]] name = "django-ses" version = "3.5.0" @@ -1471,6 +1487,25 @@ pydantic = ">=1.10.8,<2" pydantic-collections = ">=0.4.0,<1" semver = "2.13.0" +[[package]] +name = "flagsmith-ldap" +version = "0.0.2" +description = "LDAP plugin for Flagsmith application." +optional = false +python-versions = "^3.10" +files = [] +develop = false + +[package.dependencies] +django = "~3.2.23" +django-python3-ldap = "^0.15.4" + +[package.source] +type = "git" +url = "https://github.com/flagsmith/flagsmith-ldap" +reference = "v0.0.2" +resolved_reference = "92cafa027e552642ff5dc72c999afa8f2e7349bf" + [[package]] name = "flake8" version = "6.0.0" @@ -2018,6 +2053,20 @@ files = [ {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, ] +[[package]] +name = "ldap3" +version = "2.9.1" +description = "A strictly RFC 4510 conforming LDAP V3 pure Python client library" +optional = false +python-versions = "*" +files = [ + {file = "ldap3-2.9.1-py2.py3-none-any.whl", hash = "sha256:5869596fc4948797020d3f03b7939da938778a0f9e2009f7a072ccf92b8e8d70"}, + {file = "ldap3-2.9.1.tar.gz", hash = "sha256:f3e7fc4718e3f09dda568b57100095e0ce58633bcabbed8667ce3f8fbaa4229f"}, +] + +[package.dependencies] +pyasn1 = ">=0.4.6" + [[package]] name = "markupsafe" version = "2.1.3" @@ -2758,13 +2807,13 @@ files = [ [[package]] name = "pyasn1" -version = "0.5.0" -description = "Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208)" +version = "0.4.8" +description = "ASN.1 types and codecs" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +python-versions = "*" files = [ - {file = "pyasn1-0.5.0-py2.py3-none-any.whl", hash = "sha256:87a2121042a1ac9358cabcaf1d07680ff97ee6404333bacca15f76aa8ad01a57"}, - {file = "pyasn1-0.5.0.tar.gz", hash = "sha256:97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde"}, + {file = "pyasn1-0.4.8-py2.py3-none-any.whl", hash = "sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d"}, + {file = "pyasn1-0.4.8.tar.gz", hash = "sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"}, ] [[package]] @@ -4343,4 +4392,4 @@ requests = ">=2.7,<3.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "019fe88608627d855f4e01795713b69dd57b0d54f2d469d6fe687d01b1331870" +content-hash = "5bb4ae1878deaa542af80e69cb9c735f12fd24bc56379176e0b19715004c0c0f" diff --git a/api/pyproject.toml b/api/pyproject.toml index 6271dff5afd5..df302d17dcaa 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -115,6 +115,12 @@ optional = true [tool.poetry.group.saml.dependencies] pysaml2 = "^7.0.0" +[tool.poetry.group.ldap] +optional = true + +[tool.poetry.group.ldap.dependencies] +flagsmith-ldap = { git = "https://github.com/flagsmith/flagsmith-ldap", tag = "v0.0.2" } + [tool.poetry.group.dev.dependencies] django-test-migrations = "~1.2.0" responses = "~0.22.0"