Gin Boilerplate Versions Save

The fastest way to deploy a restful api's with Gin Framework with a structured project that defaults to PostgreSQL database and JWT authentication middleware stored in Redis

v2.0

4 years ago

Changes:

  • Removed session-cookies auth (It can be found here if needed v1-session-cookies-auth)

  • JWT instead of session-cookies

    • Token validation middleware
    • Token generation
    • Authorization and refresh token
  • Redis as a database not as a session storage

  • Go Modules

  • Environment (.env)

  • Updated unit test

  • Code and structure enhancements

  • Middleware:

    • TokenAuthMiddleware
    • RequestIDMiddleware
    • gzip.Gzip Middleware
  • Golang in travis:

    • 1.10.x
    • 1.13.x
    • 1.14.x
    • master
  • SSL Support
    • Generating the certifications in ./cert folder from:
$ sh generate-certificate.sh
- SSL=TRUE | FALSE in .env
- SSL implementation in the server in **main.go**

Capture both access_token & refresh_token and put it in the global variable from the Login API in Tests tab

requests.

pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
    
    var jsonData = JSON.parse(responseBody);
    pm.globals.set("token", jsonData.token.access_token);
    pm.globals.set("refresh_token", jsonData.token.refresh_token);

});

To be used in: 
Authorization -> Bearer Token Value: {{token}} (Comes from global variables)

  • PostgreSQL:
    • 2 trigger functions:
      • public.created_at_column()
      • public.update_at_column()

Those are added to updated_at and created_at columns to update the latest timestamp automatically in both user and article tables. You can explore the tables and public schema for more info.

1.05

4 years ago

HTTP Status update closing #7

This release will be the last to include the "session & cookies" authentication stored in Redis. Next versions & releases will be having the JWT as authentication.

If you still want the old school auth, you can either refer to this release or this v1-session-cookies-auth branch

v0.04

5 years ago

v0.03

6 years ago

v0.02

6 years ago

Add serving HTML static & dynamic pages with 404 and landing pages

v0.01

7 years ago