auth

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

12:63e86d129238 Go to Latest

auth/client.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
paddy@6 1 package auth
paddy@0 2
paddy@0 3 import (
paddy@0 4 "secondbit.org/uuid"
paddy@0 5 )
paddy@0 6
paddy@0 7 // Client information
paddy@0 8 type Client struct {
paddy@0 9 ID uuid.ID
paddy@0 10 Secret string
paddy@0 11 RedirectURI string
paddy@0 12 OwnerID uuid.ID
paddy@0 13 Name string
paddy@0 14 Logo string
paddy@0 15 }
paddy@0 16
paddy@0 17 func GetClient(id uuid.ID, ctx Context) (Client, error) {
paddy@11 18 // TODO: pull client from ctx
paddy@0 19 return Client{}, nil
paddy@0 20 }
paddy@0 21
paddy@0 22 func createClient(name, logo, redirectURI string, owner uuid.ID, ctx Context) (Client, error) {
paddy@11 23 // TODO: store client in ctx
paddy@0 24 return Client{}, nil
paddy@0 25 }
paddy@0 26
paddy@0 27 func updateClient(client *Client, name, logo, redirectURI *string, ctx Context) error {
paddy@11 28 // TODO: update client in ctx
paddy@0 29 return nil
paddy@0 30 }
paddy@0 31
paddy@0 32 func removeClient(id uuid.ID, ctx Context) error {
paddy@11 33 // TODO: delete client from ctx
paddy@0 34 return nil
paddy@0 35 }
paddy@0 36
paddy@0 37 func listClients(id uuid.ID, page, num int, ctx Context) ([]Client, error) {
paddy@11 38 // TODO: retrieve list of clients from ctx
paddy@0 39 return []Client{}, nil
paddy@0 40 }