mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-22 18:18:00 +00:00
state: add GetAPIKeyByID method
Add GetAPIKeyByID method to the state layer, delegating to the existing database layer function. This enables API key lookup by ID in addition to the existing prefix-based lookup. Updates #2986
This commit is contained in:
parent
515a22e696
commit
42bd9cd058
1 changed files with 5 additions and 0 deletions
|
|
@ -998,6 +998,11 @@ func (s *State) GetAPIKey(displayPrefix string) (*types.APIKey, error) {
|
|||
return s.db.GetAPIKey(prefix)
|
||||
}
|
||||
|
||||
// GetAPIKeyByID retrieves an API key by its database ID.
|
||||
func (s *State) GetAPIKeyByID(id uint64) (*types.APIKey, error) {
|
||||
return s.db.GetAPIKeyByID(id)
|
||||
}
|
||||
|
||||
// ExpireAPIKey marks an API key as expired.
|
||||
func (s *State) ExpireAPIKey(key *types.APIKey) error {
|
||||
return s.db.ExpireAPIKey(key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue