Closed gbern-tg closed 10 months ago
@gbern-tg
Hi Grady, I made a commit to fix an issue where the createResource call in different places was not working because the order of the function argument was changed. Please let me know if you are happy with the changes?
I also tried to add the functionality of importing (creating and updating) security policy directly but this is require quite a bit of effort (though we can still change security policy by editing resource during the import), is this needed for your use-case ?
I ran the following tests:
Are there anything else you believe I should be testing in particular and could you let me know what have you tested already please?
Bulk update/create Resources from Excel
Functionality: a means to allow admins to bulk update/create resources from excel.
Example:
./tg export
- by default, exports the admin's tenant into an xlsx file./tg import -f <xlsx-file>
- will import the saved configuration changes and attempt to either (a) update the existing resource or (b) create a new resourceExplanation of changes:
TwingateApiClient.mjs:
groups
andserviceAccounts
is now deprecated for theaccess
connection, there doesn't seem to be consistency across the API so I left as is (FRs that need to be requested below).createResource()
for expanded functionality with the mutationupdateResource()
to allow bulk update functionality with the mutationsmallUtilFuncs.mjs:
readerFromStreamReader
seems to be deprecated, temporarily updated module to the last working version (not familiar enough with a path forward - @chenbishop?)genFileNameFromNetworkName()
to accommodate new output folder so import/export files aren't dropped in main directoryimportCmd.mjs:
updateResource()
createResource()
outputDir
so import files aren't dropped in main directoryexportCmd.mjs:
outputDir
so export files aren't dropped in main directoryInstructions/Limitations & FRs needed:
Instructions/Limitations:
name
, (b)remoteNetworkLabel
, and (c)addressValue
specified. -serviceAccounts
will not get updated as there is currently no argument available forresourceCreate
mutation. -isActive
will not get updated as there is currently no argument available forresourceCreate
.name
, (b)remoteNetworkLabel
, and (c)addressValue
are specified. -serviceAccounts
will not get updated as there is currently no argument available forresourceUpdate
.FRs needed:
resourceUpdate
MutationserviceAccounts ([])
- or the newaccess{serviceAccounts, groupIds}
resourceCreate
MutationisActive (boolean)
serviceAccounts ([])
- or goes off the newaccess{serviceAccounts, groupIds}