This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS banking_entities CASCADE; | |
CREATE TABLE IF NOT EXISTS banking_entities( | |
id INTEGER GENERATED ALWAYS AS IDENTITY, --PRIMARY KEY | |
name VARCHAR(40) NOT NULL UNIQUE, | |
created_at DATE NOT NULL DEFAULT CURRENT_DATE, | |
PRIMARY KEY(id) | |
); | |
DROP TABLE IF EXISTS branches CASCADE; | |
CREATE TABLE IF NOT EXISTS branches( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github.com/dgrijalva/jwt-go | |
openssl genrsa -out private.rsa 1024 | |
openssl rsa -in private.rsa -pubout > public.rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"playground/auth" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
type ResponseToken struct { | |
Token string `json:"token"` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
"github.com/dgrijalva/jwt-go" | |
) | |
type Claim struct { | |
Client `json:"client"` | |
jwt.StandardClaims | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package auth | |
import ( | |
"crypto/rsa" | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"time" |
NewerOlder