Skip to content

Commit 521833b

Browse files
committed
update archive date validation
1 parent 6bd1ac5 commit 521833b

2 files changed

Lines changed: 0 additions & 26 deletions

File tree

cmd/sandbox/create.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,6 @@ func getEpochFromTTL(ttl string) (int64, error) {
203203
return 0, slackerror.New(slackerror.ErrInvalidArchiveTTL)
204204
}
205205

206-
maxAllowed := now.AddDate(0, 6, 0)
207-
minAllowed := now.AddDate(0, 0, 1)
208-
if target.Before(minAllowed) {
209-
return 0, slackerror.New(slackerror.ErrInvalidArchiveTTL)
210-
}
211-
if target.After(maxAllowed) {
212-
return 0, slackerror.New(slackerror.ErrInvalidArchiveTTL)
213-
}
214-
215206
return target.Unix(), nil
216207
}
217208

cmd/sandbox/create_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -523,23 +523,6 @@ func Test_getEpochFromTTL(t *testing.T) {
523523
cm.API.AssertNotCalled(t, "CreateSandbox", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything)
524524
},
525525
},
526-
"7mo exceeds max": {
527-
CmdArgs: []string{
528-
"--experiment=sandboxes",
529-
"--token", "xoxb-test-token",
530-
"--name", "ttl-box",
531-
"--domain", "ttl-box",
532-
"--password", "pass",
533-
"--archive-ttl", "7mo",
534-
},
535-
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
536-
setupCreateAuthOnly(t, ctx, cm)
537-
},
538-
ExpectedErrorStrings: []string{"Invalid TTL"},
539-
ExpectedAsserts: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock) {
540-
cm.API.AssertNotCalled(t, "CreateSandbox", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything)
541-
},
542-
},
543526
"invalid": {
544527
CmdArgs: []string{
545528
"--experiment=sandboxes",

0 commit comments

Comments
 (0)