allow use of secretId when performing operations on secrets
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type RetrieveInput struct {
|
||||
SecretId int `json:"secretId"`
|
||||
DeviceName string `json:"deviceName"`
|
||||
DeviceCategory string `json:"deviceCategory"`
|
||||
UserName string `json:"userName"`
|
||||
@@ -49,11 +50,14 @@ func RetrieveSecret(c *gin.Context) {
|
||||
|
||||
// Populate fields
|
||||
s := models.Secret{}
|
||||
//s.RoleId = u.RoleId
|
||||
s.DeviceName = input.DeviceName
|
||||
s.DeviceCategory = input.DeviceCategory
|
||||
s.UserName = input.UserName
|
||||
|
||||
if input.SecretId > 0 {
|
||||
s.SecretId = input.SecretId
|
||||
}
|
||||
|
||||
retrieveSpecifiedSecret(&s, c)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user