As additional feature to add in this proxy - npm registry.
I've created little POC here: https://github.com/DmitriyStoyanov/aws-codeartifact-python-proxy/tree/npm_proxy
based on your code and it works.
For the moment my code will broke pypi support, because i've tried just to optimize your code to npm registry instead of pypi
Need some more time to perfect it and add ability to use it in both cases - pypi and npm, but it works.
So possibly we can add npm registry feature in your proxy. What do you think about it?