Browse Source
The enrollment now collects its license key from the portal when the grant is done, and keeps it in tb_cluster.license_secret. A claim that has nothing to hand over yet leaves the flow for the next poll; a refused claim ends the flow registered without a key; a transport failure is left to the existing backoff.pull/16221/head
11 changed files with 242 additions and 8 deletions
@ -0,0 +1,16 @@ |
|||
package org.thingsboard.server.service.community_grant; |
|||
|
|||
import org.springframework.web.client.HttpStatusCodeException; |
|||
import org.springframework.web.client.RestClientException; |
|||
|
|||
/** |
|||
* Thrown by {@link CommunityGrantPortalClient#claimLicense} when the portal will not hand the license key |
|||
* over. Terminal, unlike a transport failure: retrying the claim cannot change the answer. |
|||
*/ |
|||
public class CommunityGrantLicenseClaimRefusedException extends RestClientException { |
|||
|
|||
public CommunityGrantLicenseClaimRefusedException(HttpStatusCodeException cause) { |
|||
super(cause.getMessage(), cause); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package org.thingsboard.server.service.community_grant; |
|||
|
|||
public record CommunityGrantLicenseClaimRequest(String claimToken) { |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package org.thingsboard.server.service.community_grant; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
|
|||
/** {@code secret} is set only once {@code activated} is true. */ |
|||
@JsonIgnoreProperties(ignoreUnknown = true) |
|||
public record CommunityGrantLicenseClaimResponse(boolean activated, String secret) { |
|||
} |
|||
Loading…
Reference in new issue