fix: Send signature and message in publishService body

The auth middleware expects username, signature, and message in the request
body for POST requests. The service object already contains signature and
message from rondevu.ts, so we just need to ensure they're sent by spreading
the service object and adding username.
This commit is contained in:
2025-12-12 12:38:33 +01:00
parent 1112eeefd4
commit 214f611dc2

View File

@@ -398,14 +398,15 @@ export class RondevuAPI {
* Service FQN must include username: service:version@username
*/
async publishService(service: ServiceRequest): Promise<Service> {
const auth = await this.generateAuthParams('publishService', service.serviceFqn);
const response = await fetch(`${this.baseUrl}/services`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ ...service, username: auth.username }),
body: JSON.stringify({
...service,
username: this.username
}),
})
if (!response.ok) {