Easy-to-use implementation of http digest auth (SWISH specific) for axios in node environments.
npm install @juriskop/axios-http-digest-authThis library exports a client which can be used to query the SWISH API and even allows using HTTP Digest Auth. This Digest Auth implementation is only tested against SWISH and only supports one specification case (qop = auth; MD5 hash).
``typescript
import axios from "axios";
// Setup
const axiosInstance = axios.create({});
httpDigestAuth(this.axiosInstance, {username: 'Your Username', password: 'Your Password'});
// Use it as you would a normal axios instance
axiosInstance.get('https://example.com/program.pl?format=json');
`
`bash`Optional for running the provided tests; Replace values appropriately
cp env.example. .env
`bashRunning tests
npm run test