
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Javascript client for restfulpy
npm install restfulpy
sudo apt-get install redis-server
Create a postgres database named: restfulpymockupserver
import { BrowserSession, Authenticator, httpClient, Response } from 'restfulpy'
class LocalAuthenticator extends Authenticator {
login(credentials) {
// Add your login method for example:
return httpClient(
`http://example.org/api/v1/sessions`,
{
verb: 'POST',
payload: this.constructor.validateCredentials(credentials)
},
(...args) => {
return new Response(null, ...args)
}
)
.then(resp => {
this.token = resp.json.token
return Promise.resolve(resp)
})
.catch(resp => {
this.deleteToken()
return Promise.reject(resp)
})
}
}
let authenticator = new LocalAuthenticator()
const errorHandler = {
401: (status, redirectUrl) => {
// Your handler for 401 error
// You can add handler for each status code
}
}
let client = new BrowserSession(
'http://example.org/api/v1',
undefined,
authenticator,
errorHandlers
)
// Login
client
.login({ email: 'user1@example.com', password: '123456' })
.then(resp => {
// Authentication success, so
console.log(resp.json.token) // is not null
console.log(client.authenticator.authenticated) // is true
})
.catch(resp => {
throw resp.error
})
// Posting some data to `http://example.org/api/v1/echo`
client
.request('echo', 'POST')
.addParameters({ item1: 'Value1' })
.send()
.then(resp => {
console.log(resp.status) // Is 200
console.log(resp.json)
console.log(resp.getHeader('Content-Type'))
})
.catch(resp => {
console.log(resp.status)
throw resp.error
})
// Logout
client.logout()
client.metadata.ModelName.get(1).done(models => {
// Use model
})
client.metadata.ModelName.load().done(models => {
// Use models
})
git clone <repo> && cd into/cloned/repo
npm install
sudo apt-get install redis-server
npm run build
An instance of the restfulpy is required as a mock-up server before running
tests, see the mockup-server-karma.py and tests directory to understand why you need to setup a python virtual env
to run tests.
Adding some stuff into the ~/.bashrc file.
alias v.activate="source /usr/local/bin/virtualenvwrapper.sh"
export VIRTUALENVWRAPPER_PYTHON="$(which python3.6)"
Re-source the ~/.bashrc
source ~/.bashrc
Sourcing the virtualenv wrapper.
v.activate
Creating a dedicated virtualenv for this project.
mkvirtualenv --python=$(which python3.6) restfulpy
Installing the python dependencies
pip install "restfulpy >= 1.1.2a1"
Finally! Running the tests.
npm run test
Or,
npm run test -- --no-single-run
To keep the browser open for more investigation and watch for changes. see karma documents for more info.
![]() | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|
| 17 | 41 | 12.0 | 9 | 28 |
FAQs
A javascript client for restfulpy
We found that restfulpy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.