state/apiserver/common: Authorizer remove GetAuthEntity method

This PR is part of a series of cleanups to the apiserver Authorizer interface. The intent of this PR is to remove the AuthEntity method from the Authorizer interface, forcing everything to use the Tag instead. 

In the real srvRoot authorizer this tag is derived from the entity, in the testing/fakeauthorizer the tag itself is the primary data item.

Discussion: https://lists.ubuntu.com/archives/juju-dev/2014-July/003104.html
fixed.


On Thu, Aug 14, 2014 at 5:45 PM, Frank Mueller <notifications@github.com>
wrote:

> In state/apiserver/agent/agent.go:
>
> > @@ -96,11 +99,19 @@ func (api *API) IsMaster() (params.IsMasterResult, error) {
> >  		return params.IsMasterResult{}, common.ErrPerm
> >  	}
> >
> > -	session := api.st.MongoSession()
> > -	machine := api.auth.GetAuthEntity().(*state.Machine)
> > +	switch tag := api.auth.GetAuthTag().(type) {
> > +	case names.MachineTag:
> > +		machine, err := api.st.Machine(tag.Id())
> > +		if err != nil {
> > +		return params.IsMasterResult{}, common.ErrPerm
>
> Format error.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/juju/juju/pull/516/files#r16225010>.
>