mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-02 15:27:42 +02:00
bug fix
This commit is contained in:
parent
ac77ee3bc4
commit
228ecf9b78
@ -245,6 +245,13 @@ func (t *TargetAPI) Put() {
|
|||||||
if hasEnabledPolicy {
|
if hasEnabledPolicy {
|
||||||
t.CustomAbort(http.StatusBadRequest, "the target is associated with policy which is enabled")
|
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 {
|
req := struct {
|
||||||
Name *string `json:"name"`
|
Name *string `json:"name"`
|
||||||
|
Loading…
Reference in New Issue
Block a user