security

package
v0.0.0-...-5525a2d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NDAMiddleWare

func NDAMiddleWare(next http.Handler) http.Handler

NDAMiddleWare makes sure they have a valid jwt and has NDA permissions

func UserLogin

func UserLogin(w http.ResponseWriter, r *http.Request)

UserLogin checks the login and creates a session

func WSMiddleWare

func WSMiddleWare(next http.Handler) http.Handler

WSMiddleWare checks for a JWT header to make sure thehy have access too the given topic

Types

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Login is the json structure for logging in

type User

type User struct {
	jwt.StandardClaims
	Username    string   `json:"username"`
	Password    string   `json:"password,omitempty"`
	Permissions []string `json:"permissions"`
	JWT         string   `json:"jwt,omitempty"`
}

User is the redis struction of an user

func (*User) Access

func (u *User) Access(key string) bool

Access checks if an admin has permission to access a key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL