mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
- added new method to get api key by ID - added tests
This commit is contained in:
parent
7cc28b10a0
commit
5839f96787
5 changed files with 56 additions and 0 deletions
|
@ -63,6 +63,11 @@ func (a *apiKeyService) GenerateApiKey(user portainer.User, description string)
|
|||
return prefixedAPIKey, apiKey, nil
|
||||
}
|
||||
|
||||
// GetAPIKey returns an API key by its ID.
|
||||
func (a *apiKeyService) GetAPIKey(apiKeyID portainer.APIKeyID) (*portainer.APIKey, error) {
|
||||
return a.apiKeyRepository.GetAPIKey(apiKeyID)
|
||||
}
|
||||
|
||||
// GetAPIKeys returns all the API keys associated to a user.
|
||||
func (a *apiKeyService) GetAPIKeys(userID portainer.UserID) ([]portainer.APIKey, error) {
|
||||
return a.apiKeyRepository.GetAPIKeysByUserID(userID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue