auth
18:c4351b08c867 Browse Files
Remove info.go. Let's wait until we need it to implement stuff outside the spec, we already have plenty of extra-spec-ular stuff that we know we need.
info.go
1.1 --- a/info.go Sat Aug 16 18:05:10 2014 -0400 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,33 +0,0 @@ 1.4 -package auth 1.5 - 1.6 -import ( 1.7 - "net/http" 1.8 - "time" 1.9 -) 1.10 - 1.11 -// HandleInfoRequest is an http.HandlerFunc for server information 1.12 -// NOT an RFC specification. 1.13 -func HandleInfoRequest(w http.ResponseWriter, r *http.Request, ctx Context) { 1.14 - r.ParseForm() 1.15 - 1.16 - code := r.Form.Get("code") 1.17 - 1.18 - if code == "" { 1.19 - // TODO: return error 1.20 - return 1.21 - } 1.22 - 1.23 - // load access data 1.24 - accessData, err := ctx.Tokens.GetAccess(code) 1.25 - if err != nil { 1.26 - // TODO: return error 1.27 - return 1.28 - } 1.29 - if accessData.IsExpired() { 1.30 - // TODO: return error 1.31 - return 1.32 - } 1.33 - 1.34 - accessData.ExpiresIn = int32(accessData.CreatedAt.Add(time.Duration(accessData.ExpiresIn)*time.Second).Sub(time.Now()) / time.Second) 1.35 - // TODO: write accessData 1.36 -}