![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
consul-locator-tracer
Advanced tools
For the older version, check docs at 1.0.3 docs
This is consul wrapper for discovery and detect a service changed.
Usage:
var locator = require('consul-locator')
Initialize a new locator wrapper
locator.use({host: '127.0.0.1'})
Options
Discovery a service
Options
service (String): service name
dc (String, optional): datacenter (defaults to local for agent)
tag (String, optional): filter by tag
var service = new locator.Service('hello-world')
Methods:
sevice.watch((services) => {
//Do with changed data
console.log(services.next())
})
service.subscribe('hello/tcp/port', (value) => {
// Do something with changed value of key `hello/tcp/port`
console.log(`tcp port has been changed to ${value}`)
});
Get service by circular
/*
* services = [10.0.0.1:123, 10.0.0.2:234]
*
*/
services.next().ServiceAddress // 10.0.0.1:123
services.next().ServiceAddress // 10.0.0.2:234
Check is services list is empty
services.isEmpty()
for(var service of services) {
console.log(service)
}
Inject service as a query
locator.inject(['push-api', 'sms-api', (push_api, sms_api) => {
console.log(push_api.ServiceAddess) // example: 10.60.3.32
}])
The http client wrapper for request API, It's working like request lib, but has some difference, the uri input could be like service://service-name/api/path
$http.get('service://hydra-web-api/users/17/online').then((res) => {
console.log(res.status) // http status code
console.log(res.body) // http response body
console.log(res.response) // full response object
})
var data = {message: 'hello world'}
$http.post('service://hydra-web-api/users/17/messages', {
headers: {
'Authorization': 'd2226611-4ea8-40b8-a3ff-b789862ed522',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
}).then((res) => {
console.log(res.status)
}).catch((error) => {
console.log(error)
})
FAQs
Come, resounding perception! The locator!
The npm package consul-locator-tracer receives a total of 2 weekly downloads. As such, consul-locator-tracer popularity was classified as not popular.
We found that consul-locator-tracer 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.