(key db.AccessKey)
| 70 | } |
| 71 | |
| 72 | func (s *AccessKeyServiceImpl) Create(key db.AccessKey) (newKey db.AccessKey, err error) { |
| 73 | |
| 74 | // SerializeSecret encrypts/persists the secret for writable backends. For read-only |
| 75 | // external storage the secret is not stored in Semaphore, so SerializeSecret fails |
| 76 | // with ErrReadOnlyStorage; we still create the access key row (metadata / reference). |
| 77 | err = s.encryptionService.SerializeSecret(&key) |
| 78 | if err != nil && !errors.Is(err, ErrReadOnlyStorage) { |
| 79 | return |
| 80 | } |
| 81 | |
| 82 | newKey, err = s.accessKeyRepo.CreateAccessKey(key) |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | func (s *AccessKeyServiceImpl) Update(key db.AccessKey) (err error) { |
| 87 | if !key.OverrideSecret { |
nothing calls this directly
no test coverage detected