Skip to content

Commit

Permalink
Merge branch 'master' into release/1.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rg2011 authored Nov 20, 2023
2 parents 317064c + 8602d83 commit a3fc732
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 355 deletions.
2 changes: 2 additions & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Remove: `disableDomainMiddleware` config option
- Remove: `DISABLE_DOMAIN_MIDDLEWARE` environment variable
- Remove: operations no longer supported in CB API (aligned with Orion 3.10.1)
- Upgrade NodeJS version from 14-slim to 16-slim in Dockerfile
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[![FIWARE Security](https://nexus.lab.fiware.org/static/badges/chapters/security.svg)](https://www.fiware.org/developers/catalogue/)
[![License: APGL](https://img.shields.io/github/license/telefonicaid/fiware-pep-steelskin.svg)](https://opensource.org/licenses/AGPL-3.0)
[![Quay badge](https://img.shields.io/badge/quay.io-fiware%2Fpep--steelskin-grey?logo=red%20hat&labelColor=EE0000)](https://quay.io/repository/fiware/pep-steelskin)
[![Docker badge](https://img.shields.io/badge/docker-telefonicaiot%2Ffiware--pep--steelskin-blue?logo=docker)](https://hub.docker.com/r/telefonicaiot/fiware-pep-steelskin)
<br/>
[![CI](https://github.com/telefonicaid/fiware-pep-steelskin/workflows/CI/badge.svg)](https://github.com/telefonicaid/fiware-pep-steelskin/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/github/telefonicaid/fiware-pep-steelskin/badge.svg?branch=master)](https://coveralls.io/github/telefonicaid/fiware-pep-steelskin?branch=master)
Expand Down Expand Up @@ -45,7 +47,7 @@ Three other documents provide further information about the PEP Proxy:
### Dependencies
The PEP Proxy is standard Node.js app and doesn't require more dependencies than the Node.js interpreter (0.10 or higher) and the NPM package utility. For RPM installations using Yum, those dependencies should be automatically installed.

### Without RPM Packages
### Without RPM Packages
Just checkout this directory and install the Node.js dependencies using:

```
Expand Down Expand Up @@ -399,7 +401,7 @@ For testing purposes it might be interesting to launch the process directly with
Take into account that when the process is executed manually the system configuration for the script (in /etc/sysconfig/pepProxy) is not loaded and the default configuration (in /opt/pepProxy/config.js) is used.
#### Stop service
#### Stop service
To stop the service, use either the service command:
```
service pepProxy stop
Expand Down Expand Up @@ -708,7 +710,7 @@ An up-to-date list of the convenience operations can be found [here](https://doc
| GET | /v1/contextTypes | R |
| GET | /v1/contextTypes{typename} | R |
#### NGSIv2
#### NGSIv2
| Method | Path | Action |
| ------ |:--------------------------------------------------------------------------------------- | ---:|
| GET | /v2 | R |
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# For those usages not covered by the GNU Affero General Public License
# please contact with: [sc_support at telefonica dot com]

ARG NODE_VERSION=14-slim
ARG NODE_VERSION=16-slim
FROM node:${NODE_VERSION}
ARG GITHUB_ACCOUNT=telefonicaid
ARG GITHUB_REPOSITORY=fiware-pep-steelskin
Expand Down
63 changes: 6 additions & 57 deletions lib/plugins/orionUrls.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,64 +34,13 @@
* this table will fail).
*/
module.exports = [
/* Standard NGSI operations */
/* Legacy NGSI operations (to be removed soon) */
/* Note POST /(v1|ngsi10)/updateContext is not included here,
/* as it is processed in an special way in orionPlugin.js */
['POST', /\/(v1|ngsi10)\/querycontext$/, 'read'],
['POST', /\/(v1|ngsi10)\/subscribecontext$/, 'subscribe'],
['POST', /\/(v1|ngsi10)\/updatecontextsubscription$/, 'subscribe'],
['POST', /\/(v1|ngsi10)\/unsubscribecontext$/, 'subscribe'],
['POST', /\/(v1\/registry|ngsi9)\/registercontext$/, 'register'],
['POST', /\/(v1\/registry|ngsi9)\/discovercontextavailability$/, 'discover'],
['POST', /\/v1\/contexttypes$/, 'read'],


/* "Classic" NGSI9 operations */
['GET', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributes$/, 'N/A'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributes$/, 'N/A'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributes\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributes\/.+/, 'register'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributeDomains\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentities\/.+\/attributeDomains\/.+/, 'register'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentities\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentities\/.+/, 'register'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributes$/, 'N/A'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributes$/, 'N/A'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributes\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributes\/.+/, 'register'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributeDomains\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+\/attributeDomains\/.+/, 'register'],
['GET', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+/, 'discover'],
['POST', /^\/(ngsi9|v1\/registry)\/contextentitytypes\/.+/, 'register'],
/* "Classic" NGSI10 operations */
['GET', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes$/, 'N/A'],
['PUT', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes$/, 'N/A'],
['POST', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes$/, 'N/A'],
['DELETE', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes$/, 'N/A'],
['GET', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+/, 'read'],
['POST', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+/, 'create'],
['PUT', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+/, 'update'],
['DELETE', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+/, 'delete'],
['GET', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+\/.+/, 'read'],
['PUT', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+\/.+/, 'update'],
['DELETE', /^\/(ngsi10|v1)\/contextentities\/.+\/attributes\/.+\/.+/, 'delete'],
['GET', /^\/(ngsi10|v1)\/contextentities\/.+\/attributeDomains\/.+/, 'read'],
['GET', /^\/(ngsi10|v1)\/contextentities\/.+/, 'read'],
['PUT', /^\/(ngsi10|v1)\/contextentities\/.+/, 'update'],
['POST', /^\/(ngsi10|v1)\/contextentities\/.+/, 'create'],
['DELETE', /^\/(ngsi10|v1)\/contextentities\/.+/, 'delete'],
['GET', /^\/(ngsi10|v1)\/contextentitytypes\/.+\/attributes$/, 'N/A'],
['GET', /^\/(ngsi10|v1)\/contextentitytypes\/.+\/attributes\/.+/, 'read'],
['GET', /^\/(ngsi10|v1)\/contextentitytypes\/.+/, 'read'],
['GET', /^\/(ngsi10|v1)\/contextentitytypes\/.+\/attributeDomains\/.+/, 'read'],
['POST', /^\/(ngsi10|v1)\/contextsubscriptions$/, 'subscribe'],
['PUT', /^\/(ngsi10|v1)\/contextsubscriptions\/.+/, 'subscribe'],
['DELETE', /^\/(ngsi10|v1)\/contextsubscriptions\/.+/, 'subscribe'],
/* New operations in v1/ (note that they don't use the "ngsi10" alternative in the pattern) */
['GET', /^\/v1\/contextentities/, 'read'],
['POST', /^\/v1\/contextentities/, 'create'],
['GET', /^\/v1\/contextsubscriptions/, 'read'],
['GET', /^\/v1\/contextsubscriptions\/.+/, 'read'],
['GET', /^\/v1\/contexttypes/, 'read'],
['GET', /^\/v1\/contexttypes\/.+/, 'read'],
['GET', /^\/v1\/contextentities\/.+\/attributes\/.+/, 'read'],
['PUT', /^\/v1\/contextentities\/.+/, 'update'],
['DELETE', /^\/v1\/contextentities\/.+/, 'delete'],

/* V2 Operations */
['POST', /^\/v2\/op\/query$/, 'read'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fiware-pep-steelskin",
"description": "FIWARE Policy Enforcement Point",
"version": "1.15.0",
"version": "1.15.0-next",
"homepage": "https://github.com/telefonicaid/fiware-pep-steelskin",
"author": {
"name": "Daniel Moran",
Expand Down
4 changes: 2 additions & 2 deletions test/acceptance/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lettuce==0.2.20
fabric==1.10.0
flask==1.0.0 # blindly changing from 0.12.3 due to a github vulnerability warning, not yet tested...
requests==2.20.0
flask==2.3.2 # blindly changing from 0.12.3 due to a github vulnerability warning, not yet tested...
requests==2.31.0 # blindly change from 2.20.0 (test/acceptance is no longer in use)
colorama==0.2.5
paramiko==2.10.1 # blindly changing from 2.0.9 due to a github vulnerability warning, not yet tested...
psutil==5.6.6
Expand Down
99 changes: 0 additions & 99 deletions test/unit/extract_cb_convenience_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,105 +35,6 @@ var serverMocks = require('../tools/serverMocks'),
convenienceOperations;

convenienceOperations = [
/* "Classic" NGSI9 operations */
['GET', '/ngsi9/contextEntities/TestedEntityId001', 'discover'],
['GET', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001', 'discover'],
['POST', '/ngsi9/contextEntities/TestedEntityId001', 'register'],
['POST', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001', 'register'],
['GET', '/ngsi9/contextEntities/TestedEntityId001/attributes', 'N/A'],
['GET', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributes', 'N/A'],
['POST', '/ngsi9/contextEntities/TestedEntityId001/attributes', 'N/A'],
['POST', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributes', 'N/A'],
['GET', '/ngsi9/contextEntities/TestedEntityId001/attributes/TestedAttributeName001', 'discover'],
['GET', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributes/TestedAttributeName001',
'discover'],
['POST', '/ngsi9/contextEntities/TestedEntityId001/attributes/TestedAttributeName001', 'register'],
['POST', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributes/TestedAttributeName001',
'register'],
['GET', '/ngsi9/contextEntities/TestedEntityId001/attributeDomains/TestedDomainName001', 'discover'],
['GET', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributeDomains/TestedDomainName001',
'discover'],
['POST', '/ngsi9/contextEntities/TestedEntityId001/attributeDomains/TestedDomainName001', 'register'],
['POST', '/ngsi9/contextEntities/type/TestedType01/id/TestedEntityId001/attributeDomains/TestedDomainName001',
'register'],
['GET', '/ngsi9/contextEntityTypes/TestedTypeName001', 'discover'],
['POST', '/ngsi9/contextEntityTypes/TestedTypeName001', 'register'],
['GET', '/ngsi9/contextEntityTypes/TestedTypeName001/attributes', 'N/A'],
['POST', '/ngsi9/contextEntityTypes/TestedTypeName001/attributes', 'N/A'],
['GET', '/ngsi9/contextEntityTypes/TestedTypeName001/attributes/TestedAttributeName001', 'discover'],
['POST', '/ngsi9/contextEntityTypes/TestedTypeName001/attributes/TestedAttributeName001', 'register'],
['GET', '/ngsi9/contextEntityTypes/TestedTypeName001/attributeDomains/TestedDomainName001', 'discover'],
['POST', '/ngsi9/contextEntityTypes/TestedTypeName001/attributeDomains/TestedDomainName001', 'register'],

/* "Classic" NGSI10 operations */
['GET', '/ngsi10/contextEntities/TestedEntityId002', 'read'],
['GET', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002', 'read'],
['PUT', '/ngsi10/contextEntities/TestedEntityId002', 'update'],
['PUT', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002', 'update'],
['POST', '/ngsi10/contextEntities/TestedEntityId002', 'create'],
['POST', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002', 'create'],
['DELETE', '/ngsi10/contextEntities/TestedEntityId002', 'delete'],
['DELETE', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002', 'delete'],
['GET', '/ngsi10/contextEntities/TestedEntityId002/attributes', 'N/A'],
['GET', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes', 'N/A'],
['PUT', '/ngsi10/contextEntities/TestedEntityId002/attributes', 'N/A'],
['PUT', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes', 'N/A'],
['POST', '/ngsi10/contextEntities/TestedEntityId002/attributes', 'N/A'],
['POST', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes', 'N/A'],
['DELETE', '/ngsi10/contextEntities/TestedEntityId002/attributes', 'N/A'],
['DELETE', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes', 'N/A'],
['GET', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001', 'read'],
['GET', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001',
'read'],
['POST', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001', 'create'],
['POST', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001',
'create'],
['PUT', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001', 'update'],
['PUT', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001',
'update'],
['DELETE', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001', 'delete'],
['DELETE', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001',
'delete'],
['GET', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001/TestedValueID001', 'read'],
['GET', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001' +
'/TestedValueID001', 'read'],
['PUT', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001/TestedValueID001', 'update'],
['PUT', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001' +
'/TestedValueID001', 'update'],
['DELETE', '/ngsi10/contextEntities/TestedEntityId002/attributes/TestedAttributeName001/TestedValueID001',
'delete'],
['DELETE', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributes/TestedAttributeName001' +
'/TestedValueID001', 'delete'],
['GET', '/ngsi10/contextEntities/TestedEntityId002/attributeDomains/TestedDomainName001', 'read'],
['GET', '/ngsi10/contextEntities/type/TestedType01/id/TestedEntityId002/attributeDomains/TestedDomainName001',
'read'],
['GET', '/ngsi10/contextEntityTypes/TestedTypeName001', 'read'],
['GET', '/v1/contextEntities/{EntityID}', 'read'],
['GET', '/ngsi10/contextEntityTypes/TestedTypeName001/attributes', 'N/A'],
['GET', '/ngsi10/contextEntityTypes/TestedTypeName001/attributes/TestedAttributeName001', 'read'],
['GET', '/ngsi10/contextEntityTypes/TestedTypeName001/attributeDomains/TestedDomainName001', 'read'],
['POST', '/ngsi10/contextSubscriptions', 'subscribe'],
['PUT', '/ngsi10/contextSubscriptions/TestedSubscriptionID001', 'subscribe'],
['DELETE', '/ngsi10/contextSubscriptions/TestedSubscriptionID001', 'subscribe'],

/* Testing a subset of "classic" operations in v1/ prefix (we don't need to be exahustive) */
['PUT', '/v1/contextSubscriptions/TestedSubscriptionID001', 'subscribe'],
['DELETE', '/v1/contextSubscriptions/TestedSubscriptionID001', 'subscribe'],
['PUT', '/v1/contextSubscriptions/TestedSubscriptionID001', 'subscribe'],
['GET', '/v1/registry/contextEntityTypes/TestedTypeName001', 'discover'],
['POST', '/v1/registry/contextEntityTypes/TestedTypeName001', 'register'],

/* New operations in v1/ */
['GET', '/v1/contextEntities', 'read'],
['POST', '/v1/contextEntities', 'create'],
['GET', '/v1/contextSubscriptions', 'read'],
['GET', '/v1/contextSubscriptions/sub001', 'read'],
['GET', '/v1/contextTypes', 'read'],
['GET', '/v1/contextTypes/typeOfEntity001', 'read'],

/* NGSI Operations with query params */
['GET', '/v1/contextSubscriptions?details=on&limit=15&offset=0', 'read'],

/* V2 Operations */
['GET', '/v2', 'read'],
['GET', '/v2/entities', 'read'],
Expand Down
Loading

0 comments on commit a3fc732

Please sign in to comment.