auth

Paddy 2014-08-13 Parent:9a1e62c24903 Child:fc5df8e68c7b

12:63e86d129238 Go to Latest

auth/context.go

Consistently handle context in client storage interface. Let's at least be consistent about passing or not passing context to the client storage interface. Most our methods don't take the context, so let's just remove it.

History
1 package auth
3 import (
4 "io"
5 "log"
6 )
8 type Context struct {
9 Config ServerConfig
10 Clients ClientStore
11 Tokens TokenStore
12 Profiles ProfileStore
13 Log *log.Logger
14 }
16 func (c Context) RenderError(w io.Writer, err error) {
17 // TODO: write error to w in a template
18 }
20 func (c Context) RenderJSONError(w io.Writer, code, description, baseURI string) {
21 // TODO: write error to w in json formatting
22 }
24 func (c Context) RenderConfirmation(w io.Writer) {
25 // TODO: render HTML confirmation page
26 }
28 func (c Context) RenderLogin(w io.Writer) {
29 // TODO: render HTML login page
30 }
32 func (c Context) RenderJSONToken(w io.Writer, data AccessData) {
33 // TODO: render token to w in json formatting
34 }