auth

Paddy 2014-08-13 Parent:244ac84003b3 Child:63e86d129238

11:9a1e62c24903 Browse Files

Add a bunch of TODOs. Let's be realistic about what still needs to be done and tag it appropriately.

client.go context.go session.go

     1.1 --- a/client.go	Wed Aug 13 07:04:23 2014 -0400
     1.2 +++ b/client.go	Wed Aug 13 07:42:05 2014 -0400
     1.3 @@ -15,21 +15,26 @@
     1.4  }
     1.5  
     1.6  func GetClient(id uuid.ID, ctx Context) (Client, error) {
     1.7 +	// TODO: pull client from ctx
     1.8  	return Client{}, nil
     1.9  }
    1.10  
    1.11  func createClient(name, logo, redirectURI string, owner uuid.ID, ctx Context) (Client, error) {
    1.12 +	// TODO: store client in ctx
    1.13  	return Client{}, nil
    1.14  }
    1.15  
    1.16  func updateClient(client *Client, name, logo, redirectURI *string, ctx Context) error {
    1.17 +	// TODO: update client in ctx
    1.18  	return nil
    1.19  }
    1.20  
    1.21  func removeClient(id uuid.ID, ctx Context) error {
    1.22 +	// TODO: delete client from ctx
    1.23  	return nil
    1.24  }
    1.25  
    1.26  func listClients(id uuid.ID, page, num int, ctx Context) ([]Client, error) {
    1.27 +	// TODO: retrieve list of clients from ctx
    1.28  	return []Client{}, nil
    1.29  }
     2.1 --- a/context.go	Wed Aug 13 07:04:23 2014 -0400
     2.2 +++ b/context.go	Wed Aug 13 07:42:05 2014 -0400
     2.3 @@ -14,16 +14,21 @@
     2.4  }
     2.5  
     2.6  func (c Context) RenderError(w io.Writer, err error) {
     2.7 +	// TODO: write error to w in a template
     2.8  }
     2.9  
    2.10  func (c Context) RenderJSONError(w io.Writer, code, description, baseURI string) {
    2.11 +	// TODO: write error to w in json formatting
    2.12  }
    2.13  
    2.14  func (c Context) RenderConfirmation(w io.Writer) {
    2.15 +	// TODO: render HTML confirmation page
    2.16  }
    2.17  
    2.18  func (c Context) RenderLogin(w io.Writer) {
    2.19 +	// TODO: render HTML login page
    2.20  }
    2.21  
    2.22  func (c Context) RenderJSONToken(w io.Writer, data AccessData) {
    2.23 +	// TODO: render token to w in json formatting
    2.24  }
     3.1 --- a/session.go	Wed Aug 13 07:04:23 2014 -0400
     3.2 +++ b/session.go	Wed Aug 13 07:42:05 2014 -0400
     3.3 @@ -3,5 +3,6 @@
     3.4  import "net/http"
     3.5  
     3.6  func validateSession(r *http.Request, c Context) error {
     3.7 +	// TODO: return an error if the user does not have a valid session
     3.8  	return nil
     3.9  }