Git Product home page Git Product logo

appstore-metadata-service's Introduction

Appstore Metadata Service

Appstore Metadata Service is a group of components purposed to serve the needs of RDK to store and provide the Applications metadata.

Perspectives

The primary component Appstore Metadata Service (ASMS) provides its functionality in a form of REST API. API is split into 2 perspectives:

  • STB It provides the methods that make it possible to search applications using different criteria, and fetch information about a particular application. This perspective provides read-only access to the information hosted by the ASMS.
  • Maintainer Methods exposed to the application developers. Using this set of methods an application developer can manage metadata of the applications. Maintainers are grouped into Companies, they can manage applications that belong to their companies. Thus, they cannot anyhow modify information that is not in their area of responsibility.

Components

Functions provided by ASMS components are split between:

  • ASMS.

    The central component of the ASMS architecture

  • ASMS DB.

    The database used to store applications' metadata

  • ASMS Proxy.

    Proxy in front of ASMS provided in a form of the Nginx server. It limits the set of API methods exposed to the STB devices. Exposed methods could be used only for fetching data. This component should be providing unique authentication/authorization capabilities in future versions of the ASMS initiative.

  • AS3 Proxy.

    One more Nginx proxy in front of ASMS. It exposes ASMS methods used to manage the applications' metadata. Methods provide extended capabilities related to the create/update/delete methods. Also, it takes of authorization of different maintainers to their applications.

Packaging

In order build and package the solution please execute the command:

mvn clean install

Later the built artifacts can be deployed in a form of docker-compose stack.

REST API

API is specified in a form of yaml swagger file according to the principles of OPEN API 3.0

Request samples.

Create maintainer

Request:

curl --location --request POST 'http://localhost:8081/as3/maintainers' \
--header 'Authorization: Basic YXMzOmFzMw==' \
--header 'Content-Type: application/json' \
--data-raw '{
  "code": "lgi",
  "name": "Liberty Global",
  "address": "Liberty Global B.V., Boeing Avenue 53, 1119 PE Schiphol Rijk, The Netherlands",
  "homepage": "https://www.libertyglobal.com",
  "email": "[email protected]"
}'

Response:

HTTP/1.1 201 Created

Get maintainer

Request:

curl --location --request GET 'http://localhost:8081/as3/maintainers/lgi' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YXMzOmFzMw==' \
--data-raw ''

Response:

{
    "code": "lgi",
    "name": "Liberty Global",
    "address": "Liberty Global B.V., Boeing Avenue 53, 1119 PE Schiphol Rijk, The Netherlands",
    "homepage": "https://www.libertyglobal.com",
    "email": "[email protected]"
}

HTTP/1.1 200 OK

Create application

Create application in ASMS using AS3 API:

Request:

curl --location --request POST 'http://localhost:8081/as3/maintainers/lgi/apps' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YXMzOmFzMw==' \
--data-raw '{
    "header": {
            "id": "demo.id.appl",
            "version": "2.2",
            "icon": "http://pretty.url/icon3.png",
            "name": "FancyApp",
            "description": "Description of Fancy application",
            "url": "http://url/fancyappl",
            "visible": true,
            "encryption": false,
            "preferred": false,
            "ociImageUrl": "myregistry.local:5000/testing/test-image",
            "latest" : true,
            "type": "fancy_applications",
            "category": "application",
            "size": "10000000",
            "localization": [
                {
                    "languageCode": "en",
                    "name": "Fancy application",
                    "description": "description"
                }
            ]
        },
        "requirements": {
            "dependencies": [
                {
                    "id": "1.2.3",
                    "version": "string"
                }
            ],
            "platform": {
                "architecture": "arm",
                "variant": "v1",
                "os": "linux"
            },
            "hardware": {
                "ram": "string",
                "dmips": "string",
                "persistent": "string",
                "cache": "string"
            },
            "features": [
                {
                    "name": "string",
                    "version": "string",
                    "required": true
                }
            ]
        },
        "maintainer": {
            "name": "Liberty Global",
            "address": "address",
            "homepage": "http://homepage",
            "email": "[email protected]"
        }
    }'

Response:

HTTP/1.1 201 Created

Search application

A sample of request that is used by STBs to the search an application with the name starting 'Fancy' and provided by the 'Liberty Global' maintainer.

Request:

curl --location --request GET 'http://localhost:8082/asms/apps?name=Fancy&maintainerName=Liberty%20Global' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic c3RiOnN0Yg==' \
--data-raw ''

Response:

{
    "applications": [
        {
            "icon": "http://pretty.url/icon3.png",
            "name": "FancyApp",
            "description": "Description of Fancy application",
            "type": "fancy_applications",
            "size": 10000000,
            "category": "application",
            "localization": [
                {
                    "languageCode": "en",
                    "name": "Fancy application",
                    "description": "description"
                }
            ],
            "id": "demo.id.appl",
            "version": "2.2"
        }
    ],
    "meta": {
        "resultSet": {
            "count": 1,
            "offset": 0,
            "limit": 10,
            "total": 1
        }
    }
}

HTTP/1.1 200 OK

appstore-metadata-service's People

Contributors

adriannowak avatar alewir avatar andyxx avatar den314 avatar dependabot[bot] avatar djasiok avatar karolostaszewski avatar keiron-appleyard avatar krzysztofdzioba avatar kubagruszka avatar lukasz-andrzejak avatar piotr-serafin-red avatar samuel-walsh-red avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.