Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDKCOM-4663 RDKDEV-999:Xdial-Parse-authorized-domains #108

Open
wants to merge 1 commit into
base: 24Q2_sprint
Choose a base branch
from

Conversation

ArchaChandran
Copy link

RDKCOM-4663 RDKDEV-999:Xdial-Parse-authorized-domains

(cherry picked from commit 48b8c73)

Signed-off-by: Margret Jaison mjaison.ext@libertyglobal.com

(cherry picked from commit 48b8c73)

Signed-off-by: Margret Jaison <mjaison.ext@libertyglobal.com>
GList *allowed_origins = NULL;
for (int i = 0; i < arraylen; i++) {
struct json_object *origin = json_object_array_get_idx(origins, i);
char *origin_value = g_strdup(json_object_get_string(origin));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how u r passing origin and other params?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The xdial app list is initially populated from the command line. This commit
replaces the naive parsing implementation, which adds the
allowed origins based on hardcoded values with implementation, which
honors the passed origins.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you share the sample command line args passed to the process after this change

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its the -A argument as below,

-A {"/apps/AmazonInstantVideo/dial_data":["www.primevideo.com"],"/apps/Netflix/dial_data":["www.netflix.com","www4.netflix.com"],"/apps/YouTube/dial_data":["www.youtube.com"],"/apps/YouTubeKids/dial_data":["www.youtube.com"],"/apps/system/dial_data":[]}

it can be found as in below,
Hi @apatel859 with this change in place, the -A argument is now a JSon formatted string, earlier it was a plain text and a list w/ or w/o delimeter (as i see in the code, it was just searching for some expected strings like netflix, youtube etc.)

following is something you could see if you check status of the XDial Service,

systemctl status xdial
xdial.service - Service to start/stop xdialserver
Loaded: loaded (/lib/systemd/system/xdial.service; static; vendor preset: enabled)
Active: active (running)
since Wed 2024-04-10 14:38:38 CEST; 54min ago; monotonic: 54min ago
TriggeredBy: * xdial.socket
Process: 7827 ExecStartPre=/container/DIAL/launcher/dial.sh preXdial (code=exited, status=0/SUCCESS)
Main PID: 7918 (gdial-server)
Memory: 392.0K
CGroup: /lxc.slice/xdial.service
`-7915 /usr/bin/lxc-attach -n DIAL -o none -l NOTICE -f /container/DIAL/conf/lxc.conf -u 227 -g 227 -- /bin/sh /usr/share/xdial/startXdial.sh /tmp/env_variables

7918 /usr/share/xdial/gdial-server -I eth2 -F Telenet box -R Mediabox -M 2008C-STB-DEV -U aa6658e6-143e-4e3f-8bed-23a05438bd88 -A {"/apps/AmazonInstantVideo/dial_data":["www.primevideo.com"],"/apps/Netflix/dial_data":["www.netflix.com","www4.netflix.com"],"/apps/YouTube/dial_data":["www.youtube.com"],"/apps/YouTubeKids/dial_data":["www.youtube.com"],"/apps/system/dial_data":[]} --feature-friendlyname --feature-wolwake

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So static list is a legacy solution which we dont want to update. Instead app can whilte list the apps using curl -H "Authorization: Bearer WPEFrameworkSecurityUtility | cut -d '"' -f 4" --header "Content-Type: application/json" --request POST --data '{"jsonrpc":"2.0","id":"3","method": "org.rdk.Xcast.1.registerApplications","params":{"applications":[{"names":["YouTube", "YouTubeKids", "YouTubeTV"],"cors":[".youtube.com"],"properties":{"allowStop" :true}}]}}' http://127.0.0.1:9998/jsonrpc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants