state/api.State authTag vs tag

John Meinel john at arbash-meinel.com
Sun Jun 15 12:58:28 UTC 2014


I was working in this area, and I noticed that we have two attributes that
appear to be saving the same data. Specifically api.State has an attribute
"tag" that goes with "password", and is set during api.Open, from the
passed in api.Info structure. We then have a separate attribute "authTag"
that gets set only once we call api.State.Login().
Now, if you pass Tag and Password to Open() it will call Login() for you,
which means authTag will be exactly tag.

AFAICT, authTag is being passed only to the Uniter client, while "tag" and
"password" are used for debuglog/charms/tools to give BasicAuth headers for
the HTTPS requests we make.

I feel like we should consolidate these fields. And if we need "authTag" to
match Login then we should be setting "tag" there instead. (That will be
better for any case where we Login late, given that we probably still would
want to be able to use anything like DebugLog URLs.)

I'm guessing this is just a case of 2 different people working on the code
and not realizing the data was available somewhere else, but I figured I'd
run it by people in case I didn't understand what the use case was.

John
=:->
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140615/cfb2bdf3/attachment.html>


More information about the Juju-dev mailing list