
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Kōkua (Hawaiian) - help, aid, assistance
Kōkua is an implementation of the Representor pattern, written in modern Javascript/Node. It allows developers to represent hypermedia messages in a flexible media type, purpose-designed for the task: Hyper and automatically outputs messages in a variety of popular Hypermedia formats such as:
const kokua = require("kokua");
let halDoc = kokua(hyperDoc, kokua.mt('hal'));
where the first argument to a kokua() call is a JSON document formatted as a
Hyper document, and the second argument is the name of a supported media-type
that we want the message to be translated to.
const kokua = require("kokua");
let uberDoc = kokua.parse(halDoc, kokua.mt('hal'));
where the first argument to a kokua.parse() call is a JSON document formatted
in a media type, supported by Kokua, and the second argument is the name of a
supported media-type that we want the message to be translated from.
Please see the official specification for Hyper media type, for more details about the format.
const hyperDoc = const hyper = {
"h:head": {"curies": {"ea": "http://example.com/docs/rels/"}},
"h:ref": {"self": "/orders", "next": "/orders?page=2"},
"currentlyProcessing": 14, "shippedToday": 20,
"ea:order": [
{
"h:ref": {
"self": "/orders/123",
"ea:basket": "/baskets/98712",
"ea:customer": "/customers/7809"
},
"total": 30, "currency": "USD", "status": "shipped"
},
{
"h:ref": {
"self": "/orders/123",
"ea:basket": "/baskets/98712",
"ea:customer": "/customers/124234"
},
"total": 123, "currency": "USD", "status": "pending"
}
]
};
const kokua = require("kokua");
let halDoc = kokua(hyperDoc, kokua.mt('hal'));
let sirenDoc = kokua(hyperDoc, kokua.mt('siren'));
> node benchmark.js
Time to convert HAL 10,000 times: 2.572 ms
Time to convert Siren 10,000 times: 1.42 ms
If you are interested in developing a new plugin to implement translation to a hypermedia format that is not yet implemented, please refer to README-PLUGINDEV
FAQs
Hypermedia Representor Using Hyper+JSON
We found that kokua demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.