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
1 package auth
3 import (
4 "database/sql"
5 )
7 func NewPostgres(conn string) (postgres, error) {
8 db, err := sql.Open("postgres", conn)
9 if err != nil {
10 return postgres{}, err
11 }
12 return postgres{db: db}, nil
13 }
15 type postgres struct {
16 db *sql.DB
17 }