auth

Paddy 2015-03-21 Parent:3aeadd2201e9 Child:77db7c65216c

148:06fb735031bb Go to Latest

auth/context.go

Do a first, naive pass at storing profiles in Postgres. This is untested against an actual database. It's a best-guess attempt at SQL. It _should_ work. I think. Start storing things in Postgres, starting with Profiles and Logins. This necessitates the addition of a Deleted property to the Profile type, because I'm not deleting those in case of accidental deletion. Logins, though, we'll delete. This also necessitates updating the profileStore interface to no longer have a deleteProfile method, because we're tracking that through updates now. Then we need to update our profileStore tests, because they no longer clean up after themselves. Which, come to think of it, may cause some problems later.

History
     1.1 --- a/context.go	Fri Mar 20 23:03:21 2015 -0400
     1.2 +++ b/context.go	Sat Mar 21 01:23:33 2015 -0400
     1.3 @@ -256,15 +256,6 @@
     1.4  	return c.profiles.updateProfiles(ids, change)
     1.5  }
     1.6  
     1.7 -// DeleteProfile removes the Profile specified by the passed ID from the profileStore associated
     1.8 -// with the Context.
     1.9 -func (c Context) DeleteProfile(id uuid.ID) error {
    1.10 -	if c.profiles == nil {
    1.11 -		return ErrNoProfileStore
    1.12 -	}
    1.13 -	return c.profiles.deleteProfile(id)
    1.14 -}
    1.15 -
    1.16  // AddLogin stores the passed Login in the profileStore associated with the Context. It also associates
    1.17  // the newly-created Login with the Orofile in login.ProfileID.
    1.18  func (c Context) AddLogin(login Login) error {