
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Openstack swift client API with ES7 async/await design.
$ npm install swift
Auth3 API will login to your openstack and use a X-Auth-Token in all operations. Make sure to renew (setInterval) the auth token periodicaly.
"use strict";
module.exports = {
authUrl : "https://auth.cloud.ovh.net/v3", // default
username : "OpenstackUsername", // required
password : "OpenstackPassword", // required
tenantId : "OpenstackProjectId", // one of tenantId or tenantName is required
tenantName : "OpenstackProjectName", // one of tenantId or tenantName is required
region: "WAW", // default "GRA3"
};
"use strict";
const fs = require('fs');
const Context = require('swift/context');
const storage = require('swift/storage');
const pipe = require('nyks/stream/pipe');
const creds = require('./credentials');
class foo {
async run(){
// init token
let container = 'mediaprivate';
var ctx = await Context.build(creds);
var files = await storage.toggleMode(ctx, container, ".r:*,.rlistings");
var headers = await storage.showContainer(ctx, container);
var remote = await storage.putFile(ctx, 'boucs.jpg', container, 'bouc.jpg');
var local = fs.createWriteStream('tmp.jpg');
var remote = storage.download(ctx, container, 'bouc.jpg');
await pipe(remote, local);
var remote = await storage.deleteFile(ctx, container, 'bouc.jpg');
var files = await storage.getFileList(ctx, container);
console.log({files, remote});
}
}
module.exports = foo;
Using a container meta-temp key, you can upload, retrieve or delete specific files in your container. On a CAS designed container, this should be considered as a best practice against a full container access.
"use strict";
const fs = require('fs');
const Context = require('swift/context');
const storage = require('swift/storage');
const pipe = require('nyks/stream/pipe');
const creds = {
"containers" : {
"mediaprivate" : {
"endpoint" : "https://someopenstackswifthost/v1/AUTH_PROJECTID/mediaprivate",
"temp-url-key" : "somesecret",
}
}
};
class foo {
async run(){
let container = 'mediaprivate';
// does not init token, as no username is provided
var ctx = await Context.build(creds);
//please note that container level API won't work
//var files = await storage.toggleMode(ctx, container, ".r:*,.rlistings");
//var headers = await storage.showContainer(ctx, container);
var remote = await storage.putFile(ctx, 'boucs.jpg', container, 'bouc.jpg');
var local = fs.createWriteStream('tmp.jpg');
//download through tempURL
var remote = storage.download(ctx, container, 'bouc.jpg');
await pipe(remote, local);
var remote = await storage.deleteFile(ctx, container, 'bouc.jpg');
var files = await storage.getFileList(ctx, container);
console.log({files, remote});
}
}
module.exports = foo;
FAQs
Openstack swift APIs
The npm package swift receives a total of 273 weekly downloads. As such, swift popularity was classified as not popular.
We found that swift 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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.