Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
react-native-digest-fetch
Advanced tools
Fetch which responds to digest challenges, built for react native
This package implements digest authentication for react native using the fetch library
Digest fetch takes the same parameters as whatwg/fetch, with the addition of two parameters: username
and password
.
If the server does not respond with a www-authenticate
header this function will act exactly like fetch typically does.
npm install --save react-native-digest-fetch
import fetch from 'react-native-digest-fetch';
...
digestFetch('http://api.test.com/endpoint/', {
method: 'POST',
headers: {
'content-type': 'application/json',
'custom-header': 'anythingyouwant',
},
body: JSON.stringify({
hello: 'world',
}),
username: 'DIGEST_AUTH_USERNAME',
password: 'DIGEST_AUTH_PASSWORD',
});
If you would like to use your own http interaction library, and just need the Digest header value, you can import getDigestHeaderValue
like so:
import { getDigestHeaderValue } from 'react-native-digest-fetch';
and use it like so
getDigestHeaderValue(serverHeaders['www-authenticate'], { url, method, headers, username, password });
This library has been tested on react-native and vanilla node, but has not been tested on a front-end node project.
FAQs
Fetch which responds to digest challenges, built for react native
The npm package react-native-digest-fetch receives a total of 13 weekly downloads. As such, react-native-digest-fetch popularity was classified as not popular.
We found that react-native-digest-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.