Skip to content

kgallagher52/my-first-go-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

my-first-go-server

This is a simple Golang server with JWT auth.

Resources

lectures

HTTP-ROUTER - install: "go get -u github.com/gorilla/mux"

JWT - install: "go get github.com/dgrijalva/jwt-go"

pq - install: "go get github.com/lib/pq"

postman - for testing endpoints

golang-install

JWT-Offical-site

JWT-Info

postgresql

online-postgresql

Go-Spew - install: "go get -u github.com/davecgh/go-spew/spew" Styles JSON returned

Bcrypt - "import "golang.org/x/crypto/bcrypt"

What are JWTs?

- JWT stands for JSON Web Token

- JWT is a means of exchanging information between two parties

- Digitally signed

- Structure of a JWT: {Base64 encoded Header}.{Base64 encoded Payload}.{Signature}

  - header: Algorithm & Token Type

  - payload: Carry claims 

    - Contains data such as User information token expiry etc..

    - Three types of claims: Registered, Public, and Private
  
  - signature: Computed from the Header, Payload and a Secret

    - An algorithm to generate the signature

    - Digitally signed using a secret string only known to the developer

postgresql queries

  1. Creating user table

    create table users ( id serial primary key, email text not null unique, password text not null );

  2. Creating a user record

    insert into users (email, password) values (‘someemail.com’, ‘somePassword’)

  3. Selecting users

    select * from users;

About

This is a simple Golang server with JWT auth.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages