-
I have self-hosted Keygen and I am learning APIs. I have a license key curl --location 'https://licensing.my-domain.com/v1/accounts/bear/machines/4d:Eq:UV:D3:XZ:tL:WN:Bz:mA:Eg:E6:Mk:YX:dK:NC' \
--header 'Accept: application/vnd.api+json' \
--header 'Authorization: license JJJJ-4FYU-VTCF-34YT-TR9C-AJR3-4RCM-AAXR' Response: {
"data": {
"id": "55999b07-3a95-4cc0-abf7-6809d8f13d78",
"type": "machines",
"attributes": {
"fingerprint": "4d:Eq:UV:D3:XZ:tL:WN:Bz:mA:Eg:E6:Mk:YX:dK:NC",
"cores": null,
"ip": null,
"hostname": null,
"platform": null,
"name": "Test",
"requireHeartbeat": false,
"heartbeatStatus": "NOT_STARTED",
"heartbeatDuration": 600,
"maxProcesses": null,
"lastCheckOut": null,
"lastHeartbeat": null,
"nextHeartbeat": null,
"metadata": {},
"created": "2024-03-28T12:53:07.561Z",
"updated": "2024-03-28T12:53:07.561Z"
},
"relationships": {
"account": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e"
},
"data": {
"type": "accounts",
"id": "30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e"
}
},
"product": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/product"
},
"data": {
"type": "products",
"id": "2be7b68f-1609-4c9f-9f92-ba339414c26c"
}
},
"group": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/group"
},
"data": null
},
"license": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/license"
},
"data": {
"type": "licenses",
"id": "f2d9c751-3048-4cce-ac80-8fa01f0668c1"
}
},
"user": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/user"
},
"data": null
},
"components": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/components"
}
},
"processes": {
"links": {
"related": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78/processes"
}
}
},
"links": {
"self": "/v1/accounts/30d2fc6b-2ace-4c8e-92cd-5fe574d59c3e/machines/55999b07-3a95-4cc0-abf7-6809d8f13d78"
}
}
}
But I cannot update the machine. I want to update the machine name. curl --location --request PATCH 'https://licensing.my-domain.com/v1/accounts/bear/machines/4d:Eq:UV:D3:XZ:tL:WN:Bz:mA:Eg:E6:Mk:YX:dK:NC' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Accept: application/vnd.api+json' \
--header 'Authorization: license JJJJ-4FYU-VTCF-34YT-TR9C-AJR3-4RCM-AAXR' \
--data '{
"data": {
"type": "machines",
"attributes": {
"name": "Test2"
}
}
}' Response: {
"meta": {
"id": "07f4c205-2e14-425d-8695-0dc0ef14042c"
},
"errors": [
{
"title": "Access denied",
"detail": "You do not have permission to complete the request (ensure the token or license is allowed to access all resources)"
}
]
} Did I miss anything or it is a bug? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The license must be unprotected to allow client-side updates. You can adjust that by setting Here's a test case for this behavior, as well as a test case for your current issue below it. |
Beta Was this translation helpful? Give feedback.
The license must be unprotected to allow client-side updates. You can adjust that by setting
protected = false
on the license.Here's a test case for this behavior, as well as a test case for your current issue below it.