![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
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.
wikibase-token
Advanced tools
A promises-based lib abstracting authentification for write requests on a Wikibase API
A promises-based lib abstracting authentification for write requests on a Wikibase API.
See Wikidata API for API reference.
This package was primarily published as wikidata-token
but has now being generalized to support any Wikibase instance: wikidata.org among others.
npm install wikibase-token
var config = {
// Required
instance: 'https://mywikibase.instance', // For Wikidata, that would be 'https://www.wikidata.org'
username: 'myUsername',
password: 'pa55word',
// Optional
verbose: true, // Default: false
userAgent: `your-module/${pkg.version} (https://git.repo/username/your-module)` // Default: to 'wikibase-token/${pkg.version} (${pkg.repository.url})`
}
var wbToken = require('wikibase-token')
var getToken = wbToken(config)
getToken
is then a function, which when called returns an ES6 promise that shoud resolve to something looking like:
{
token: 'eb974a8adc9abacf7c9f3f94763ad92e51d76e57+\\',
cookie: 'a very long cookie with your session data'
}
Your request header should then look like:
'cookie': cookie
'content-type': 'application/x-www-form-urlencoded'
and the token should then be passed in the body of your request as form data (thus the x-www-form-urlencoded
header) and NOT JSON (this one got me crazy and made me realize that there was a time JSON wasn't obvious..! poor elders of the Internet), in addition with the other field expected by the API action you're using: contrary to what the API documentation seem to indicate, for POST action, parameters are passed in the body and not in the url (out of action
and format
)
same as with username / password but your config object will look like:
var config = {
// Required
instance: 'https://mywikibase.instance', // For Wikidata, that would be 'https://www.wikidata.org'
oauth: {
// Obtained at registration
// https://www.mediawiki.org/wiki/OAuth/For_Developers#Registration
consumer_key: 'your-consumer-token',
consumer_secret: 'your-secret-token',
// Obtained when the user authorized your service
// see https://www.mediawiki.org/wiki/OAuth/For_Developers#Authorization
token: 'a-user-token',
token_secret: 'a-secret-token'
},
// Then the optional parameters are the same
}
To run the tests, make sure to create a config/local.js
overriding config/default.js
with the username and password of a Wikibase instance
We are developing and maintaining tools to work with Wikidata from NodeJS, the browser, or simply the command line, with quality and ease of use at heart. Any donation will be interpreted as a "please keep going, your work is very much needed and awesome. PS: love". Donate
wikibase-sdk A javascript tool suite to query and work with Wikibase data, heavily used by wikibase-cli
wikibase-cli The command-line interface to Wikibase
wikibase-edit Edit Wikibase from NodeJS, used in wikibase-cli for all write operations
wikidata-filter A command-line tool to filter a Wikidata dump by claim
wikidata-subset-search-engine Tools to setup an ElasticSearch instance fed with subsets of Wikidata
wikidata-taxonomy A command-line tool to extract taxonomies from Wikidata
Do you know inventaire.io? It's a web app to share books with your friends, built on top of Wikidata! And its libre software too.
FAQs
A promises-based lib abstracting authentification for write requests on a Wikibase API
The npm package wikibase-token receives a total of 1 weekly downloads. As such, wikibase-token popularity was classified as not popular.
We found that wikibase-token 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
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.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.