Description
Once prebuilt workspaces have been provisioned and become eligible to be claimed by users, we need to allow them to be claimed and transfered. Implement the mechanism for users to claim prebuild workspaces, transferring ownership from the system user to the claiming user.
Introduce the AGPL (noop) and Enterprise prebuilds.Claimer implementations.
Use them in the coderd/workspaces.go
API endpoints to ensure that prebuilds can be claimed when a user attempts to create a new workspace.
When a claim succeeds, provide the required information about the claimed workspace to the workspace builder. Modify the workspace builder to accept and transform this information to a format which it can then pass on to a provisioner job. Modify the provisionerd server to obtain the post-claim agent token and provide it to provisioners when they acquire new jobs.