diff --git a/cmd/newallocation.go b/cmd/newallocation.go index 14026e8d..3cc0fb6d 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -245,6 +245,14 @@ var newallocationCmd = &cobra.Command{ } } + var authRoundExpiry int64 + if flags.Changed("auth_round_expiry") { + authRoundExpiry, err = flags.GetInt64("auth_round_expiry") + if err != nil { + log.Fatal("invalid forbid_upload: ", err) + } + } + var allocationID string if len(owner) == 0 { options := sdk.CreateAllocationOptions{ @@ -267,6 +275,7 @@ var newallocationCmd = &cobra.Command{ Force: force, IsEnterprise: isEnterprise, StorageVersion: int(storageVersion), + AuthRoundExpiry: authRoundExpiry, } allocationID, _, _, err = sdk.CreateAllocationWith(options) if err != nil { @@ -284,7 +293,7 @@ var newallocationCmd = &cobra.Command{ } allocationID, _, _, err = sdk.CreateAllocationForOwner(owner, ownerPublicKey, *datashards, *parityshards, - *size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams, 0) + *size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams, authRoundExpiry) if err != nil { log.Fatal("Error creating allocation: ", err) } @@ -366,6 +375,7 @@ func init() { newallocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation") newallocationCmd.Flags().Int64("storage_version", 0, "storaage version of allocation") + newallocationCmd.Flags().Int64("auth_round_expiry", 0, "storaage version of allocation") } func storeAllocation(allocationID string) { diff --git a/cmd/updateallocation.go b/cmd/updateallocation.go index b5b348ff..f8a41073 100755 --- a/cmd/updateallocation.go +++ b/cmd/updateallocation.go @@ -119,6 +119,14 @@ var updateAllocationCmd = &cobra.Command{ fileOptionParams.ForbidRename.Value = forbidRename } + var authRoundExpiry int64 + if flags.Changed("auth_round_expiry") { + authRoundExpiry, err = flags.GetInt64("auth_round_expiry") + if err != nil { + log.Fatal("invalid auth_round_expiry: ", err) + } + } + if addBlobberId != "" { allocationObj, err := sdk.GetAllocation(allocID) if err != nil { @@ -131,7 +139,7 @@ var updateAllocationCmd = &cobra.Command{ allocUnderRepair = true if txnHash, err := allocationObj.UpdateWithRepair( size, - 0, + authRoundExpiry, extend, lock, addBlobberId, @@ -155,7 +163,7 @@ var updateAllocationCmd = &cobra.Command{ } else { txnHash, _, err := sdk.UpdateAllocation( size, - 0, + authRoundExpiry, extend, allocID, lock, @@ -205,4 +213,5 @@ func init() { updateAllocationCmd.Flags().Bool("forbid_copy", false, "(default false) specify if the users cannot copy object from this allocation") updateAllocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation") + updateAllocationCmd.Flags().Int64("auth_round_expiry", 0, "auth round expiry in seconds") }