Add the EnvUser with tests. Create an Environment user during bootstrap

Added the EnvUser doc

Support for setting the last login time for the EnvUser

Added a factory for adding the envuser

Admin EnvUser gets added at bootstrap time

Removed a couple of attributes from the upgrade package that no longer needed to be there

ok, if it isn't handled easily by mongo or the other encodings, please
dismiss my insane ramblins.


On Fri, Aug 1, 2014 at 1:15 PM, Tim Penhey <notifications@github.com> wrote:

> In state/envuser.go:
>
> > +	return e.doc.CreatedBy
> > +}
> > +
> > +// DateCreated returns the date the environment user.
> > +func (e *EnvironmentUser) DateCreated() time.Time {
> > +	return e.doc.DateCreated
> > +}
> > +
> > +// LastConnection returns the last connection time of the environment user.
> > +func (e *EnvironmentUser) LastConnection() *time.Time {
> > +	return e.doc.LastConnection
> > +}
> > +
> > +// UpdateLastConnection updates the last connection time of the environment user.
> > +func (e *EnvironmentUser) UpdateLastConnection() error {
> > +	timestamp := nowToTheSecond()
>
> Actually, no. We do want a *time.Time. It makes sense for one that is
> optional. Using IsZero is a royal PITA, and didn't work consistently as
> mongo was changing the timezone on selection. I found out the hard way, and
> using a pointer was much cleaner and more effective. It is also what we are
> using on the User doc.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/juju/juju/pull/432/files#r15681115>.
>