(name string, username string)
| 23 | } |
| 24 | |
| 25 | func (s *authKeyService) CreateAuthKey(name string, username string) (string, error) { |
| 26 | authKey := &model.AuthKey{ |
| 27 | Name: name, |
| 28 | Key: utils.GenerateAuthKey(), |
| 29 | IsValid: true, |
| 30 | CreatedBy: username, |
| 31 | } |
| 32 | authKey, err := s.authKeyRepository.Insert(authKey) |
| 33 | if err != nil { |
| 34 | return "", err |
| 35 | } |
| 36 | return authKey.Key, nil |
| 37 | } |
| 38 | |
| 39 | func (s *authKeyService) GetByAuthKey(key string) (*model.AuthKey, error) { |
| 40 | authKey, err := s.authKeyRepository.GetById(key) |
nothing calls this directly
no test coverage detected