Adding deactivate_machines
and regenerate_license_code
API methods
#37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds some missing methods #21
I think I will keep both of these API methods and let stores decide which one(s) they want to incorporate.
Deactivate Machines
deactivate_machines
removes a list of machines from all of theonline_machines
lists in a license, and then adds those machine IDs to a list in the top level of the license. When one of these machines contacts the server again to renew its license, the server will locate the machine ID in the list of deactivated machines, return an error, and then removes the machine ID from the list of deactivated machines. The client side code should erase the license code it was trying to use to prevent any more automated requests to the server. By removing it from the machine ID from the list of deactivated machines, users will be able to accidentally remove a machine from their license without it permanently preventing them from reactivating their license on their machine. The machine IDs are also removed from the deactivated machines list after a year of being on the list. This is somewhat ideal in the event that a user sold their computer or if the computer broke, or if the user upgraded their computer and now have a new machine ID. We don't want a bunch of machines to exist on this list for years, as it contributes to a largerlicense_item
size, which will incur more read and write costs if there are over 0.5-2 KB worth of machines on the list. That is why I createdRegenerate License Code
regenerate_license_code
copies the old license data, erases all online machines from the license data, and then updates the new license to have a new license code and offline code. It also deletes the old license to avoid conflicts with the Global Secondary Index, which is a hashed user ID provided by the store.License code regeneration is preferable over a user deactivating machines, but it can only be called by a user once per fortnight (14 days).
Both API methods return the
GetLicenseResponse
protobuf message.