mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-09-13 14:29:09 +00:00
cleanups
This commit is contained in:
parent
5b34b6da86
commit
fb0ce5892b
4 changed files with 21 additions and 13 deletions
|
@ -100,8 +100,9 @@ func CreateResourceV5(ctx context.Context, c *api.Client, folderParentID, name,
|
|||
}
|
||||
resource.Secrets = []api.Secret{{Data: encSecretData}}
|
||||
|
||||
if c.PasswordExpirySettings.DefaultExpiryPeriod != 0 {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(c.PasswordExpirySettings.DefaultExpiryPeriod))
|
||||
passwordExpirySettings := c.GetPasswordExpirySettings()
|
||||
if passwordExpirySettings.DefaultExpiryPeriod != 0 {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(passwordExpirySettings.DefaultExpiryPeriod))
|
||||
resource.Expired = &api.Time{Time: expiry}
|
||||
}
|
||||
|
||||
|
@ -160,8 +161,9 @@ func CreateResourceV4(ctx context.Context, c *api.Client, folderParentID, name,
|
|||
}
|
||||
resource.Secrets = []api.Secret{{Data: encSecretData}}
|
||||
|
||||
if c.PasswordExpirySettings.DefaultExpiryPeriod != 0 {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(c.PasswordExpirySettings.DefaultExpiryPeriod))
|
||||
passwordExpirySettings := c.GetPasswordExpirySettings()
|
||||
if passwordExpirySettings.DefaultExpiryPeriod != 0 {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(passwordExpirySettings.DefaultExpiryPeriod))
|
||||
resource.Expired = &api.Time{Time: expiry}
|
||||
}
|
||||
|
||||
|
|
|
@ -377,8 +377,9 @@ func UpdateResource(ctx context.Context, c *api.Client, resourceID, name, userna
|
|||
})
|
||||
}
|
||||
|
||||
if resource.Expired != nil && c.PasswordExpirySettings.AutomaticUpdate {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(c.PasswordExpirySettings.DefaultExpiryPeriod))
|
||||
passwordExpirySettings := c.GetPasswordExpirySettings()
|
||||
if resource.Expired != nil && passwordExpirySettings.AutomaticUpdate {
|
||||
expiry := time.Now().Add(time.Hour * 24 * time.Duration(passwordExpirySettings.DefaultExpiryPeriod))
|
||||
newResource.Expired = &api.Time{expiry}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue