When creating a preauthkey, the default expiration was passed through as
a nil value, instead of the default value (1h). This resulted in the preauthkey being created with expiration key '0001-01-01 00:00:00', which meant the key would not work, because it was already expired. This commit applies the default expiration time (1h) when a preauthkey is created without a specific expiration. It also updates an integration test to make sure this bug does not reoccur.
This commit is contained in:
parent
a52a4d45c0
commit
c7f3e0632b
2 changed files with 11 additions and 8 deletions
|
@ -426,7 +426,12 @@ func (s *IntegrationCLITestSuite) TestPreAuthKeyCommandWithoutExpiry() {
|
|||
assert.Nil(s.T(), err)
|
||||
|
||||
assert.Len(s.T(), listedPreAuthKeys, 1)
|
||||
assert.True(s.T(), time.Time{}.Equal(listedPreAuthKeys[0].Expiration.AsTime()))
|
||||
|
||||
assert.True(s.T(), listedPreAuthKeys[0].Expiration.AsTime().After(time.Now()))
|
||||
assert.True(
|
||||
s.T(),
|
||||
listedPreAuthKeys[0].Expiration.AsTime().Before(time.Now().Add(time.Minute*70)),
|
||||
)
|
||||
}
|
||||
|
||||
func (s *IntegrationCLITestSuite) TestPreAuthKeyCommandReusableEphemeral() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue