All Projects → gin-contrib → httpsign

gin-contrib / httpsign

Licence: MIT license
Signing HTTP Messages Middleware

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to httpsign

ginhelper
gin framework helper
Stars: ✭ 16 (-70.37%)
Mutual labels:  gin, gin-middleware, gin-gonic
requestid
Request ID middleware for Gin Framework
Stars: ✭ 115 (+112.96%)
Mutual labels:  gin, gin-middleware, gin-gonic
go-gin-logrus
Gin Web Framework for using Logrus as the Gin logger with Tracing middleware
Stars: ✭ 38 (-29.63%)
Mutual labels:  gin, gin-middleware, gin-gonic
go api boilerplate
🐶Go (Golang)🚀REST / GraphQL API + Postgres boilerplate
Stars: ✭ 127 (+135.19%)
Mutual labels:  gin, gin-gonic
souin
An HTTP cache system, RFC compliant, compatible with @TykTechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @gin-gonic, @zalando, @zeromicro, @nginx and @apache
Stars: ✭ 269 (+398.15%)
Mutual labels:  gin-middleware, gin-gonic
logging
mod: zap logging in golang
Stars: ✭ 44 (-18.52%)
Mutual labels:  gin, gin-middleware
logger
Gin middleware/handler to logger url path using rs/zerolog
Stars: ✭ 119 (+120.37%)
Mutual labels:  gin, gin-gonic
gin-rest-api
Example golang using gin framework everything you need, i create this tutorial special for beginner.
Stars: ✭ 56 (+3.7%)
Mutual labels:  gin, gin-gonic
go-12factor-example
Example the 12factor app using golang
Stars: ✭ 20 (-62.96%)
Mutual labels:  gin, gin-gonic
geo-smart-system
Open Source Realtime Tracking System
Stars: ✭ 36 (-33.33%)
Mutual labels:  gin, gin-gonic
website
Official website and document for Gin
Stars: ✭ 88 (+62.96%)
Mutual labels:  gin, gin-gonic
gin-swagger
DRY templates for go-swagger
Stars: ✭ 79 (+46.3%)
Mutual labels:  gin, gin-gonic
go-gin-web-server
Deploy Go Gin on Render
Stars: ✭ 23 (-57.41%)
Mutual labels:  gin, gin-gonic
Gin Swagger
gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
Stars: ✭ 2,001 (+3605.56%)
Mutual labels:  gin, gin-middleware
Cmall Go
golang写的电子商城的API接口
Stars: ✭ 167 (+209.26%)
Mutual labels:  gin
Ginhello
Gin 学习示例代码
Stars: ✭ 197 (+264.81%)
Mutual labels:  gin
Go Gin Mgo Demo
A demo CRUD application in golang using the popular gin-gonic framework
Stars: ✭ 159 (+194.44%)
Mutual labels:  gin
Ginrpc
gin auto binding,grpc, and annotated route,gin 注解路由, grpc,自动参数绑定工具
Stars: ✭ 157 (+190.74%)
Mutual labels:  gin
Awesome Gin
awesome for gin framework
Stars: ✭ 236 (+337.04%)
Mutual labels:  gin
Note Gin
【重构中....】🎉📗📝Cloud note file system, supporting MD file batch upload and download and online reading📌 前端:https://github.com/biningo/note-vue
Stars: ✭ 197 (+264.81%)
Mutual labels:  gin

httpsign

Run Tests codecov Go Report Card GoDoc Join the chat at https://gitter.im/gin-gonic/gin

Signing HTTP Messages Middleware base on HTTP Signatures.

Example

package main

import (
  "github.com/gin-contrib/httpsign"
  "github.com/gin-contrib/httpsign/crypto"
  "github.com/gin-gonic/gin"
)

func main() {
  // Define algorithm
  hmacsha256 := &crypto.HmacSha256{}
  hmacsha512 := &crypto.HmacSha512{}
  // Init define secret params
  readKeyID := httpsign.KeyID("read")
  writeKeyID := httpsign.KeyID("write")
  secrets := httpsign.Secrets{
    readKeyID: &httpsign.Secret{
      Key:       "HMACSHA256-SecretKey",
      Algorithm: hmacsha256, // You could using other algo with interface Crypto
    },
    writeKeyID: &httpsign.Secret{
      Key:       "HMACSHA512-SecretKey",
      Algorithm: hmacsha512,
    },
  }

  // Init server
  r := gin.Default()

  //Create middleware with default rule. Could modify by parse Option func
  auth := httpsign.NewAuthenticator(secrets)

  r.Use(auth.Authenticated())
  r.GET("/a", a)
  r.POST("/b", b)
  r.POST("/c", c)

  r.Run(":8080")
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].