Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All MQTT connections have usernames and passwords #1056

Merged
merged 2 commits into from
Oct 14, 2016

Conversation

christophermaier
Copy link
Collaborator

Previously, only connections coming from Relays had usernames and
passwords associated with them; any connection from Cog itself had
neither. We would distinguish between them by examining which host the
connection was coming from; if it was 127.0.0.1, we treated it like it
was a Cog connection, and like a Relay connection (which needed to be
authenticated) otherwise.

This would cause Cog to crash if a Relay process was running on the same
host as Cog, and if it tried to connect prior to being registered with
Cog.

Now, all connections have a username and password associated with
them. All Cog-initiated connections have a username of COG_INTERNAL,
and use a randomly-generated password that is generated at Cog startup,
allowing us to properly distinguish between Cog connections and Relay
connections.

Fixes #1034

Previously, only connections coming from Relays had usernames and
passwords associated with them; any connection from Cog itself had
neither. We would distinguish between them by examining which host the
connection was coming from; if it was 127.0.0.1, we treated it like it
was a Cog connection, and like a Relay connection (which needed to be
authenticated) otherwise.

This would cause Cog to crash if a Relay process was running on the same
host as Cog, and if it tried to connect prior to being registered with
Cog.

Now, _all_ connections have a username and password associated with
them. All Cog-initiated connections have a username of `COG_INTERNAL`,
and use a randomly-generated password that is generated at Cog startup,
allowing us to properly distinguish between Cog connections and Relay
connections.

Fixes #1034
@kevsmith kevsmith self-assigned this Oct 14, 2016
Copy link
Member

@kevsmith kevsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@christophermaier christophermaier merged commit 2016848 into master Oct 14, 2016
@christophermaier christophermaier deleted the cm/mq-usernames-and-passwords branch October 14, 2016 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants