MCPcopy
hub / github.com/semaphoreui/semaphore / Create

Method Create

services/server/access_key_svc.go:72–84  ·  view source on GitHub ↗
(key db.AccessKey)

Source from the content-addressed store, hash-verified

70}
71
72func (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
86func (s *AccessKeyServiceImpl) Update(key db.AccessKey) (err error) {
87 if !key.OverrideSecret {

Callers

nothing calls this directly

Calls 2

SerializeSecretMethod · 0.65
CreateAccessKeyMethod · 0.65

Tested by

no test coverage detected