Page MenuHomeSoftware Heritage

Boostrap swh-auth module for authentication
Closed, MigratedEdits Locked

Description

We started implementing keycloak authentication in the deposit [1]

While the initial attempt is working, it's not enough.
To iterate over this work, that will need some more code which is actually already present in swh-web.

So we need to bootstrap a new module swh-auth which moves that common code there.

We (@anlambert and i) see 2 modules for it:

  • swh.auth which generically wraps the keycloak dependency collaborator classes/functions
  • swh.auth[django] Optional dependency on django

Bonus point for moving the current swh-web-client cli which generates token in that new module (
but that's not an immediate concern).

Deliverable:

  • 1 new module (with shared code and pytest fixture(s)): swh.auth, swh.auth[django])
  • jenkins builds (tests, pypi, debian)
  • 2 debian packages (python3-swh.auth and python3-swh.auth.django)

[1] D5137

Event Timeline

ardumont triaged this task as Normal priority.Mar 2 2021, 5:47 PM
ardumont created this task.

Create the git repository into the forge [1]

[1] https://forge.softwareheritage.org/source/swh-auth/

Then bootstrap module:

$ pwd
/home/tony/work/inria/repo/swh/swh-environment
$ git clone https://forge.softwareheritage.org/source/swh-auth
Cloning into 'swh-auth'...
warning: You appear to have cloned an empty repository.
$ ./bin/init-py-repo swh-auth
sending incremental file list
.gitignore
.pre-commit-config.yaml
AUTHORS
CODE_OF_CONDUCT.md
CONTRIBUTORS
LICENSE
MANIFEST.in
Makefile
README.md
mypy.ini
pyproject.toml
pytest.ini
requirements-swh.txt
requirements-test.txt
requirements.txt
setup.cfg
setup.py
tox.ini
docs/
docs/.gitignore
docs/Makefile
docs/conf.py
docs/index.rst
docs/_static/
docs/_static/.placeholder
docs/_templates/
docs/_templates/.placeholder
swh/
swh/__init__.py
swh/foo/
swh/foo/__init__.py
swh/foo/bar.py
swh/foo/cli.py
swh/foo/py.typed
swh/foo/tests/
swh/foo/tests/__init__.py
swh/foo/tests/test_nothing.py

sent 48,156 bytes  received 638 bytes  97,588.00 bytes/sec
total size is 45,677  speedup is 0.94
[master (root-commit) 5b698bd] import template from swh-py-template (init-py-repo)
 31 files changed, 1036 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .pre-commit-config.yaml
 create mode 100644 AUTHORS
 create mode 100644 CODE_OF_CONDUCT.md
 create mode 100644 CONTRIBUTORS
 create mode 100644 LICENSE
 create mode 100644 MANIFEST.in
 create mode 100644 Makefile
 create mode 100644 README.md
 create mode 100644 docs/.gitignore
 create mode 100644 docs/Makefile
 create mode 100644 docs/_static/.placeholder
 create mode 100644 docs/_templates/.placeholder
 create mode 100644 docs/conf.py
 create mode 100644 docs/index.rst
 create mode 100644 mypy.ini
 create mode 100644 pyproject.toml
 create mode 100644 pytest.ini
 create mode 100644 requirements-swh.txt
 create mode 100644 requirements-test.txt
 create mode 100644 requirements.txt
 create mode 100644 setup.cfg
 create mode 100755 setup.py
 create mode 100644 swh/__init__.py
 create mode 100644 swh/foo/__init__.py
 create mode 100644 swh/foo/bar.py
 create mode 100644 swh/foo/cli.py
 create mode 100644 swh/foo/py.typed
 create mode 100644 swh/foo/tests/__init__.py
 create mode 100644 swh/foo/tests/test_nothing.py
 create mode 100644 tox.ini

And now go on and adapt the tidbits:

  • setup.py to reference the right module name and url
  • README.md with some description of the module

The work on debian package will be done when required.

ardumont changed the task status from Open to Work in Progress.Mar 4 2021, 7:00 PM
ardumont updated the task description. (Show Details)

Well, it can be closed now.

python3-swh.auth
python3-swh.auth.django

v0.3.0 got released.

Further improvments can be dealt with independently from this task.