Skip to content

Commit

Permalink
Merge branch 'rdkcentral:sprint/24Q4' into feature/ODM_Phase1
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunbinu authored Dec 9, 2024
2 parents 6739f7a + c821a16 commit f2c50b5
Show file tree
Hide file tree
Showing 23 changed files with 1,369 additions and 47 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/L2-ContentProtection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: L2-ContentProtection

on:
push:
paths:
- ContentProtection/**
- .github/workflows/*ContentProtection*.yml
pull_request:
paths:
- ContentProtection/**
- .github/workflows/*ContentProtection*.yml

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
path: ${{github.repository}}

- name: Install cmake
run: |
sudo apt update
sudo apt install -y cmake
- name: Build Thunder
working-directory: ${{github.workspace}}
run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh

- name: Build
working-directory: ${{github.workspace}}
run: |
cmake -S ${GITHUB_REPOSITORY}/ContentProtection -B build/ContentProtection -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_CXX_FLAGS="-Wall -Werror"
cmake --build build/ContentProtection --target install
44 changes: 12 additions & 32 deletions Analytics/Analytics.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"info": {
"title": "Analytics API",
"class": "Analytics",
"description": "The `Analytics` plugin allows sending analytics events to dedicated backends."
"description": "The `Analytics` plugin allows sending analytics events to dedicated backends. Currently the SIFT backend is supported."
},
"common": {
"$ref": "../common/common.json"
Expand Down Expand Up @@ -49,17 +49,20 @@
"example": 35000
},
"eventPayload":{
"summary": "The payload of the event",
"summary": "Custom payload of the event in JSON format. User defined colection of objects and keys. May be an empty object",
"type": "object",
"example": {
"key1": "value1",
"key2": "value2"
"properties": {
"keyOrObject": {
"summary": "User defined custom key or object",
"type": "string",
"example": "value1"
}
}
}
},
"methods": {
"sendEvent":{
"summary": "Send event",
"summary": "Enqueue an event to be sent to the SIFT analytics backend",
"params": {
"type":"object",
"properties": {
Expand Down Expand Up @@ -97,32 +100,9 @@
]
},
"result": {
"$ref": "#/common/result"
}
},
"setSessionId" : {
"summary": "Set the session ID for the analytics events",
"params": {
"type":"object",
"properties": {
"sessionId":{
"summary": "Session ID",
"type": "string",
"example": "1234567890"
}
},
"required": [
"sessionId"
]
},
"result": {
"$ref": "#/common/result"
}
},
"setTimeReady" : {
"summary": "Let the analytics plugin know that the system time is ready and valid",
"result": {
"$ref": "#/common/result"
"summary": "On success null will be returned",
"type": "string",
"example": "null"
}
}
}
Expand Down
131 changes: 119 additions & 12 deletions Analytics/AnalyticsPlugin.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,120 @@
{
"$schema": "https://raw.githubusercontent.com/rdkcentral/rdkservices/main/Tools/json_generator/schemas/plugin.schema.json",
"info": {
"title": "Analytics Plugin",
"callsign": "org.rdk.Analytics",
"locator": "libWPEFrameworkAnalytics.so",
"status": "development",
"description": "The `Analytics` plugin allows to send analytics events to dedicated backends."
},
"interface": {
"$ref": "Analytics.json#"
}
}
"$schema":"https://raw.githubusercontent.com/rdkcentral/rdkservices/main/Tools/json_generator/schemas/plugin.schema.json",
"info":{
"title":"Analytics Plugin",
"callsign":"org.rdk.Analytics",
"locator":"libWPEFrameworkAnalytics.so",
"status":"development",
"description":"The `Analytics` plugin allows to send analytics events to dedicated backends. Currently the SIFT backend is supported."
},
"configuration":{
"type":"object",
"properties":{
"configuration":{
"type":"object",
"properties":{
"deviceosname":{
"description":"Device OS name",
"type":"string"
},
"sift":{
"type":"object",
"properties":{
"schema2":{
"description":"If true, enables Sift 2.0 schema, otherwise uses Sift 1.0 schema",
"type":"boolean"
},
"commonschema":{
"description":"Sift schema common schema",
"type":"string"
},
"env":{
"description":"Sift schema environment",
"type":"string"
},
"productname":{
"description":"Sift schema product name",
"type":"string"
},
"loggername":{
"description":"Sift schema logger name",
"type":"string"
},
"loggerversion":{
"description":"Sift schema logger version",
"type":"string"
},
"platformdefault":{
"description":"Sift schema platform default value",
"type":"string"
},
"maxrandomisationwindowtime":{
"description":"Sift uploader max randomisation window time of posting queued events in seconds",
"type":"number"
},
"maxeventsinpost":{
"description":"Sift uploader max events in single post",
"type":"number"
},
"maxretries":{
"description":"Sift uploader max retries posting events",
"type":"number"
},
"minretryperiod":{
"description":"Sift uploader min retry period seconds",
"type":"number"
},
"maxretryperiod":{
"description":"Sift uploader max retry period seconds",
"type":"number"
},
"exponentialperiodicfactor":{
"description":"Sift uploader exponential periodic factor for retry delay",
"type":"number"
},
"storepath":{
"description":"Sift store path to persistent queue with events",
"type":"number"
},
"eventslimit":{
"description":"Sift store events limit",
"type":"number"
},
"url":{
"description":"URL to Sift server endpoint",
"type":"string"
}
},
"required":[
"schema2",
"commonschema",
"productname",
"loggername",
"loggerversion",
"platformdefault",
"maxrandomisationwindowtime",
"maxeventsinpost",
"maxretries",
"minretryperiod",
"maxretryperiod",
"exponentialperiodicfactor",
"storepath",
"eventslimit",
"url"
]
}
},
"required":[
"deviceosname",
"sift"
]
}
},
"required":[
"configuration"
]
},
"interface":{
"$ref":"Analytics.json#"
}
}
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ if(PLUGIN_MIGRATIONPREPARER)
add_subdirectory(MigrationPreparer)
endif()

if(PLUGIN_CONTENTPROTECTION)
add_subdirectory(ContentProtection)
endif()

if(WPEFRAMEWORK_CREATE_IPKG_TARGETS)
set(CPACK_GENERATOR "DEB")
set(CPACK_DEB_COMPONENT_INSTALL ON)
Expand Down
25 changes: 25 additions & 0 deletions ContentProtection/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to this RDK Service will be documented in this file.

* Each RDK Service has a CHANGELOG file that contains all changes done so far. When version is updated, add a entry in the CHANGELOG.md at the top with user friendly information on what was changed with the new version. Please don't mention JIRA tickets in CHANGELOG.

* Please Add entry in the CHANGELOG for each version change and indicate the type of change with these labels:
* **Added** for new features.
* **Changed** for changes in existing functionality.
* **Deprecated** for soon-to-be removed features.
* **Removed** for now removed features.
* **Fixed** for any bug fixes.
* **Security** in case of vulnerabilities.

* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [1.0.0] - 2024-07-15
### Added
- Add CHANGELOG

### Change
- Reset API version to 1.0.0
- Change README to inform how to update changelog and API version
44 changes: 44 additions & 0 deletions ContentProtection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2022 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.14)

set(PLUGIN_NAME ContentProtection)
find_package(WPEFramework NAMES WPEFramework Thunder)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(CMAKE_CXX_STANDARD 11)

set(PLUGIN_CONTENTPROTECTION_STARTUPORDER "" CACHE STRING "To configure startup order of the plugin")
set(PLUGIN_CONTENTPROTECTION_AUTOSTART false CACHE STRING "To automatically start the plugin")

add_library(${MODULE_NAME} SHARED
ContentProtection.cpp
Module.cpp
)

find_package(${NAMESPACE}Plugins REQUIRED)
find_package(${NAMESPACE}Definitions REQUIRED)
target_link_libraries(${MODULE_NAME} PRIVATE
${NAMESPACE}Plugins::${NAMESPACE}Plugins
${NAMESPACE}Definitions::${NAMESPACE}Definitions
)

install(TARGETS ${MODULE_NAME}
DESTINATION lib/${STORAGE_DIRECTORY}/plugins)

write_config(${PLUGIN_NAME})
4 changes: 4 additions & 0 deletions ContentProtection/ContentProtection.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.ContentProtection"
autostart = "@PLUGIN_CONTENTPROTECTION_AUTOSTART@"
startuporder = "@PLUGIN_CONTENTPROTECTION_STARTUPORDER@"
7 changes: 7 additions & 0 deletions ContentProtection/ContentProtection.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(autostart ${PLUGIN_CONTENTPROTECTION_AUTOSTART})
set(preconditions Platform)
set(callsign "org.rdk.ContentProtection")

if(PLUGIN_CONTENTPROTECTION_STARTUPORDER)
set (startuporder ${PLUGIN_CONTENTPROTECTION_STARTUPORDER})
endif()
Loading

0 comments on commit f2c50b5

Please sign in to comment.