Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding deactivate_machines and regenerate_license_code API methods #37

Merged
merged 12 commits into from
Jun 19, 2024

Conversation

nstilt1
Copy link
Owner

@nstilt1 nstilt1 commented Jun 19, 2024

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 the online_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 larger license_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 created

Regenerate 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.

@nstilt1 nstilt1 mentioned this pull request Jun 19, 2024
6 tasks
@nstilt1 nstilt1 merged commit 3bf068d into master Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant