allow use of secretId when performing operations on secrets
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-16 16:08:40 +11:00
parent c99ffa8368
commit 498dd9a8c3
4 changed files with 38 additions and 10 deletions

View File

@@ -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)
}