mirror of https://github.com/portainer/portainer
Add hideFields()
parent
1732548e59
commit
adf8846c28
|
@ -49,5 +49,7 @@ func (handler *Handler) deploymentkeyCreate(w http.ResponseWriter, r *http.Reque
|
|||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to persist the deployment key inside the database", err}
|
||||
}
|
||||
|
||||
hideFields(deploymentkey)
|
||||
|
||||
return response.JSON(w, deploymentkey)
|
||||
}
|
||||
|
|
|
@ -23,5 +23,7 @@ func (handler *Handler) deploymentkeyInspect(w http.ResponseWriter, r *http.Requ
|
|||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find a deployment key with the specified identifier inside the database", err}
|
||||
}
|
||||
|
||||
hideFields(deploymentkey)
|
||||
|
||||
return response.JSON(w, deploymentkey)
|
||||
}
|
||||
|
|
|
@ -14,5 +14,9 @@ func (handler *Handler) deploymentkeyList(w http.ResponseWriter, r *http.Request
|
|||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve deploymentkeys from the database", err}
|
||||
}
|
||||
|
||||
for idx := range deploymentkeys {
|
||||
hideFields(&deploymentkeys[idx])
|
||||
}
|
||||
|
||||
return response.JSON(w, deploymentkeys)
|
||||
}
|
||||
|
|
|
@ -15,6 +15,10 @@ type Handler struct {
|
|||
DeploymentKeyService portainer.DeploymentKeyService
|
||||
}
|
||||
|
||||
func hideFields(deploymentkey *portainer.DeploymentKey) {
|
||||
deploymentkey.PrivateKey = ""
|
||||
}
|
||||
|
||||
// NewHandler creates a handler to manage settings operations.
|
||||
func NewHandler(bouncer *security.RequestBouncer) *Handler {
|
||||
h := &Handler{
|
||||
|
|
Loading…
Reference in New Issue