auth

Paddy 2015-05-12 Parent:8267e1c8bcd1

167:0ff23f3a4ede Go to Latest

auth/postgres.go

Implement an endpoint for token information. Implement an endpoint that allows us to look up information on a token. We strip the refresh token before the response is sent to avoid leaking the response token.

History
paddy@148 1 package auth
paddy@148 2
paddy@148 3 import (
paddy@148 4 "database/sql"
paddy@149 5 )
paddy@148 6
paddy@149 7 func NewPostgres(conn string) (postgres, error) {
paddy@149 8 db, err := sql.Open("postgres", conn)
paddy@149 9 if err != nil {
paddy@149 10 return postgres{}, err
paddy@149 11 }
paddy@149 12 return postgres{db: db}, nil
paddy@149 13 }
paddy@148 14
paddy@148 15 type postgres struct {
paddy@148 16 db *sql.DB
paddy@148 17 }