2024-12-31-pydev2
Adding SSL and validate certificates
Server side
- ssl server
- https server
Client side
- https://www.electricmonk.nl/log/2018/06/02/ssl-tls-client-certificate-verification-with-python-v3-4-sslcontext/
- Using asyncio with SSL https://rob-blackbourn.medium.com/secure-communication-with-python-ssl-certificate-and-asyncio-939ae53ccd35
- https requests: https://www.techcoil.com/blog/how-to-send-a-http-request-with-client-certificate-private-key-password-secret-in-python-3/
Packaging code
- Put all python code in a directory
- Create
__init__.py
, which is used when importing the directory. - Create
__main__.py
, which is called when runningpython -m module
- Refs:
Things to watch
- FastAPI
- Interesting way for creating REST APIs.
- SQLModel
- Not mature enough. Let's wait until migrations are documented and decide them.
More sphinx
After using sphinx for document generation I find it quite prickly with the slightest mistake breaking thins and error messages that are very uninformative.
Todo:
- Jinja2 templates or other var substs
- conf.py
- Handle meta variables
- How source code is found
- sphinxarg.ext - argparse auto docs
- myst_parser - markdown
- autodoc2 - automatic API doc generation
- html_static_path