Skip to content

Role of API_KEY variable for ingester and how to have multiple diode client #179

Open
@dga-nagra

Description

@dga-nagra

TL;DR

  • What is the use of the ingester's API_KEY variable, it is not used anywhere
  • Can I set up a single Diode server for multiple clients (e.g. use tokens generated from Netbox) ?
    The token the client is using is passed to Netbox with an environment variable. Therefore, we can only have one token and therefore only one client (or multiple ones sharing the same secret which is not good).

Detailed question

Hi,

I am trying to configure Diode in the same docker compose as Netbox.
I see that there is a RECONCILER_API_KEY variable set to CHANGE_.ME

https://github.com/netboxlabs/diode/blob/develop/diode-server/docker/sample.env#L2

- API_KEY=${RECONCILER_API_KEY}

I went in all repositories and I don't find the mention to this variable, even in the Go code:

func setupEnv(redisAddr string) {

Is this variable needed? I thought that this would be used by the clients, but from netbox-learning I am supposed to use DIODE_API_KEY
If I understand correctly:

  • the variables are here to define the communication ingester -> reconciler <-> Netbox.
  • DIODE_API_KEY is shared by Netbox, the reconciler but also the client
  • Since the client uses DIODE_API_KEY, and since this value is defined on startup on diode and netbox, this means we can only ever have only one DIODE_API_KEY even if we were to spawn multiple diode instances since the token is still passed to netbox.
  • If we need to rotate the token, we need to restart both netbox and diode and also update the value on the client(s).

Please, correct me if I am wrong. Thank you in advance for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions