Account-jwt-go - Simple JWT api with go, gorm, gin

Overview

Account JWT on Go

Go, gorm, Gin web framework 를 활용하여 만든 간단한 JWT API 입니다.
Dajngo의 Simple JWT 플러그인을 참고하여 만들었습니다.

API endpoints

1. Basic

  • [POST]/account
    • 회원가입
    • Request
      • json data(body)
        {
            "email": "string",
            "login_id": "string",
            "name": "string",
            "password": "string"
        } 
        
    • Response
      • json data(body)
        {
            "access_token": "string",
            "refresh_token": "string",
            "user_id": 0
        }
        
  • [POST]/account/login
    • 로그인
    • Request
      • json data(body)
        {
            "login_id": "string",
            "password": "string"
        }
        
    • Response
      • json data(body)
        {
            "access_token": "string",
            "refresh_token": "string",
            "user_id": 0
        }   
        
  • [POST]/account/valid
    • access token 검증
      • json data(body)
        {
            "access_token": "string"
        }
        
    • Response
      • result
        true/false
        
  • [POST]/account/renew
    • access token 갱신
    • Request
      • json data(body)
        {
            "refresh_token": "string"
        }
        
    • Response
      • json data(body)
        "access token string"  
        

2. Swagger

  • [GET] /swagger/index.html

Development

1. docker-compose up

$ cd dev
$ docker-compose up

2. Attatch vscode

3. Run main.go on debug

4. Create Docs

$ swag
$ cd /root/src/
$ swag init

Build deployment image

$ docker build -t account-jwt:latest .

$ docker run -p 8000:8000 --env-file .env account-jwt:latest

Reference

Owner
Deagwon Bu
I like coffee
Deagwon Bu
Golang based User creation and Management application. GORM, Fiber, JWT

User Creation and Management app (BACK-END) Auth Features: Create Clients (regular password + 6 one-time passwords + (optional) QR code and Secret for

Artūras 5 May 11, 2022
RBAC scaffolding based on Gin + Gorm+ Casbin + Wire

Gin Admin 基于 GIN + GORM + CASBIN + WIRE 实现的RBAC权限管理脚手架,目的是提供一套轻量的中后台开发框架,方便、快速的完成业务需求的开发。 特性 遵循 RESTful API 设计规范 & 基于接口的编程规范 基于 GIN 框架,提供了丰富的中间件支持(JWT

Lyric 2k Aug 4, 2022
JWT wrapper library which makes it simple to use ECDSA based JWT signing

JWT JWT wrapper library which makes it simple to user ECDSA based JWT signing. Usage package main import ( "context" "github.com/infiniteloopcloud

infinite loop 0 Feb 10, 2022
A simple user identify template with jwt token and gin, toy project

Simple Docs Register url : /api/auth/register param type value name string username password string password mailbox string mailbox response: { "sta

null 1 Dec 31, 2021
Krakend-jwt-header-rewriter - Kraken Plugin - JWT Header Rewriter

Kraken Plugin - JWT Header Rewriter 1 Plugin Configuration Name Desciption Defau

null 0 Feb 15, 2022
jwt package for gin go applications

gin-jwt jwt package for gin go applications Usage Download using go module: go get github.com/ennaque/gin-jwt Import it in your code: import gwt "gith

Igor Volkov 2 Apr 21, 2022
Golang with JWT, Go Gin and MongoDB

User authentication in Golang with JWT, Go Gin and MongoDB Golang backend application that uses JWT tokens for users Locally Up Setup your .env file,

Al Mamun Khan 10 May 27, 2022
This is a jwt for Gin framework.

JWT for Gin Framework This is a jwt useful for Gin framework. It uses jwt-go to provide a jwt encode and decode token. Usage go get github.com/wyy-go/

null 0 Jan 9, 2022
🔒 JWT with RS-signing methods, designed for Gin.

GinRS 套用在 gin-gonic/gin 基於 RS256 演算法的 JWT 簽署套件。 非對稱金鑰 透過 openssl 產生一個私鑰。 openssl genrsa -out private.key 2048 再透過這個私鑰產生一個公鑰,這個公鑰可以配發到其他伺服器或是第三方的手中用來驗證

TeaCat 1 Feb 23, 2022
A single sign-on solution based on go-oauth2 / oauth2 and gin-gonic/gin

A single sign-on solution based on go-oauth2 / oauth2 and gin-gonic/gin

yinhuanyi 1 Nov 17, 2021
simple-jwt-provider - Simple and lightweight provider which exhibits JWTs, supports login, password-reset (via mail) and user management.

Simple and lightweight JWT-Provider written in go (golang). It exhibits JWT for the in postgres persisted user, which can be managed via api. Also, a password-reset flow via mail verification is available. User specific custom-claims also available for jwt-generation and mail rendering.

Max 26 Jul 24, 2022
Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发

go-web-mini Go + Vue开发的管理系统脚手架, 前后端分离, 仅包含项目开发的必需部分, 基于角色的访问控制(RBAC), 分包合理, 精简易于扩展。 后端Go包含了gin、 gorm、 jwt和casbin等的使用, 前端Vue基于vue-element-admin开发: http

gnimli 80 Aug 3, 2022
基于 Echo + Gorm + Casbin + Uber-FX 实现的 RBAC 权限管理脚手架,致力于提供一套尽可能轻量且优雅的中后台解决方案。

Echo-Admin 基于 Echo + Gorm + Casbin + Uber-FX 实现的 RBAC 权限管理脚手架,致力于提供一套尽可能轻量且优雅的中后台解决方案。 English | 简体中文 特性 遵循 RESTful API 设计规范 基于 Echo API 框架,提供了丰富的中间件支

LiuSha 72 Jul 19, 2022
:key: Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.

branca branca is a secure alternative to JWT, This implementation is written in pure Go (no cgo dependencies) and implements the branca token specific

Wesley Hill 166 Aug 3, 2022
Backend Development Rest Api Project for book management system. Used Features like redis, jwt token,validation and authorization.

Golang-restapi-project Simple Rest Api Project with Authentication, Autherization,Validation and Connection with redis File Structure ├── cache │ ├──

Srijan Chakraborty 1 May 25, 2022
rEST API to test JWT on RS256 and HS256 algorithm.

JWT Check - Mock para tests This repo is just a simple example of JWT token generation using RS256 algorithm and HS256 algorithm. This api is responsi

Jefferson Otoni Lima 2 Dec 24, 2021
🔥 Golang Rest Api with basic JWT Authentication and Basic Crud Operations.

?? Golang Rest Api with basic JWT Authentication and Basic Crud Operations.

Junaid Javed 16 Jul 29, 2022
Simple JWT Golang

sjwt Simple JSON Web Token - Uses HMAC SHA-256 Example // Set Claims claims := New() claims.Set("username", "billymister") claims.Set("account_id", 86

Brian Voelker 99 Aug 11, 2022
A fast and simple JWT implementation for Go

JWT Fast and simple JWT implementation written in Go. This package was designed with security, performance and simplicity in mind, it protects your to

Gerasimos (Makis) Maropoulos 146 Aug 6, 2022