Hi,
I created a simple JS service that sends an HTTP GET request and looks like this:
var config = require('./config.json');
var Service = require('webos-service');
var service = new Service("com.ha.webhook.service");
const http = require('http');
const url = `http://${config.ha_url}/api/webhook/`;
service.register("webhook", function (message) {
var id = message.payload.id;
http.get(url + id);
message.respond({
returnValue: true,
data: url + id,
});
});
When I try to run this service using a helper WebApp, I get the following log entries:
[18:52:37.257][WARNING] ls-hubd LSHUB_NO_NAME_PERMS Can not find match for 'com.ha.webhook.service' in pattern queue '["com.webos.service.*", "com.webos.service.*", "com.webos.*", "com.palm.service.*", "com.palm.*", "com.palm.*", "com.lge.*", "com.lge.*", "airplay.service"]' {}
[18:52:37.257][ERR] ls-hubd LSHUB_NO_OUT_PERMS "com.webos.surfacemanager" does not have sufficient outbound permissions to communicate with "com.ha.webhook.service" (cmdline: /usr/bin/surface-manager -platform starfish) {"DEST_APP_ID":"com.ha.webhook.service","SRC_APP_ID":"com.webos.surfacemanager","EXE":"/usr/bin/surface-manager","PID":1853}
[18:52:37.257][WARNING] ls-hubd LSHUB_NO_SERVICE _LSHubSendQueryNameReplyMessage: Failed Connecting to Service err_code: -2, service_name: "com.ha.webhook.service", unique_name: "(null)", static, fd -1 {}
[18:52:37.260][INFO] VOICEFW VOICEUI_FOREGROUND foreground changed {"foreground":"com.webos.app.hdmi1"}
[18:52:37.262][WARNING] surface-manager LSM Hub error detected for token: 724 "webhook" "PermissionDenied" {}
[18:52:37.262][WARNING] surface-manager LSM Error response for token: 724 -1 "Not permitted to send to com.ha.webhook.service." {}
I tells me that my service name must match any of these patterns:
["com.webos.service.*", "com.webos.service.*", "com.webos.*", "com.palm.service.*", "com.palm.*", "com.palm.*", "com.lge.*", "com.lge.*", "airplay.service"]
So I tried to change my service name to com.webos.ha.service
so that it fits the proposed patterns.
Unfortunately, this does not work and I get the following errors:
ares-install ERR! [com.webos.appInstallService failure]: luna-send command failed <Cannnot install privileged app on developer mode>
ares-install ERR! [Tips]: Please change the app id (app id should not start with 'com.lge', 'com.webos', 'com.palm')
So I experimented a bit and the only name that worked for me was com.webos
.
And to be honest, I think this is a bug because based on the error message above, this name shouldn’t work either.
Therefore my question: Is there a way to take a freely chosen service name and fix the original permission problem?