mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 11:46:43 +01:00
Merge pull request #1981 from ywk253100/170408_target
Fix bug in updating target
This commit is contained in:
commit
e6380567d4
@ -245,6 +245,13 @@ func (t *TargetAPI) Put() {
|
||||
if hasEnabledPolicy {
|
||||
t.CustomAbort(http.StatusBadRequest, "the target is associated with policy which is enabled")
|
||||
}
|
||||
if len(target.Password) != 0 {
|
||||
target.Password, err = utils.ReversibleDecrypt(target.Password, t.secretKey)
|
||||
if err != nil {
|
||||
log.Errorf("failed to decrypt password: %v", err)
|
||||
t.CustomAbort(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError))
|
||||
}
|
||||
}
|
||||
|
||||
req := struct {
|
||||
Name *string `json:"name"`
|
||||
|
Loading…
Reference in New Issue
Block a user