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

Token-based probe adoption #545

Open
MartinKolarik opened this issue Sep 21, 2024 · 0 comments
Open

Token-based probe adoption #545

MartinKolarik opened this issue Sep 21, 2024 · 0 comments

Comments

@MartinKolarik
Copy link
Member

MartinKolarik commented Sep 21, 2024

An alternative adoption flow, where a user can set an env var like GLOBALPING_OWNER= on the probe to adopt it with no further interaction required. The value is a special adoption token (visible in dashboard). All "start a probe" instructions in dashboard/main website will (optionally, with a toggle) include the token in the command so that newly started probes are automatically adopted.

Now

  1. In Directus, add an adoption_token attribute for each user. It'll be stored in plain text and can be regenerated by the user.
  2. On the probe, read GLOBALPING_OWNER and pass it to the API.
  3. On the API:
    3.1. If the probe is already adopted (matched by IP/alt IP/UUID):
    3.3.1. If the owner matches the token - no action needed.
    3.3.2. If the owner is different - delete the existing adoption and create a new one based on the token, send a notification to both accounts.
    3.2. If the probe is not adopted - adopt it. Send a notification.

TBD: how does the dashboard detect newly adopted probes to show to the user in the "verify" step? The most reliable way might be adding a new entity like gp_adopted_probes_notifications where a record is created by the API and deleted by the dashboard once the user clicks "finish".

Later - pending design

Update all adoption instructions and add a way to regenerate the token. See the updated flow here: https://docs.google.com/document/d/1lXgfDFXIWQe-VHYgIkZwKCLw_86jzhoMubomPpJVmOQ/edit?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants