[Feature] Add option to associate an api key to a specific user #735

Closed
opened 2025-12-29 02:23:02 +01:00 by adam · 8 comments
Owner

Originally created by @DanielMaurer02 on GitHub (Jun 23, 2024).

Use case

I want to grant other persons using my hosted server the ability to manage their own user and the connected devices but currently i can only give them full admin privileges, which i do not want for security reasons.

Description

Add an optional parameter to the cli for example headscale apikeys create --user testUser which only grants admin rights to the user testUser and the associated devices.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

  • Add the optional parameter --user to theheadscale apikeys create cli
  • update the api endpoints to only accept get and post request to users associated to the apikey (if no user is assigned, grant all privileges)
Originally created by @DanielMaurer02 on GitHub (Jun 23, 2024). ### Use case I want to grant other persons using my hosted server the ability to manage their own user and the connected devices but currently i can only give them full admin privileges, which i do not want for security reasons. ### Description Add an optional parameter to the cli for example `headscale apikeys create --user testUser` which only grants admin rights to the user `testUser` and the associated devices. ### Contribution - [X] I can write the design doc for this feature - [X] I can contribute this feature ### How can it be implemented? - Add the optional parameter `--user` to the`headscale apikeys create` cli - update the api endpoints to only accept get and post request to users associated to the apikey (if no user is assigned, grant all privileges)
adam added the enhancementstale labels 2025-12-29 02:23:02 +01:00
adam closed this issue 2025-12-29 02:23:02 +01:00
Author
Owner

@stratself commented on GitHub (Jun 24, 2024):

Hi, I found this idea to be interesting too. As a further improvement, can you also allow for view-only/read-write keys? This may be an optional --view-only flag that only allow GET requests to the Headscale server. I have a use case where I want to monitor online nodes but not control them, so all of this would be a great addition. Thanks!

@stratself commented on GitHub (Jun 24, 2024): Hi, I found this idea to be interesting too. As a further improvement, can you also allow for view-only/read-write keys? This may be an optional `--view-only` flag that only allow GET requests to the Headscale server. I have a use case where I want to monitor online nodes but not control them, so all of this would be a great addition. Thanks!
Author
Owner

@DanielMaurer02 commented on GitHub (Jun 25, 2024):

Hi, I found this idea to be interesting too. As a further improvement, can you also allow for view-only/read-write keys? This may be an optional --view-only flag that only allow GET requests to the Headscale server. I have a use case where I want to monitor online nodes but not control them, so all of this would be a great addition. Thanks!

I definitely see how this would be useful. If this feature request is being approved, I can probably implement this without much extra effort

@DanielMaurer02 commented on GitHub (Jun 25, 2024): > Hi, I found this idea to be interesting too. As a further improvement, can you also allow for view-only/read-write keys? This may be an optional `--view-only` flag that only allow GET requests to the Headscale server. I have a use case where I want to monitor online nodes but not control them, so all of this would be a great addition. Thanks! I definitely see how this would be useful. If this feature request is being approved, I can probably implement this without much extra effort
Author
Owner

@github-actions[bot] commented on GitHub (Sep 24, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Sep 24, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@stratself commented on GitHub (Sep 24, 2024):

not stale

@stratself commented on GitHub (Sep 24, 2024): not stale
Author
Owner

@github-actions[bot] commented on GitHub (Dec 26, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Dec 26, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@stratself commented on GitHub (Dec 28, 2024):

no

@stratself commented on GitHub (Dec 28, 2024): no
Author
Owner

@github-actions[bot] commented on GitHub (Mar 30, 2025):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Mar 30, 2025): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 7, 2025):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Apr 7, 2025): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#735