
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
A javascript client to talk to SIS. Designed to work within node or modern browsers (native JSON api and XMLHttpRequest with CORS support).
var SIS = require('sis');
var SISClient = SIS.client({'url' : 'http://sis.host'});
The code is designed to be an npm module, but it is not a public module to install.
<script src='/path/to/sis-client.js'></script>
var SISClient = SIS.client({'url' : 'http://sis.host'});
// Get the first page of hooks
SISClient.hooks.list(function(err, result) {
// result is an array of hook objects
});
// Get a single schema
SISClient.schemas.list({'limit' : 1}, function(err, result) {
// result is an array of schemas of length 1
});
// Create a hiera entry
SISClient.hiera.create({ 'name' : 'entry', 'hieradata' : { 'key1' : 'value1' }}, function(err, result) {
// result is the created hiera entry
});
// Delete the entity of type 'entity_name' with id 'foo'
SISClient.entities('entity_name').delete('foo', function(err, result) {
// result is a boolean indicating success
});
All callbacks receive an err
as the first parameter and the result of the API call as the second.
SIS Clients must use authentication tokens for most operations. The token can be provided in a number of ways.
token
field to the object passed to the SIS
function. I.E. var client = SIS.client({'url' : 'http://sis.host', 'token' : '<token goes here>'});
authenticate
on the client
to authenticate via username/password and use the returned temporary token. The following example shows the use of authenticate:var SISClient = SIS.client({'url' : 'http://sis.host'});
SISClient.authenticate('user', 'password', function(err, authenticated) {
if (err || !authenticated) {
// authentication failed
} else {
// authentication succeeded and the client
// token has been set
}
});
The object returned by SISClient.hooks, SISClient.schemas, SISClient.hiera, and SISClient.entities(entity_name) all interact with the appropriate endpoints and expose the following interface:
This maps to a GET /
request against the endpoint.
Consult the SIS documentation for further information.
An array of objects is returned to the callback on success.
This maps to a GET /id
request against the endpoint.
name
. For entities, it is the _id
.A single object is returned to the callback on success.
This maps to a POST /
request against the endpoint.
The created object is returned to the callback on success. In the case of a bulk insert, an object that looks like the following is returned:
{
// list of objects that look like { err : error_object, value : object_that_failed_to_insert }
errors : [],
// list of objects that were successfully inserted
success : []
}
This maps to a PUT '/:obj_id' request against the endpoint. The _id is used for entities, and 'name' is used for others.
list
or get
.The updated object is returned to the callback on success.
This maps to a PUT '/:id' request against the endpoint.
id_field
, the id or _id
.This maps to a DELETE '/id' request against the appropriate v1 endpoint.
list
or get
true
is returned to the callback on success.
All tests require a test server to hit. Ensure that it is running and that test/test-config.js points to it.
One time setup: npm install -g mocha
mocha
Run make webroot
to produce the webroot
folder. Then open webroot/index.html in your favorite browser.
This software is licensed under the BSD 3-Clause license. Please refer to the LICENSE for more information.
FAQs
SIS Client for Javascript
We found that sis 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.