- Split AuthManager into its own package, github.com/mendersoftware/mender/authmanager.
- Package must not be used from the rest of the client.
- The "daemon" inside this package runs in its own Go routine.
- All existing instances of interacting with the AuthManager must be replaced with DBus calls, just like other daemons do.
- Server list handling should be moved to the new package (return first server that works in DBus call).
- The client code outside the authmanager package should no longer parse the ServerURL field.
- All API calls in the client should be wrapped in retry loops using DBus FetchJwtToken and waiting for signal.
- Maybe unit tests (but most of this is just moving things around, so maybe it's covered well enough already).
- Feature branch: feature-unified_comms
This subtly changes how server failover works. In the past, if there was more than one server, the client would invalidate the token as soon as the first one fails, for every call. In other words, if there was a failover situation, the client would reauthenticate on every API call. With the new method, the client will keep connecting to the first server that worked when the JWT token was issued, until it expires. So in a migration situation, you now have to reject the client in the old server before it will show up in the new one, or else you need to wait up to a week.