
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
@halo-dev/rest-api-client
Advanced tools
HTTP Client for Halo RESTful API.
npm install @halo-dev/rest-api-client
use require or import to import the library.
// CommonJS
const { HaloRestAPIClient } = require('@halo-dev/rest-api-client')
// ES modules
import { HaloRestAPIClient } from '@halo-dev/rest-api-client'
const client = new HaloRestAPIClient({
baseUrl: 'https://example.halo.run',
})
The auth parameter supports the following ways:
auth: {
apiToken: process.env.HALO_API_TOKEN
}
auth: {
adminToken: process.env.HALO_ADMIN_TOKEN
}
auth: {
type: "customizeAuth",
authHeader
:
"Admin-Authorization",
getToken()
{
return localStorage.getItem("Access_Token")
}
}
auth: {
oAuthToken: process.env.HALO_OAUTH_TOKEN
}
Basic Auth
const client = new HaloRestAPIClient({
baseUrl: 'https://example.halo.run',
// Use basic authentication
basicAuth: { username: 'user', password: 'password' },
})
In addition to this, it also supports automatic authentication of Token Provider:
import {
HaloRestAPIClient,
LocalStorageTokenStore,
// FileTokenStore,
// TokenStore,
DefaultTokenProvider,
} from '@halo-dev/rest-clint-api'
// Use LocalStorageTokenStore to persistence AccessToken to localStorage(in browser only)
// you can use FileTokenStore if in the Node environment.
// If there is no suitable Token store implemention, you can implement your own token storage strategy through the TokenStore interface.
const localStorageTokenStore = new LocalStorageTokenStore()
// halo api base url.
const baseUrl = process.env.VUE_APP_BASE_URL
const haloRestApiClient = new HaloRestAPIClient({
baseUrl: baseUrl,
})
const buildTokenProvider = (credentials) => {
return new DefaultTokenProvider(
{
...credentials,
},
baseUrl,
localStorageTokenStore,
)
}
const tokenProvider = buildTokenProvider({
username: 'your halo username',
password: 'your password',
})
haloRestApiClient.setTokenProvider(tokenProvider)
// now you can use haloRestApiClient to build your api client
const haloRestApiClient = new HaloRestAPIClient({
baseUrl: 'https://example.halo.run',
basicAuth: { username: 'user', password: 'password' },
})
// build http client to perform http request
const client = haloRestApiClient.buildHttpClient()
// api parameters
const parameters = {}
// http get
client.get('https://example.halo.run', parameters)
// http post
client.post('https://example.halo.run', parameters)
FAQs
Halo REST API client for JavaScript
The npm package @halo-dev/rest-api-client receives a total of 102 weekly downloads. As such, @halo-dev/rest-api-client popularity was classified as not popular.
We found that @halo-dev/rest-api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.