
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
github.com/tsurai/amber
Jantar is a lightweight mvc web framework with emphasis on security written in golang. It has initially been largely inspired by Martini but prefers performance over syntactic sugar and aims to provide crucial security settings and features right out of the box.
WARNING: This project is deprecated and is not maintained anymore. The default security settings and feature are out of date and not secure anymore! Use this as reference only!
First you have to download and install the package into the import path. This can easily be done with go get:
go get github.com/tsurai/jantar
Now you can import jantar and create a simple website
package main
import (
"net/http"
"github.com/tsurai/jantar"
)
func main() {
j := jantar.New(&jantar.Config {
Hostname: "localhost",
Port: 3000,
})
j.AddRoute("GET", "/", func(respw http.ResponseWriter, req *http.Request) {
respw.Write([]byte("Hello World"))
})
j.Run()
}
Using Controller and rendering Templates is very easy with Jantar. For this simple example I'm going to assume the following directory structure. A detailed description will follow soon.
|- controllers/
|-- app.go
|- views/
|-- app/
|--- index.html
| main.go
-- controllers/app.go
package controller
import (
"github.com/tsurai/jantar"
)
type App struct {
jantar.Controller
}
func (c *App) Index() {
c.Render()
}
-- views/app/index.html
<h1>Hello Controller</h1>
-- main.go
package main
import (
"github.com/tsurai/jantar"
c "controllers"
)
func main() {
j := jantar.New(&jantar.Config {
Hostname: "localhost",
Port: 3000,
})
j.AddRoute("GET", "/", (*c.App).Index)
j.Run()
}
Jantar is by no means secure in the literal sense of the word. What it does is providing easy and fast ways to protect against the most common vulnerabilities. Security should never be left out because it is too troublesome to implement.
Some might wonder why Jantar is using /dev/urandom instead of the seemingly more secure /dev/random. Please take some minutes and read this interesting article about /dev/urandom/
These frameworks have been a source of inspiration and ideas during Jantars development.
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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.