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.
github.com/jacky-htg/api-news
The News API using GO Language, MySql and redis
Fitur :
There is 2 (two) role, Editor and Writer. Editor can access all api. Writer only can create new news and edit own news. Guest can read topics and read news.
Guest :
Writer :
Editor :
Websocket is used to broadcast new publish news. WebSocket address is : ws://localhost:8080/newssocket. Here is sample script on client when consum a websocket. Create a file client.html on your document root and open it using your favorite browser : http://localhost/client.html
<script>
var ws = new WebSocket("ws://localhost:8080/newssocket");
ws.onopen = function() {
ws.send("hello server!")
}
ws.onmessage = function(event) {
var m = event.data;
if (m === "pong") console.debug("Received message", m);
else notifyMe(m);
}
ws.onerror = function(event) {
console.debug(event)
}
function notifyMe(message) {
// Let's check if the browser supports notifications
if (!("Notification" in window)) {
alert("This browser does not support system notifications");
}
// Let's check whether notification permissions have already been granted
else if (Notification.permission === "granted") {
// If it's okay let's create a notification
var notification = new Notification(message);
}
// Otherwise, we need to ask the user for permission
else if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
// If the user accepts, let's create a notification
if (permission === "granted") {
var notification = new Notification(message);
}
});
}
// Finally, if the user has denied notifications and you
// want to be respectful there is no need to bother them any more.
}
</script>
for demo documentation, see https://api-news.rijalasepnugroho.com/documentation/
Api Key : n3WsAp1D3v
Editor : email (editor@gmail.com) password (1234)
Writer : email (writer@gmail.com) password (1234)
This API using Golang. Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
to install go, https://golang.org/doc/install
File Configuration on ./config/config.json
You can run application with going the directory api-news and command : go run main.go
You can test the api using command : go test -v
For api documentation, you can open on the browser: http://localhost:8080/documentation/
FAQs
Unknown package
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.