Skip to content

A kong plugin that verifies request permissions via JWT token.

License

Notifications You must be signed in to change notification settings

SayNop/kong_jwt_url_auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kong_Jwt_Url_Auth

Description

A kong plugin that verifies request permissions via JWT token.
Confirm user permissions for each API through the database.

  • Kong Version: 1.1.3
  • Postgresql Version: 9.6.24

Feature

  • check token signature
  • check token expiry
  • check token conflict
  • check user has permission to access api

File Structure

  • handler : main
  • schema : config
  • daos : cache

Postgresql Table

  • api_mgr : define api auth level
CREATE TABLE api_mgr(
    sign VARCHAR(51) PRIMARY KEY,
    path VARCHAR(50) NOT NULL,
    service smallint NOT NULL,
    auth_level smallint DEFAULT 0
);
  • login_user : define user and user permissions
CREATE TABLE login_user(
    phone CHAR(11) PRIMARY KEY NOT NULL,
    username VARCHAR(15) NOT NULL,
    password VARCHAR(15) NOT NULL,
    level smallint DEFAULT 0
);

Notice

Remove all kong.log.inspect code in production environment.

About

A kong plugin that verifies request permissions via JWT token.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages