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

Generate a unique NATS client id for event msgs #6623

Merged
merged 2 commits into from Jun 6, 2019

Commits on Jun 5, 2019

  1. Generate a unique NATS client id for event msgs

    After connecting one Habitat supervisor to Automate, all subsequent
    connection attempts from Habitat fail with:
    ```
    [2019-06-05T17:09:34Z ERROR ratsio::nats_client::client] NATS Server - Error - Permissions Violation for Publish to ".habitat"
    ```
    
    This is happening because we hard coded the client identifier used
    to connect to the NATS Streaming server inside the Automate server.
    
    From the NATS Streaming server [documentation](https://github.com/nats-io/nats-streaming-server#client-connections):
    >As described, clients are not directly connected to the streaming
    server. Instead, they send connection requests. The request includes
    a client ID which is used by the server to uniquely identify, and
    restrict, a given client. That is, no two connections with the same
    client ID will be able to run concurrently.
    
    This change is generating a unique client id composed by the key word
    "hab_client_" plus the supervisor id.
    
    New client id example: `hab_client_4a5cb023f9274a8d9418bf5f974bdb52`
    
    Signed-off-by: Salim Afiune <afiune@chef.io>
    Salim Afiune committed Jun 5, 2019
    Configuration menu
    Copy the full SHA
    e3652e3 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2019

  1. Fix lint:format errors

    Signed-off-by: Salim Afiune <afiune@chef.io>
    Salim Afiune committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    7edef60 View commit details
    Browse the repository at this point in the history