Get whitelisted URLs -json
This commit adds a json file that specifies whitelisted URLs to
be allowed access by REST server.
Change-Id: Ie9aaa6a1f9de00799e22af450c436d5e791c4b2a
Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest.bb b/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest.bb
index a1a8cfd..f18e55c 100644
--- a/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest.bb
+++ b/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest.bb
@@ -24,9 +24,19 @@
pyphosphor-dbus \
pyphosphor-wsgi-apps-ns \
"
+SRC_URI += "file://url_config.json \
+ "
+
+FILES_${PN}_append = " ${datadir}/rest-dbus/url_config.json"
S = "${WORKDIR}/git/module"
SYSTEMD_SERVICE_${PN} = ""
SYSTEMD_OVERRIDE_${PN} += "rest-dbus.conf:obmc-mapper.target.d/rest-dbus.conf"
SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/wsgi_app"
REGISTERED_SERVICES_${PN} += "phosphor_rest:tcp:443"
+
+do_install_append(){
+ install -d ${D}${datadir}/rest-dbus
+ install -m 0644 -D ${WORKDIR}/url_config.json \
+ ${D}${datadir}/rest-dbus/url_config.json
+}
diff --git a/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json b/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json
new file mode 100644
index 0000000..d11b555
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/interfaces/phosphor-rest/url_config.json
@@ -0,0 +1,13 @@
+{
+ "urls": [
+ "/org/openbmc/*",
+ "/xyz/openbmc_project/*",
+ "/enumerate",
+ "/list",
+ "/login",
+ "/logout",
+ "/subscribe",
+ "/upload/image",
+ "/download/dump/*"
+ ]
+}