Giter Site home page Giter Site logo

telefonicaid / fiware-pep-steelskin Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 0.0 1.87 MB

Telefonica's implementation of the FIWARE PEP GE

License: GNU Affero General Public License v3.0

JavaScript 53.26% HTML 0.43% CSS 1.24% Shell 0.35% Python 25.53% Gherkin 18.51% Dockerfile 0.68%

fiware-pep-steelskin's Introduction

fiware-pep-steelskin

FIWARE Security License: APGL Quay badge Docker badge
CI Coverage Status Status

Index

The Orion Policy Enforcement Point (PEP) is a proxy meant to secure independent FiWare components, by intercepting every request sent to the component, validating it against the Access Control component. This validation is based in several pieces of data:

  • User token: comes from the OAuth authorization server and is taken from the x-auth-token header.
  • ServiceId: is read from the fiware-service header and identifies the protected component.
  • SubserviceId: is read from the fiware-servicepath header and identifies further divisions of the service.
  • Action: the PEP guess the action for a particular request by checking the path or inspecting the body. The logic for performing such actions depends on the component that is being secured, so the PEP will need a plugin for each of this components.

Communication with the Access Control is based on the XACML protocol.

Along this document, the term IDM (Identity Manager) will be used, as a general term to refer to the server providing user and role creation and authentication. The currently supported IDM is Keystone; a Keyrock IDM option is provided as well, but it may be deprecated in the near future.

Three other documents provide further information about the PEP Proxy:

  • Operations Manual: provides information on logs and alarms.
  • Architecture information: provides further information on how the PEP works and is structured.
  • Keystone installation: provides an example of Keystone installation with services and subservices that can be used to test the PEP Proxy and play with its features.

Dependencies

The PEP Proxy is standard Node.js app and doesn't require more dependencies than the Node.js interpreter and the NPM package utility.

Just checkout this directory and install the Node.js dependencies using:

npm install --production

The proxy should be then ready to be configured and used.

With Docker

There are automatic builds of the development version of the Steelskin PEP Proxy published in Docker hub. In order to install using the docker version, just execute the following:

docker run -p 11211:11211 -p 1026:1026 -e LOG_LEVEL=DEBUG -e AUTHENTICATION_HOST=<Keystone-host> -e ACCESS_HOST=<Access-control-host> -e TARGET_HOST=<Orion-host> telefonicaiot/fiware-pep-steelskin

This command will create a docker container with a PEP Steelskin running, using for token validation and authentication, for access control and redirecting allowed requests to . Remember there are more environment variables you can use to tailor Steelskin configuration to suit your needs; you can find the complete list in the configuration section below.

Take note that this command expose two ports: the 1026 port for component requests and the administration port, 11211.

Build your own Docker image

There is also the possibility to build your own local Docker image of the PEP component.

To do it, follow the next steps once you have installed Docker in your machine:

  1. Navigate to the path where the component repository was cloned.
  2. Launch a Docker build
    • Using the default NodeJS version of the operating system used defined in FROM keyword of Dockerfile:
    sudo docker build -f Dockerfile .
    • Using an alternative NodeJS version:
    sudo docker build --build-arg NODEJS_VERSION=0.10.46 -f Dockerfile .

Using PM2

The PEP within the Docker image can be run encapsulated within the pm2 Process Manager by adding the PM2_ENABLED environment variable.

docker run --name pep -e PM2_ENABLED=true -d fiware/fiware-pep-steelskin

Use of pm2 is disabled by default. It is unnecessary and counterproductive to add an additional process manager if your dockerized environment is already configured to restart Node.js processes whenever they exit (e.g. when using Kubernetes)

Using Node Inspection

The PEP within the Docker image can be run with node inspection by adding the INSPECT_ENABLED environment variable.

docker run --name pep -e INSPECT_ENABLED=true -d fiware/fiware-pep-steelskin

Use of node inspection is disabled by default.

Undeployment

In order to undeploy the proxy, if it was installed directly from the GIT repositories, just kill the process and remove the directory.

Configuration

Assuming the PEP Proxy is deployed directly from the source code, it won't add itself as a service, and the running ports should be configured manually. This configuration will involve two steps:

  • Changing the port of the Context Broker to a different internal port (not open to external connections). Refer to the Orion Context Broker Deployment Manual for instructions on how to do it.
  • Changing the port of the proxy to listen in the Context Broker original port, and to redirect to the new one. This parameters can be changed in the config.js file in the root folder. Once configured, the service can be started as a demon with the following comand:
nohup bin/pep-proxy.js &> pep-proxy.log&

Activate service

The proxy service is disabled once its installed. In order to enable it, use the following command:

service pepProxy start

Log Rotation

Independently of how the service is installed, the log files will need an external rotation (e.g.: the logrotate command) to avoid disk full problems.

If the PEP Proxy is not started as a service, it can be started executing the following command from the project root:

bin/pep-proxy.js

Once the PEP Proxy is working, it can be used to enforce both authentication and authorization over the protected component (e.g. Orion Context Broker). In order to enforce both actions, the PEP Proxy has to be connected to an Identity Manager server and an Access Manager server. Next sections will show some examples of both processes.

Note that, in order for a request to be authorized through the Access Control, it's mandatory that it contains all of the following headers:

  • x-auth-token: should contain a valid user token, generated by the IDM.
  • fiware-service: should contain the name of a service created in the IDM and the user must have access to it.
  • fiware-servicepath: should contain a route to a subservice, begining with a slash '/' symbol.

This headers are used by the IDM and Access Control systems to make the decisions about the request, so if any of them are missing, the request will not progress any further, and will be rejected with a 400 HTTP error code. For a detailed explanation of the returned errors, please refer to the API Error codes.

The proxy can also work in an authentication-only mode (using the config.access.disable flag), in which case the fiware-service and fiware-servicepath headers can be marked as optional, or checked anyway for validity (controlled by the config.authentication.checkHeaders flag). Header checking cannot be disabled for PEP Proxies performing authorization processes.

Authentication

The authentication process is based on OAuth v2 tokens. The PEP Proxy expects all the requests to have a header x-auth-token containing a valid access token from the IDM. All the requests without this requirement are rejected with a 401 error.

PEP Proxy currently supports two possible authentication authorities: Keyrock IdM and Openstack Keystone. The following sections show how to retrieve a token with each of this authentication technologies. The module can be configured using the config.authentication.module option.

Keyrock IdM

In order to get an access token to send with the request, a user can send a request to the IDM, with its user and password (here shown as a curl request):

curl -i --user <serverUser>:<serverPassword> -X POST -H "Content-Type: application/x-www-form-urlencoded" https://<idmHostName>/oauth2/token -d 'grant_type=password&username=<theUserName>&password=<theUserPassword>'

If the user and password are correct, the response will be like the following:

{
    "access_token":"O-OqiBR1AbZk7qfyidF3AwMeBY253xYEpUdkv",
    "refresh_token":"Ny0OwE19230QfftxXYGwwgOLafa5v2xnI5t6HWdQ",
    "token_type":"bearer",
    "expires_in":2591999
}

The access_token field contains the required token.

The must be used also to assign roles to each user. For details about role creation and assign, check the IDM API.

Keystone

In order to get its access token, a user can send the following request to Keystone:

curl http://localhost:5000/v3/auth/tokens \
    -s \
    -i \
    -H "Content-Type: application/json" \
    -d '
{
    "auth": {
        "identity": {
            "methods": [
                "password"
            ],
            "password": {
                "user": {
                    "domain": {
                        "name": "SmartCity"
                    },
                    "name": "alice",
                    "password": "password"
                }
            }
        }
    }
}'

The token can be found in the X-Subject-Token header of the response:

X-Subject-Token: MIIC3AYJKoZIhvcNAQcCoIICzTCCAskCAQExCTAHBgUrDgMCGjCCATIGCSqGSIb3DQEHAaCCASMEggEfeyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTAtMTBUMTA6NTA6NDkuNTMyNTQyWiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTAtMTBUMTE6NTA6NDkuNTMyNDkxWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogImY3YTViOGUzMDNlYzQzZThhOTEyZmUyNmZhNzlkYzAyIiwgIm5hbWUiOiAiU21hcnRWYWxlbmNpYSJ9LCAiaWQiOiAiNWU4MTdjNWUwZDYyNGVlNjhkZmI3YTcyZDBkMzFjZTQiLCAibmFtZSI6ICJhbGljZSJ9fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAKRGV3uu8fiS7UNm47KhltSjlY1e7KnedUcD-mdwz6Asbo7X9hbtljy1ml9gGcuMf6vX4tycx4goRyMARPS7YKROd0evZtnYArIyx0IrmwDaqodwp8BxBCxFgHRZtCwzHvZFEaUcClydQq7HJvBfTgTwH4v1aJkMyK8wLMP-CYyiZSfCIWPVnoB9I3P56jeKHkmcryYLgT2I-AwDBj1zd9HPzUjyQuNj5rCMkJjvz-A9-hef6AMMZuYPMIYdkei+deq86O1qFuo7PpO2SA7QWkqjcsKs9v+myvHhLrBre9GLP2hP1rc4D67lSL2XB1UY20mc6FNIVIErxT0DOSXltXQ==
Vary: X-Auth-Token
Content-Type: application/json
Content-Length: 287
Date: Fri, 10 Oct 2014 10:50:49 GMT

{
  "token": {
    "issued_at": "2014-10-10T10:50:49.532542Z",
    "extras": {},
    "methods": [
      "password"
    ],
    "expires_at": "2014-10-10T11:50:49.532491Z",
    "user": {
      "domain": {
        "id": "f7a5b8e303ec43e8a912fe26fa79dc02",
        "name": "SmartValencia"
      },
      "id": "5e817c5e0d624ee68dfb7a72d0d31ce4",
      "name": "alice"
    }
  }
}

For details on user and role creation, check the Keystone API.

Authorization

Once the user is authenticated, the PEP Proxy will ask the Access Control for its permissions. In order for the request to be accepted, at least one rule has to match the request information and the user roles.

Rules are defined in XACML. The particular rules will depend on each case and are left to the authorization designer. The following document shows a typical rule explained for the use case of a Context Broker:

<Policy xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17
    http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
        PolicyId="policy03"
        RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-unless-permit"
        Version="1.0" xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <Target>
    <AnyOf>
      <AllOf>
        <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match">
          <AttributeValue
              DataType="http://www.w3.org/2001/XMLSchema#string"
              >frn:contextbroker:551:833:.*</AttributeValue>
          <AttributeDesignator
              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
              DataType="http://www.w3.org/2001/XMLSchema#string"
              MustBePresent="true"
              Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" />
        </Match>
      </AllOf>
    </AnyOf>
  </Target>

  <Rule RuleId="policy03rule01" Effect="Permit">

    <Condition>
      <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
        <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
          <AttributeDesignator
              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
              DataType="http://www.w3.org/2001/XMLSchema#string"
              MustBePresent="true"
              Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" />
        </Apply>
        <AttributeValue
            DataType="http://www.w3.org/2001/XMLSchema#string"
            >read</AttributeValue>
      </Apply>
    </Condition>
  </Rule>

</Policy>

All the rules are associated to a service ID (the value of the fiware-service header) and a subservice. When the request arrives to the Access Control, the later will retrieve all the permissions for the user roles, each one represented by a XACML policy. All the policies are applied then in order to find any that would let the request be executed.

In the example, the policy states the following: "if the resource has the prefix frn:contextbroker:551:833: and the action read the request would be allowed". This policy will allow read access over all the resources in subservice 833 of the service 551 to the roles that have it assigned. The meaning of the term resource will depend on the component which is being protected by the particular access rules. E.g.: for Orion Context Broker, the resources will be the entities of the CB; for each entity, the Policy Enforcement Point of the CB will generate a FRN, composed of the aforementioned prefix plus the identifier of the entity itself.

Another example could be this the following:

<Policy xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17
    http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
        PolicyId="policy02"
        RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-unless-permit"
        Version="1.0" xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <Target>
    <AnyOf>
      <AllOf>
        <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
          <AttributeValue
              DataType="http://www.w3.org/2001/XMLSchema#string">admin</AttributeValue>
          <AttributeDesignator
              AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
              DataType="http://www.w3.org/2001/XMLSchema#string"
              MustBePresent="false"
              Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" />
        </Match>
        <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match">
          <AttributeValue
              DataType="http://www.w3.org/2001/XMLSchema#string">frn:contextbroker:551:833:.*</AttributeValue>
          <AttributeDesignator
              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
              DataType="http://www.w3.org/2001/XMLSchema#string"
              MustBePresent="true"
              Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" />
        </Match>
      </AllOf>
    </AnyOf>
  </Target>

  <Rule RuleId="policy02rule01" Effect="Permit">

    <Condition>
      <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
        <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-one-and-only">
          <AttributeDesignator
              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
              DataType="http://www.w3.org/2001/XMLSchema#string"
              MustBePresent="true"
              Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" />
        </Apply>
        <AttributeValue
            DataType="http://www.w3.org/2001/XMLSchema#string">write</AttributeValue>
      </Apply>
    </Condition>
  </Rule>

</Policy>

In this example, only those users with subjectId (user's role) "admin" may write on resources of tenant 511 and subservice 833.

Any number of policies can be included in the Access Control for each pair (tenant, subject). If any of the policies can be applied to the request and Permit the request, then the global result is a Permit. If none of the policies can be applied (no target exist for the tenant, subservice and subject of the request) the result will be NotApplicable. If there are policies that can be applied but all of them deny the access, the result will be a Deny.

Start service

To start the service, use either the service command: service pepProxy start

Or just the launch script:

/etc/init.d/pepProxy start

For testing purposes it might be interesting to launch the process directly without the service. That can be done executing the following command from the project root directory:

./bin/pepProxy

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

To stop the service, use either the service command:

service pepProxy stop

Or just the launch script:

/etc/init.d/pepProxy stop

How to check service status

Checking the process is running

The status of the process can be retrieved using the service command:

service pepProxy status

It also can be checked with ps, using a filter with the command name:

ps -ef | grep "bin/pepProxy"

In both cases a result of 0 (echoing $?) indicates the process is supposed to be running, and an error otherwise.

Checking that the port is listening

The following command:

netstat -ntpl | grep 1026

can be used to check the process is listening in the appropriate port (provided the port is the standard 1026). The result should resemble this line:

tcp   0   0  0.0.0.0:1026     0.0.0.0:*   LISTEN   12179/node

Checking the version in the Administration API

The PEP Proxy provides an Administration port that can be used to check whether the proxy is up and listening or down. The administration API consists in a single /version path, that returns useful information from the proxy (currently just the listening port and version).

Example of output:

{
  "version": "0.4.1-next",
  "port": 1026
}

All the configuration of the proxy is stored in the config.js file in the root of the project folder. The values set inside config.js operate as the default values for all the important pieces of configuration data, so it is important none of them are removed (you can change them to suit your needs, as long as they have a valid value).

Another way of configuring the component is through the use of environment variables, although less configuration options are exposed with this mechanism.

Basic Configuration

In order to have the proxy running, there are several basic pieces of information to fill:

  • config.resource.proxy: The information of the server proxy itself. Two ports must be configured for the proxy: port indicates in which port is the proxy listening for requests; adminPort indicates the administration port. E.g.:
{
    port: 1026,
    adminPort: 11211
}
  • config.resource.original: The address and port of the proxied server. E.g.:
{
    host: 'localhost',
    port: 10026
},
  • config.access: connection information to the selected Access Control PDP API. Includes a disable flag, to allow the proxy to work in authentication-only mode and a flag to activate accounting access in file. E.g.:
{
    disable: false,
    protocol: 'http',
    host: 'localhost',
    port: 7070,
    path: '/pdp/v3',
    account: false,
    accountFile: '/tmp/pepAccount.log'
}

Accounting log is only activated when account flag is true and debug log is INFO or DEBUG level (note that log level can be changed through API without restart) Note that accunting log is not rotate, so you should make sure you configure your own rotation system. Accounting access log include daba about:

  • Attempt was right or not
  • Token
  • Origin
  • UserId
  • ServiceId
  • SubServiceId
  • Action
  • Date Example of access log:
Right Attempt | ResponseStatus=200 | Token=860864fb6d1a4c8a8cb7d59d16daaa52 | Origin=192.168.1.125 | UserId=62c63ada8694451fb67a341346172499 | ServiceId=a9b38dd2a97e4944b2daebdb74ed60ff | Service=smartgondor | SubServiceId=/ | SubService=/ | Action=read | Date=2017-09-21T12:46:57.844Z
  • config.componentName: name of the component that will be used to compose the FRN that will identify the resource to be accessed. E.g.: orion.
  • config.resourceNamePrefix: string prefix that will be used to compose the FRN that will identify the resource to be accessed. E.g.: fiware:.
  • config.bypass: used to activate the administration bypass in the proxy. Valid values are true or false.
  • config.bypassRoleId: ID of the role that will be considered to have administrative rights over the proxy (so being transparently proxied without validation). Valid values are Role UUIDs. E.g.: db50362d5f264c8292bebdb5c5783741.
  • config.dieOnRedirectError: this flags changes the behavior of the PEP Proxy when an error is received when redirecting a request. If the flag is true, the PEP Proxy process is shut down immediately; if it is false, the behavior is the usual: generate a 501 Code error.
  • config.bodyLimit: Controls the maximum request body size allowed, in bytes. Default is 1 Mb

Authentication configuration

  • config.authentication.checkHeaders: when the proxy is working with the access control disabled (just user authentication), indicates whether the fiware-service and fiware-servicepath headers should be checked for existance and validity (checking: the headers exist, thy are not empty and the user is really part of the service and subservice mentioned in the header). This option is ignored when authorization is enabled, and considered to be true (as the headers constitute a mandatory part of the authorization process). Default value is true.
  • config.authentication.module: indicates what type of authentication server should be used: keystone or idm. The currently supported one (and default) is keystone.
  • config.authentication.username: username of the PEP proxy in the IDM.
  • config.authentication.password: password of the PEP proxy in the IDM.
  • config.authentication.domainName: (only meaningful for Keystone) name of the administration domain the PEP proxy user belongs to.
  • config.authentication.retries: as the authentication is based in the use of tokens that can expire, the operations against Keystone are meant to retry with a fresh token. This configuration value indicates how many retries the PEP should perform in case the communication against Keystone fails. The value 0 means the default will be used (default value is 3). The value -1 implies that it should be retried forever.
  • cacheTTLs: the values in this object correspond to the Time To Live of the values of the different caches the PEP uses to cache requests for information in Keystone. The value is expressed in seconds and 0 value implies unlimited.
  • config.authentication.options: address, port and other communication data needed to communicate with the Identity Manager. Apart from the host and port, default values should be used.

Plugin configuration

The config.js file contains configuration parameter that lets the deployer decide what plugin the proxy should use in order to extract the action type from the request attributes: the middleware parameter. This object has two attributes:

  • require: indicating the route from the project folder to the module that contains the middleware.
  • functions: an array of the middlewares to execute from the selected module. All the currently available plugins are in the folder lib/plugins/, and most of them implement a single middleware called extractAction (the name for Orion plugin is extractCBAction). The following example should work for any plugin following this patterns:
config.middlewares = {
    require: 'lib/plugins/perseoPlugin',

    functions: [
        'extractAction'
    ]
};

The environment variables provide ways of configuring the plugin without taking care of this details.

Configuration based on environment variables

Some of the configuration values for the attributes above mentioned can be overriden with values in environment variables. The following table shows the environment variables and what attribute they map to.

Environment variable Configuration attribute
PROXY_PORT config.resource.proxy.port
ADMIN_PORT config.resource.proxy.adminPort
TARGET_HOST config.resource.original.host
TARGET_PORT config.resource.original.port
LOG_LEVEL config.logLevel
ACCESS_DISABLE config.access.disable
ACCESS_HOST config.access.host
ACCESS_PORT config.access.port
ACCESS_PROTOCOL config.access.protocol
ACCESS_ACCOUNT config.access.account
ACCESS_ACCOUNTFILE config.access.accountFile
AUTHENTICATION_HOST config.authentication.options.host
AUTHENTICATION_PORT config.authentication.options.port
AUTHENTICATION_PROTOCOL config.authentication.options.protocol
AUTHENTICATION_CACHE_PROJECTIDS config.authentication.cacheTTLs.projectIds
AUTHENTICATION_CACHE_ROLES config.authentication.cacheTTLs.roles
AUTHENTICATION_CACHE_USERS config.authentication.cacheTTLs.users
AUTHENTICATION_CACHE_VALIDATION config.authentication.cacheTTLs.validation
PROXY_USERNAME config.authentication.user
PROXY_PASSWORD config.authentication.password
PROXY_PASSWORD config.authentication.password
COMPONENT_NAME config.componentName
COMPONENT_PLUGIN config.middlewares and config.componentName if no COMPONENT_NAME provided
BODY_LIMIT config.bodyLimit

Component configuration

A special environment variable, called COMPONENT_PLUGIN can be set with one of this values: orion, perseo, keypass and rest. This variable can be used to select what component plugin to load in order to determine the action of the incoming requests. This variable also rewrites config.componentName configuration paramenter.

SSL Configuration

If SSL Termination is not available, the PEP Proxy can be configured to listen HTTPS instead of plain HTTP. To activate the SSL:

  • Create the appropiate public keys and certificates and store them in the PEP Proxy machine.
  • In the config.js file, change the config.ssl.active flag to true.
  • In the same ssl object in the configuration, fill the path to the key and cert files.

Multi-instance configuration

PEP Proxy is able to start multiple instances by adding and configuring certain files in /etc/pepProxy.d and using pepProxy service script

In order to start multiple instances of the proxy, just add one configuration file per instance in the /etc/pepProxy.d folder.

In its starting sequence, the pepProxy service looks for files in /etc/pepProxy.d that begins with pepproxy_ prefix and has .conf extension and start (or stop or status or restat) one process for file found.

It is important to change PROXY_PORT and ADMIN_PORT to one not used by other PEP intances/services.

The validation of each request si done connecting with the Access Control component, which, using the information provided by the PEP Proxy, decides whether the user can execute the selected action in this organization or not. The following is a summary of this interaction with some examples.

Request

The XACML Request maps the information extracted from the request and from the IDM (roles, organization and action) to XACML categories (access-subject, resource and action, respectively).

<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
         ReturnPolicyIdList="false">
    <!-- X-Auth-Token-->
    <Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
        <Attribute IncludeInResult="false"
                   AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id">
            <AttributeValue
                    DataType="http://www.w3.org/2001/XMLSchema#int">511</AttributeValue>
        </Attribute>
    </Attributes>
    <!-- fiware resource name being accessed: organization id -->
    <Attributes
            Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
        <Attribute IncludeInResult="false"
                   AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">frn:contextbroker:551:::</AttributeValue>
        </Attribute>
    </Attributes>
    <!-- action performed -->
    <Attributes
            Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
        <Attribute IncludeInResult="false"
                   AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id">
            <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">create</AttributeValue>
        </Attribute>
    </Attributes>
</Request>

Response

The XACML Response returns a Decision element that can have the following values: โ€œPermitโ€, โ€œDenyโ€, โ€œNotApplicableโ€ or โ€œIndeterminateโ€. The subset of allowable values understood by the PEP Proxy is:

  • Permit: allows the request to continue its way to the Context Broker.
  • Deny: rejects the request, returning a 403 error to the requestor.
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd">
    <Result>
        <Decision>Permit</Decision>
    </Result>
</Response>

Available actions

This is the list of actions available for the Context Broker. For every action, the abbreviature is also shown (will be used in some of the following tables).

Action Abbreviature
create C
update U
delete D
read R
subscribe S
register Reg
discover Dis
N/A -

NGSIv2

Method Path Action
GET /v2 R
GET /v2/entities R
GET /v2/entities/{entityId} R
GET /v2/entities/{entityId}/attrs R
POST /v2/entities C
PATCH /v2/entities/{entityId}/attrs U
POST /v2/entities/{entityId}/attrs U
POST /v2/entities/{entityId}/attrs?options=append C
DELETE /v2/entities/{entityId} D
PUT /v2/entities/{entityId}/attrs U
GET /v2/entities/{entityId}/attrs/{attrId} R
PUT /v2/entities/{entityId}/attrs/{attrId} U
DELETE /v2/entities/{entityId}/attrs/{attrId} D
GET /v2/entities/{entityId}/attrs/{attrId}/value R
PUT /v2/entities/{entityId}/attrs/{attrId}/value U
GET /v2/types R
GET /v2/types/{typeId} R
GET /v2/subscriptions R
POST /v2/subscriptions C
GET /v2/subscriptions/{subscriptionId} R
PATCH /v2/subscriptions/{subscriptionId} U
DELETE /v2/subscriptions/{subscriptionId} D
POST /v2/op/query R
POST /v2/op/update (*)

(*) It depends on the actionType (within payload):

  • update: U
  • append: C
  • appendStrict: C
  • delete: D
  • replace: U

Operations marked with a slash, "-" are now deprecated. All those operations will be tagged with the special action "N/A". If you want to allow them anyway, just add a rule to the Access Control allowing the "N/A" action for the desired roles.

The available actions are:

  • readRule: to get working rules in CEP
  • writeRule: to modify rules in CEP (create, delete, update)
  • notify: to fire rules (if appropiate) with an event notification

The following tables show the map from method and path of the request to the action.

Notifications

Method Path Action
POST /notices notify

Rules

Method Path Action
GET /rules readRule
GET /rules/{id} readRule
POST /rules writeRule
DELETE /rules/{id} writeRule

Visual Rules

Method Path Action
GET /m2m/vrules readRule
GET /m2m/vrules/{id} readRule
POST /m2m/vrules writeRule
DELETE /m2m/vrules/{id} writeRule
PUT /m2m/vrules/{id} writeRule

The available actions are:

  • createPolicy: to create a new policy for a subject in Keypass.
  • listPolicies: to list all the policies belonging to a subject.
  • deleteSubjectPolicies: to remove all the policies for a particular subject.
  • deleteTenantPolicies: to remove all the policies for all the subjects of a tenant.
  • readPolicy: to get the policy body for a particular policy.
  • deletePolicy: to remove a single policy of a subject.

The following table show the map from method and path of the request to the action.

Method Path Action
POST /pap/v1/subject/{subjectId} createPolicy
GET /pap/v1/subject/{subjectId} listPolicies
DELETE /pap/v1/subject/{subjectId} deleteSubjectPolicies
DELETE /pap/v1 deleteTenantPolicies
GET /pap/v1/subject/{subjectId}/policy/{policyId} readPolicy
DELETE /pap/v1/subject/{subjectId}/policy/{policyId} deletePolicy

Most of the code of the proxy (i.e. the extraction of user data, the communication with the Keystone Proxy and the proxy process itself) will execute exactly the same for all the components. The exception is the rule to determine the action the request is trying to perform. To address this behavior and possible actions different customizations of the proxy could need, the proxy allows for the introduction of middlewares in the validation process.

Middleware definition

The middlewares are quite similar to the ones used by the Connect (or Express) framework. A middleware is a function that receives three parameters:

  • req: The object representing the incoming HTTP request. Along with all the request information, the request is used to store the information for the validation process (i.e. attributes userId with the user token, organization with the organization extracted from the headers and action that should be filled in by the middlewares).
  • res: The object representing the response. This object can be used to stop the request pipeline due to conditions defined by the specific component (although it is advisable to use a next(error) call with a custom error to allow the error to be handled by the proxy).
  • next: Callback used to call the next middleware in the chain. In the current version, it is required that the call to the next middleware contains both the request and response objects (this behavior is not the same as the one in Connect middlewares). If the first parameter in the call is an error, the request will be rejected. If the first parameter is null or undefined, the request will continue through the validation process. This is an example of a call to next that lets the request follow through:
next(null, req, res);

Middleware configuration

The middlewares must be defined inside a Node.js module. They can be configured using the config.middlewares object of the config.js file. This object contains two attributes:

  • require: path to the module that contains the middlewares, from the project root. The system currently supports only modules defined inside the fiware-pep-steelskin project (or in accessible folders).
  • functions: list of the middlewares to load. The names in this list must be exported functions of the module selected in the previous attribute.

Generic REST Middleware

For standard REST APIs that make use exclusively of the POST, PUT, DELETE and GET methods with their CRUD meaning, the PEP Proxy provides a generic plugin that maps those methods to actions in the access request. To configure it, put the following lines in the middleware section of the PEP Proxy installation:

config.middlewares = {
   require: 'lib/services/restPlugin',
   
   functions: [
     'extractAction'
   ]
};

In order to add more expression power to the authorization rules created in the Access Control component, the Generic REST Plugin adds a new element to the FRN: the URL of the resource is appended to the existing elements in the FRN.

URL Table Generic middleware

For applications that require a mapping between URLs and Method to actions when the REST Middleware is not enough, a plugin generator based on tables is provided. In order to use this plugin, create a new plugin file and import the ./urlTablePlugin module. This module contains just one function, extractAction, that takes a mapping table and generates a middleware function that extract the action of a request based on it.

The mapping table has to have one row for each action to check indicating:

  • Request Method
  • URL pattern (using regular expressions)
  • Action name Whenever a request arrives to the plugin with the selected method and a URL that matches the URL expression, the action will be assigned to the request.

An example of use of the urlTablePlugin can be found in the Perseo plugin.

Orion FiWare Policy Enforcement Point is licensed under Affero General Public License (GPL) version 3.

Project build

The project is managed using npm.

For a list of available task, type

npm run

The following sections show the available options in detail.

Testing

Mocha Test Runner + Should.js Assertion Library.

The test environment is preconfigured to run BDD testing style.

Module mocking during testing can be done with proxyquire

To run tests, type

npm test

Coding guidelines

jshint

Uses provided .jshintrc flag file. To check source code style, type

npm run lint

Continuous testing

Support for continuous testing by modifying a src file or a test. For continuous testing, type

npm run test:watch

If you want to continuously check also source code style, use instead:

npm run watch

Code Coverage

Istanbul

Analizes the code coverage of your tests.

To generate an HTML coverage report under site/coverage/ and to print out a summary, type

# Use git-bash on Windows
npm run test:coverage

Clean

Removes node_modules and coverage folders, and package-lock.json file so that a fresh copy of the project is restored.

# Use git-bash on Windows
npm run clean

Releasing

The project contains a script to aid in the releasing process. This script is located in the scripts/build folder. In order to create a new release, just invoke the script, from the project root folder, with the following line:

scripts/build/release.sh <NEW_VERSION> <RELEASE_TYPE>

Usually, RELEASE_TYPE will be sprint. This release procedure will do the following steps:

  • Change the version in package.json to the selected version.
  • Create a branch release/0.6.0 and a tag 0.6.0 from master.
  • Add the -next suffix to the version in master and clean the CHANGES_NEXT_RELEASE file.

For other release types, check the command help.

fiware-pep-steelskin's People

Contributors

alvarolmedo avatar alvarovega avatar anabelengp avatar cesarjorgemartinez avatar davisjam avatar dependabot[bot] avatar dmoranj avatar espencer avatar fgalan avatar fjperalta avatar gavinlam avatar gtorodelvalle avatar jason-fox avatar jcalderin avatar leandroguillen avatar magarciasopo avatar mapedraza avatar marcbachmann avatar mcarracedo avatar mortonfox avatar mrutid avatar rg2011 avatar vgarciag avatar xavierval avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fiware-pep-steelskin's Issues

The parameter "retry" of the config file is not controlled

In the Keystone Cache config, there are a paramenter with name retries that is not controlled wich number is setted

// User identity configuration
//--------------------------------------------------
/**
 * Information about the Identity Manager server from where the information about a user will be drawn.
 */
config.authentication = {
    module: 'keystone',
    user: 'pepproxy',
    password: 'pepproxy',
    domainName: 'Default',
    retries: 3,
    cacheTTLs: {
        users: 1000,
        projectIds: 1000,
        roles: 60
    },
    options: {
        protocol: 'http',
        host: 'localhost',
        port: 5000,
        path: '/v3/role_assignments',
        authPath: '/v3/auth/tokens'
    }
};

Remove Context Broker specific installation process

Currently, the RPM of the PEP is designed to check if there is a Context Broker installed, changing its port and installing itself in front of it in that case. This behavior is not consistent with the fact of the PEP being able to proxy multiple components so one of two actions should be taken: either remove this particular behavior moving it to specific Puppet recipes; or extend this functionality to all the supported Fiware components, to be consistent.

Effort: 3 man day

The functionlity with the content-type its rare

The functionality implemented in PEP that inspect the content-type header its rare:

  • When the header content-type is */json: The payload is checked, if is not a json valid, there is an error in pep
  • When the headers content-type is */xml': The payload is not checked, and you can pass anything you want, xml, json, text...
  • When the headers content-type its different of */json or */xml: the payload is going to send always empty

There is no error, but the way it works its... rare

Remove or consolidate the multiple authentication mechanisms

Currently, the PEP Proxy supports both authentication using Keystone and IdM. The former case is the default one and the one currently supported in interactions with other components. A decision should be taken about this mechanisms: whether to fully support both (in which case the documentation and tests should be improved to cover both cases) or to support only one (in which case the other one should be removed and the documentation updated accordingly).

Effort: 3 man day

When a '/' is sent to AC, Pep sends &#x2F;

The subservice header is:

fiware-servicepath: /coral

And the payload sent by Pep to AC is:

<?xml version="1.0" encoding="UTF-8"?>
<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd"
         ReturnPolicyIdList="false"
         CombinedDecision="false">
<!-- user roles identifiers-->
<Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
    <Attribute IncludeInResult="false"
           AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id">
    <AttributeValue
            DataType="http://www.w3.org/2001/XMLSchema#string"
            >db0ef6381ff745c5a4c9342baab81db0</AttributeValue>
</Attribute>
</Attributes>
<!-- fiware resource name being accessed: organization id -->
<Attributes
        Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
    <Attribute IncludeInResult="false"
               AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id">
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
                >fiware:orion:atlantic:&#x2F;coral::</AttributeValue>
    </Attribute>
</Attributes>
<!-- action performed -->
<Attributes
        Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
    <Attribute IncludeInResult="false"
               AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id">
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"
                >create</AttributeValue>
    </Attribute>
</Attributes>
</Request>

Should reuse access tokens until they are expired

The proxy currently uses a new token per requests and that's far from being efficient. It should reuse the access token until the token has expired, and request a new one when the token is expired.

Effort: 2 man day

Improve log performance avoiding expensive operations

Debug log should avoid to perform potentially expensive operations. Take the following example

logger.debug('Keystone response retrieving roles:\n\n %s', JSON.stringify(body, null, 4));

In this example, JSON.stringgify is executed, even if the log level is not debug.

Effort: 2 man day

Validation error

When a validation error is raised in the AC response, PeP dont print the error because the format specify a decimal but it receive a string

File:
Services/validation.js
Line 145

Original:

logger.error('[VALIDATION-GEN-001] Error connecting to Access Control: %d', error.message);

It should be

logger.error('[VALIDATION-GEN-001] Error connecting to Access Control: %s', error.message);

When there are not token cached, PEP try to ask Keystone without token

The first time PEP tries to ask for information to keystone, PEP hasnt got any token stored in the cache, but it tries to use an empty token to connect to PEP.

Because of the retries, the consequence is, the PEP log in to Keystone and then do the same consult.

There is no an error, but yes an enhancement to check if there are any token before to ask to Keystone for information about the user.

Log first ask from PEP to Keystone

time=2015-01-07T15:12:42.890Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | msg=Creating proxy
time=2015-01-07T15:12:42.917Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | msg=Listening on port 1025
time=2015-01-07T15:12:42.917Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | msg=Redirecting to host 192.168.1.37 and port 1027
time=2015-01-07T15:12:42.917Z | lvl=DEBUG | corr=n/a | trans=n/a | op=n/a | msg=Loading access validation Templates
time=2015-01-07T15:12:42.922Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | msg=Proxy started
Loading middlewares
Server started
time=2015-01-07T15:12:47.859Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Extracting action from the URL "/v1/queryContext"
time=2015-01-07T15:12:47.861Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Retrieving user from keystone:  {
    "url": "http://192.168.1.37:5001/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Subject-Token": "MIIC2QYJKoZIhvcNAQcCoIICyjCCAsYCAQExCTAHBgUrDgMCGjCCAS8GCSqGSIb3DQEHAaCCASAEggEceyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTUtMDEtMDdUMTU6MTI6NDcuODAyNTg1WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTUtMDEtMDdUMTY6MTI6NDcuODAyNTUyWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjIzMGExZmQ0NzkzMTRiZmM4ZWVkZWU5NGIwZjBhZjczIiwgIm5hbWUiOiAiYXRsYW50aWMifSwgImlkIjogIjk1ZGI2MDZiM2Q4ZjQxMmVhYzgyNGY3YzVmZjcyNWI0IiwgIm5hbWUiOiAib2N0b3B1cyJ9fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAYtk10Id9floMScR7bQRU8XXOOlOHsN3NIuki+guijBFijjo7fguSIV6HR7d1hta5Z-SXprdqES2jc4ntECcZXl3ZsuwLxsKRRoDRPS8TrDDuw6Ow2C8VulSOWG1Mxh4D4-P7h2CAs3j4cAOzuv9YYCL+J-ibsKPgAyc56r5ftOvgtm3YyNSgia1Unqq4b4RIUVIyQsbhgHtWcWIGJDSOZ2oGFJM7Tvmu-x8kPcDD27OEASEyf93be30D3RVMFtQ40lTluoG2f16PVhBfY6DnPoPE-Y1-vs30m58AF1nWPCfc9EzHB8T1TwbJjW5jw++CmUDQXISGx6uRNUWMEy9fJQ=="
    }
}
time=2015-01-07T15:12:47.951Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "The request you have made requires authentication.",
        "code": 401,
        "title": "Unauthorized"
    }
}
time=2015-01-07T15:12:47.951Z | lvl=ERROR | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Invalid token: null
time=2015-01-07T15:12:47.952Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Authenticating against Keystone {
    "url": "http://192.168.1.37:5001/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2015-01-07T15:12:48.139Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2015-01-07T16:12:48.100360Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2015-01-07T15:12:48.100391Z"
    }
}
time=2015-01-07T15:12:48.139Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2015-01-07T16:12:48.100360Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2015-01-07T15:12:48.100391Z"
    }
}


time=2015-01-07T15:12:48.140Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Retrieving user from keystone:  {
    "url": "http://192.168.1.37:5001/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE1LTAxLTA3VDE2OjEyOjQ4LjEwMDM2MFoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTUtMDEtMDdUMTU6MTI6NDguMTAwMzkxWiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQDGBMCah1HwtBeimO7LV3xcCpkQYbJuZisK-KZr9IeUQdcQWEF3pCvnfGhiq3godogR6KT2AmZKBRWjXPx0NfTmlKtz5MUBfIU5QRRJUVZlLGoFJsSig5+QrpxF+779lSkMyx4rVBahRjrOvvQvgZWUudDPPdeQ6CLqLRcPpv+uiC3w41nh6WP6Sp7OpQ-4Q5sYYs2YTkyaDWQHyPIATo9vh4JXuKOOw-ZqU2b6jsuVCRktNgCenRpIg+6UQwctH51OWocwOrFPAjf28UWzEteKxBj3vaa+o8CbR7X9EB4oJaia0N9oxy5yBtWHtLix0ivN9RZA2Az-T5lUIOBv-AEQ",
        "X-Subject-Token": "MIIC2QYJKoZIhvcNAQcCoIICyjCCAsYCAQExCTAHBgUrDgMCGjCCAS8GCSqGSIb3DQEHAaCCASAEggEceyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTUtMDEtMDdUMTU6MTI6NDcuODAyNTg1WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTUtMDEtMDdUMTY6MTI6NDcuODAyNTUyWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjIzMGExZmQ0NzkzMTRiZmM4ZWVkZWU5NGIwZjBhZjczIiwgIm5hbWUiOiAiYXRsYW50aWMifSwgImlkIjogIjk1ZGI2MDZiM2Q4ZjQxMmVhYzgyNGY3YzVmZjcyNWI0IiwgIm5hbWUiOiAib2N0b3B1cyJ9fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAYtk10Id9floMScR7bQRU8XXOOlOHsN3NIuki+guijBFijjo7fguSIV6HR7d1hta5Z-SXprdqES2jc4ntECcZXl3ZsuwLxsKRRoDRPS8TrDDuw6Ow2C8VulSOWG1Mxh4D4-P7h2CAs3j4cAOzuv9YYCL+J-ibsKPgAyc56r5ftOvgtm3YyNSgia1Unqq4b4RIUVIyQsbhgHtWcWIGJDSOZ2oGFJM7Tvmu-x8kPcDD27OEASEyf93be30D3RVMFtQ40lTluoG2f16PVhBfY6DnPoPE-Y1-vs30m58AF1nWPCfc9EzHB8T1TwbJjW5jw++CmUDQXISGx6uRNUWMEy9fJQ=="
    }
}
time=2015-01-07T15:12:48.164Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=Keystone response retrieving user:

 {
    "token": {
        "issued_at": "2015-01-07T15:12:47.802585Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2015-01-07T16:12:47.802552Z",
        "user": {
            "domain": {
                "id": "230a1fd479314bfc8eedee94b0f0af73",
                "name": "atlantic"
            },
            "id": "95db606b3d8f412eac824f7c5ff725b4",
            "name": "octopus"
        }
    }
}
time=2015-01-07T15:12:48.164Z | lvl=DEBUG | corr=28ba07ff-2023-468e-99c5-d804e1c1ba12 | trans=28ba07ff-2023-468e-99c5-d804e1c1ba12 | op=/v1/queryContext | msg=User response from Keystone:
{
    "token": {
        "issued_at": "2015-01-07T15:12:47.802585Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2015-01-07T16:12:47.802552Z",
        "user": {
            "domain": {
                "id": "230a1fd479314bfc8eedee94b0f0af73",
                "name": "atlantic"
            },
            "id": "95db606b3d8f412eac824f7c5ff725b4",
            "name": "octopus"
        }
    }
}


Bypass function dont works if the rol is assigment in a subservice

When bypass function is active, and the adminRoleId is set, if the role is assigned to the service, the petition gets to his destiny, but if the role is assigned to the sub-service, the pep raise an error 403

Log when is ok

time=2014-12-19T10:58:47.784Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Extracting action from URL [/pap/v1/subject/subjectName/policy/policyName] and method [GET]
time=2014-12-19T10:58:47.784Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDExOjUzOjU4LjM0MTA2NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTM6NTguMzQxMDk1WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAilwiNZZOQ465+BZ2iPf7fD7vSw3vxbIXixdVSL4mkYDcQ8yQ0WeoeTsIaxyFWcnRccRl037tluREnlKP+SeN3gJzQsg5DWzNXXc3xNOWwK1ubwnhNdCkKTx0SDuI3RWRAsoK++eLj5DUa0LsRzXSsIkO03T3xNjzN8zEpGHoMHvoixE+IFJihf3oZ59QHYVH0FpU4bs3GM7+WmWPJryDS4Nij08-PQWYzLh-u+L5xzGp466UhT4hKzhZqm2KFct8m2DEaw6EGB5SvdOPJuh+wn1eXQ3JQo9K4x070KLBWQWEHw8y0j1jP3kDhDejyKehQdBF7+nBSzb8b92IJq2By",
        "X-Subject-Token": "MIIC4wYJKoZIhvcNAQcCoIIC1DCCAtACAQExCTAHBgUrDgMCGjCCATkGCSqGSIb3DQEHAaCCASoEggEmeyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTg6NDcuNzMyODE2WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTItMTlUMTE6NTg6NDcuNzMyNzgzWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjg4NjkzNmExYzFlZjQxZTQ5OGUyNGNhNzEzZmFlYjE0IiwgIm5hbWUiOiAiYnlwYXNzX2RvbWFpbiJ9LCAiaWQiOiAiOTNhMmE0NTk0NjMxNDQ2YTk4ZDMwNWE4ZGYxOTAyMzciLCAibmFtZSI6ICJieXBhc3NfYWRtaW4ifX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBACu-8i4XL1-0twsKDOsPpJqdjcesRnmod1GYO0eeRbzEm00ECRyW-NbOqwmSmpHo4HzmbqYUAAjBGt2XKeRqgdxp1gDJaBu6F6yg9puV7sVfGEMnGQv-YTCTTMNoaJtg9k56FcJ4UTJH137udFzRl8pxXjnfZfJoCeaIfta+RgrZpapDA4kj-9k7Jl9iDbO8zSZmzMfVYfx8XtzgD2QISNXw4IIzlcR5+6ggvgAMpxC-A6HBZeTwbFOD0wW-09XKz7Si+E31bY4GTBmASlbH7ExW+W33UksLdDNrhlZk7zUI3DknvjZGP53PXJ74R-AXrzi-IVP0ERcnPzr82Wd+WCA="
    }
}
time=2014-12-19T10:58:47.811Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Keystone response retrieving user:

 {
    "token": {
        "issued_at": "2014-12-19T10:58:47.732816Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T11:58:47.732783Z",
        "user": {
            "domain": {
                "id": "886936a1c1ef41e498e24ca713faeb14",
                "name": "bypass_domain"
            },
            "id": "93a2a4594631446a98d305a8df190237",
            "name": "bypass_admin"
        }
    }
}
time=2014-12-19T10:58:47.819Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=User response from Keystone:
{
    "token": {
        "issued_at": "2014-12-19T10:58:47.732816Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T11:58:47.732783Z",
        "user": {
            "domain": {
                "id": "886936a1c1ef41e498e24ca713faeb14",
                "name": "bypass_domain"
            },
            "id": "93a2a4594631446a98d305a8df190237",
            "name": "bypass_admin"
        }
    }
}


time=2014-12-19T10:58:47.823Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Extracting roles for token {
    "url": "http://172.17.0.3:5000/v3/role_assignments",
    "method": "GET",
    "qs": {
        "user.id": "93a2a4594631446a98d305a8df190237"
    },
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDExOjUzOjU4LjM0MTA2NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTM6NTguMzQxMDk1WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAilwiNZZOQ465+BZ2iPf7fD7vSw3vxbIXixdVSL4mkYDcQ8yQ0WeoeTsIaxyFWcnRccRl037tluREnlKP+SeN3gJzQsg5DWzNXXc3xNOWwK1ubwnhNdCkKTx0SDuI3RWRAsoK++eLj5DUa0LsRzXSsIkO03T3xNjzN8zEpGHoMHvoixE+IFJihf3oZ59QHYVH0FpU4bs3GM7+WmWPJryDS4Nij08-PQWYzLh-u+L5xzGp466UhT4hKzhZqm2KFct8m2DEaw6EGB5SvdOPJuh+wn1eXQ3JQo9K4x070KLBWQWEHw8y0j1jP3kDhDejyKehQdBF7+nBSzb8b92IJq2By"
    }
}
time=2014-12-19T10:58:47.842Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Keystone response retrieving roles:

 "{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"73774c4ea8674b29b1aef5e0af14ea9c\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/projects/73774c4ea8674b29b1aef5e0af14ea9c/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}, {\"scope\": {\"domain\": {\"id\": \"886936a1c1ef41e498e24ca713faeb14\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/886936a1c1ef41e498e24ca713faeb14/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"
time=2014-12-19T10:58:47.842Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Roles response from Keystone:
"{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"73774c4ea8674b29b1aef5e0af14ea9c\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/projects/73774c4ea8674b29b1aef5e0af14ea9c/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}, {\"scope\": {\"domain\": {\"id\": \"886936a1c1ef41e498e24ca713faeb14\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/886936a1c1ef41e498e24ca713faeb14/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"


time=2014-12-19T10:58:47.843Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=Forwarding request:

{"uri":"http://192.168.56.1:1026/pap/v1/subject/subjectName/policy/policyName","method":"GET","headers":{"host":"127.0.0.1:1025","accept-encoding":"gzip, deflate","fiware-service":"bypass_domain","fiware-servicepath":"/","accept":"*/*","user-agent":"python-requests/2.5.0 CPython/2.7.8 Windows/8","connection":"close","x-auth-token":"MIIC4wYJKoZIhvcNAQcCoIIC1DCCAtACAQExCTAHBgUrDgMCGjCCATkGCSqGSIb3DQEHAaCCASoEggEmeyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTg6NDcuNzMyODE2WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTItMTlUMTE6NTg6NDcuNzMyNzgzWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjg4NjkzNmExYzFlZjQxZTQ5OGUyNGNhNzEzZmFlYjE0IiwgIm5hbWUiOiAiYnlwYXNzX2RvbWFpbiJ9LCAiaWQiOiAiOTNhMmE0NTk0NjMxNDQ2YTk4ZDMwNWE4ZGYxOTAyMzciLCAibmFtZSI6ICJieXBhc3NfYWRtaW4ifX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBACu-8i4XL1-0twsKDOsPpJqdjcesRnmod1GYO0eeRbzEm00ECRyW-NbOqwmSmpHo4HzmbqYUAAjBGt2XKeRqgdxp1gDJaBu6F6yg9puV7sVfGEMnGQv-YTCTTMNoaJtg9k56FcJ4UTJH137udFzRl8pxXjnfZfJoCeaIfta+RgrZpapDA4kj-9k7Jl9iDbO8zSZmzMfVYfx8XtzgD2QISNXw4IIzlcR5+6ggvgAMpxC-A6HBZeTwbFOD0wW-09XKz7Si+E31bY4GTBmASlbH7ExW+W33UksLdDNrhlZk7zUI3DknvjZGP53PXJ74R-AXrzi-IVP0ERcnPzr82Wd+WCA=","content-type":"application/json","x-forwarded-for":"10.0.2.2"},"body":"{\"test_payload\":\"test_value\"}"}

time=2014-12-19T10:58:47.856Z | lvl=DEBUG | corr=c563a592-8679-4a69-a4ae-67ab91916e7d | trans=c563a592-8679-4a69-a4ae-67ab91916e7d | op=/pap/v1/subject/subjectName/policy/policyName | msg=response-time: 73 statusCode: 200

Log when is ko

time=2014-12-19T10:58:47.973Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Extracting action from URL [/pap/v1/subject/subjectName/policy/policyName] and method [GET]
time=2014-12-19T10:58:47.974Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDExOjUzOjU4LjM0MTA2NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTM6NTguMzQxMDk1WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAilwiNZZOQ465+BZ2iPf7fD7vSw3vxbIXixdVSL4mkYDcQ8yQ0WeoeTsIaxyFWcnRccRl037tluREnlKP+SeN3gJzQsg5DWzNXXc3xNOWwK1ubwnhNdCkKTx0SDuI3RWRAsoK++eLj5DUa0LsRzXSsIkO03T3xNjzN8zEpGHoMHvoixE+IFJihf3oZ59QHYVH0FpU4bs3GM7+WmWPJryDS4Nij08-PQWYzLh-u+L5xzGp466UhT4hKzhZqm2KFct8m2DEaw6EGB5SvdOPJuh+wn1eXQ3JQo9K4x070KLBWQWEHw8y0j1jP3kDhDejyKehQdBF7+nBSzb8b92IJq2By",
        "X-Subject-Token": "MIIC4wYJKoZIhvcNAQcCoIIC1DCCAtACAQExCTAHBgUrDgMCGjCCATkGCSqGSIb3DQEHAaCCASoEggEmeyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTg6NDcuOTM0NjAwWiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTItMTlUMTE6NTg6NDcuOTM0NTczWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjg4NjkzNmExYzFlZjQxZTQ5OGUyNGNhNzEzZmFlYjE0IiwgIm5hbWUiOiAiYnlwYXNzX2RvbWFpbiJ9LCAiaWQiOiAiOTNhMmE0NTk0NjMxNDQ2YTk4ZDMwNWE4ZGYxOTAyMzciLCAibmFtZSI6ICJieXBhc3NfYWRtaW4ifX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBAG3U4DyTYFgsskP7PS+NIyu563RSSwNfrDuXFiAnr3GzX7PqC+I7R9Rez52cU51LDgJouHyIhZLdKmvUlEPHiM9FleuyKHV8eQp-8snoK+y9ixku0Aqnh9q3CfjGkzQU2dhXXpxx9dvJOyhZ6gelt4q-gocwUfkVFMd19Xb-4Ukh-JX+WTQqmPo9sOpeHX-KVjSZpiVtEC8WqDL7Hb+tordtFPhCrRR+gjmggj1dc+PnnHFPTXteuhw2SgHaym+pgSpl0QmbkVhxYw9Dl4kzYkw7mGMJbAGqmDMGVVSKOpYSn2cTew58X-UKpoEN9vmL2qtGPs9rjY+htauMAEKHmJs="
    }
}
time=2014-12-19T10:58:47.999Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Keystone response retrieving user:

 {
    "token": {
        "issued_at": "2014-12-19T10:58:47.934600Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T11:58:47.934573Z",
        "user": {
            "domain": {
                "id": "886936a1c1ef41e498e24ca713faeb14",
                "name": "bypass_domain"
            },
            "id": "93a2a4594631446a98d305a8df190237",
            "name": "bypass_admin"
        }
    }
}
time=2014-12-19T10:58:48.000Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=User response from Keystone:
{
    "token": {
        "issued_at": "2014-12-19T10:58:47.934600Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T11:58:47.934573Z",
        "user": {
            "domain": {
                "id": "886936a1c1ef41e498e24ca713faeb14",
                "name": "bypass_domain"
            },
            "id": "93a2a4594631446a98d305a8df190237",
            "name": "bypass_admin"
        }
    }
}


time=2014-12-19T10:58:48.004Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Extracting roles for token {
    "url": "http://172.17.0.3:5000/v3/role_assignments",
    "method": "GET",
    "qs": {
        "user.id": "93a2a4594631446a98d305a8df190237"
    },
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDExOjUzOjU4LjM0MTA2NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTA6NTM6NTguMzQxMDk1WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAilwiNZZOQ465+BZ2iPf7fD7vSw3vxbIXixdVSL4mkYDcQ8yQ0WeoeTsIaxyFWcnRccRl037tluREnlKP+SeN3gJzQsg5DWzNXXc3xNOWwK1ubwnhNdCkKTx0SDuI3RWRAsoK++eLj5DUa0LsRzXSsIkO03T3xNjzN8zEpGHoMHvoixE+IFJihf3oZ59QHYVH0FpU4bs3GM7+WmWPJryDS4Nij08-PQWYzLh-u+L5xzGp466UhT4hKzhZqm2KFct8m2DEaw6EGB5SvdOPJuh+wn1eXQ3JQo9K4x070KLBWQWEHw8y0j1jP3kDhDejyKehQdBF7+nBSzb8b92IJq2By"
    }
}
time=2014-12-19T10:58:48.021Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Keystone response retrieving roles:

 "{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"73774c4ea8674b29b1aef5e0af14ea9c\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/projects/73774c4ea8674b29b1aef5e0af14ea9c/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}, {\"scope\": {\"domain\": {\"id\": \"886936a1c1ef41e498e24ca713faeb14\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/886936a1c1ef41e498e24ca713faeb14/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"
time=2014-12-19T10:58:48.021Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=Roles response from Keystone:
"{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"73774c4ea8674b29b1aef5e0af14ea9c\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/projects/73774c4ea8674b29b1aef5e0af14ea9c/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}, {\"scope\": {\"domain\": {\"id\": \"886936a1c1ef41e498e24ca713faeb14\"}}, \"role\": {\"id\": \"a679acd937b7461cab8807e1822c86cf\"}, \"user\": {\"id\": \"93a2a4594631446a98d305a8df190237\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/886936a1c1ef41e498e24ca713faeb14/users/93a2a4594631446a98d305a8df190237/roles/a679acd937b7461cab8807e1822c86cf\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"


time=2014-12-19T10:58:48.024Z | lvl=DEBUG | corr=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | trans=5e8fc97e-57dc-4761-84a9-8aaef28f4b9a | op=/pap/v1/subject/subjectName/policy/policyName | msg=response-time: 51 statusCode: 403

Path in the REST config doc

The path of the plugins is changed, but in the doc it still says the old path to activate the REST plugin:

Current config.js plugin path

    require: 'lib/plugins/orionPlugin',

Current path in the doc:

   require: 'lib/services/restPlugin',

Include user ID in PDP requests

Currently only the user's roles IDs are sent to PDP. It's desirable to include also the user ID, in order to support security sentences like:

This user must be a service customer, but she and only she must be additionally able to perform an administrative operation on a given backend service

Effort: 2 man day

The cached role is stored with bad format

When PEP request to AccessControl the first time, the format of the role is:

 [{"roles":["ee4c1a3ed73044ad8bde4c10b9de1464"]}], with organization [fiware:orion:atlantic:/coral::] and action [create]

But when is chached, the format is:

 [["ee4c1a3ed73044ad8bde4c10b9de1464"]], with organization [fiware:orion:atlantic:/coral::] and action [create]

The environment variables are not read by PEP

In the file where the environment variables are defined, is needed to explicit that the environment variables has to be exported like export PROXY_PORTif not, the variable is not exported to the other shells, included the one who starts PeP and the config is not modified

File

# Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Policy Enforcement Point.
#
# Orion Policy Enforcement Point is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Orion Policy Enforcement Point is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Orion Policy Enforcement Point. If not, see http://www.gnu.org/licenses/.
#
# For those usages not covered by this license please contact with
# fermin at tid dot es

#
# General Configuration
############################################################################

# Port where the proxy will listen for requests
PROXY_PORT=1026

# User to execute the PEP Proxy with
PROXY_USER=pepproxy

# Host where the target Context Broker is located
# TARGET_HOST=localhost

# Port where the target Context Broker is listening
# TARGET_PORT=10026

# Maximum level of logs to show (FATAL, ERROR, WARNING, INFO, DEBUG)
LOG_LEVEL=ERROR

#
# Access Control Configuration
############################################################################

# Host where the Access Control (the component who knows the policies for the incoming requests) is located
# ACCESS_HOST=

# Port where the Access Control is listening
# ACCESS_PORT=

# Host where the authentication authority for the Access Control is located
# AUTHENTICATION_HOST=

# Port where the authentication authority is listening
# AUTHENTICATION_PORT=

# User name of the PEP Proxy in the authentication authority
PROXY_USERNAME=pep

# Password of the PEP Proxy in the Authentication authority
PROXY_PASSWORD=pep

In update context operation 'v1' is not supported

When a request is made to the endpoint

/v1/updateContext

The system is not capable to capture de "action", the log says:

time=2014-12-02T16:37:40.511Z | lvl=DEBUG | corr=95f11240-1f20-44ec-a873-6054f8bb995e | trans=95f11240-1f20-44ec-a873-6054f8bb995e | op=/v1/updateContext | msg=Extracting action from the URL "/v1/updateContext"
time=2014-12-02T16:37:40.511Z | lvl=ERROR | corr=95f11240-1f20-44ec-a873-6054f8bb995e | trans=95f11240-1f20-44ec-a873-6054f8bb995e | op=/v1/updateContext | msg=[ORION-PLUGIN-005] Action not found
time=2014-12-02T16:37:40.515Z | lvl=DEBUG | corr=95f11240-1f20-44ec-a873-6054f8bb995e | trans=95f11240-1f20-44ec-a873-6054f8bb995e | op=/v1/updateContext | msg=response-time: 6 statusCode: 403

Instead, if the request is done to the endpoint:

/NGSI10/updateContext

the action is mapped ok:

time=2014-12-02T16:47:42.097Z | lvl=DEBUG | corr=4e2d8546-5934-4c61-9321-c85504287610 | trans=4e2d8546-5934-4c61-9321-c85504287610 | op=/NGSI10/updateContext | msg=Inspecting JSON body to discover action:
{
    "contextElements": [
        {
            "type": "Car",
            "isPattern": "false",
            "id": "Car01",
            "attributes": [
                {
                    "type": "centigrade",
                    "name": "temperature",
                    "value": "99"
                }
            ]
        }
    ],
    "updateAction": "APPEND"
}


time=2014-12-02T16:47:42.098Z | lvl=DEBUG | corr=4e2d8546-5934-4c61-9321-c85504287610 | trans=4e2d8546-5934-4c61-9321-c85504287610 | op=/NGSI10/updateContext | msg=Discovered action was: create

Plugins configuration

I miss in the documentation how to change the config.js file to activate the plugins, like is explained for the REST plugin

There are URLS allowed, not documented

There are some URLs implemented in the OrionPlugin, that are not documented in the doc,

  ['GET', /^\/v1\/contextentities/, 'read'],
  ['POST', /^\/v1\/contextentities/, 'create'],
  ['GET', /^\/v1\/contextsubscriptions/, 'read'],
  ['GET', /^\/v1\/contextsubscriptions\/.+/, 'read'],
  ['GET', /^\/v1\/contexttypes/, 'read'],
  ['GET', /^\/v1\/contexttypes\/.+/, 'read']

Authentication with KeyRock (IdM) not working

We are trying to use fiware-orion-pep with KeyRock. The config for authentication is:

config.authentication = {
    module: 'idm',
    user: '[email protected]',
    password: 'password',
    options: {
        protocol: 'http',
        host: 'idm.shinchan.bitergia.org',
        port: 80,
        path: '/user',
        authPath: '/oauth2/authorize'
    }
};

and when trying to use Orion:

vagrant@vagrant-ubuntu-trusty-64:~/fiware-orion-pep$ (curl localhost:1026/v1/registry/registerContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
> {
>   "contextRegistrations": [
>     {
>       "metadatas": [
...
> EOF
{
    "message": "Access forbidden"
}

and in the PEP logs:

time=2014-11-27T17:53:08.143Z | lvl=ERROR | corr=15067754-5036-4343-892e-79f97cfc28f3 | trans=15067754-5036-4343-892e-79f97cfc28f3 | op=/v1/registry/registerContext | msg=[PROXY-GEN-001] Organization headers not found
time=2014-11-27T17:53:08.146Z | lvl=DEBUG | corr=15067754-5036-4343-892e-79f97cfc28f3 | trans=15067754-5036-4343-892e-79f97cfc28f3 | op=/v1/registry/registerContext | msg=response-time: 3 statusCode: 403

The KeyRock in idm.shinchan.bitergia.org is working normally.

ValidationRequest.xml template

Hi! I'm using PEP proxy against Keypass and, when the PEP fills the template to validate the PDP against Keypass, Keypass returns a 400 error.

Checking the template, I've seen that in the request what makes the error is the field CombinedDecision="false" that is duplicated. Removing one of them makes it work.

Cheers

context broker crashes with invalid geoquery

When we create a syntactically correct query but that is semantically incorrect, the broker crashes. We created the following query that combines a geo restriction of kind polygon and, in the same query, a restriction of kind circle, then the broker crashes.

The query is:
jsonPoligono = '"restriction": {"scopes": [{ "type" : "FIWARE::Location","value" : {"polygon": {'+
'"vertices": [' +
'{"latitude": "-33.603458","longitude": "-70.652788"},' +
'{"latitude": "-33.604231","longitude": "-70.646032"},' +
'{"latitude": "-33.606123","longitude": "-70.646781"},' +
'{"latitude": "-33.606123","longitude": "-70.646781"}' +
']}}},'
jsonCirculo = '"{ "type" : "FIWARE::Location","value" : {"circle": {'+
'"centerLatitude": "-33.602391",'+
'"centerLongitude": "-70.661781",'+
'"radius": "200"'+
'}}}]}'

jsonX='{ "entities": [{"type": "","isPattern": "true","id": ".*"}],' + jsonPoligono + jsonCirculo+ '}'


resp = get_post_results("/v1/queryContext", jsonX)
for x in resp.iteritems():
    print "Elemento:", x[0]
    print "Atributos:"
    for y in x[1]:
        print "    Name:", y["name"], "Type:", y["type"], "Value:", y["value"]

There are some URLs that not permit URI parms

PeP checks the action in the url to permit continue or not. If the URL is checked, it included the URI parms, because of that, a url that has to be permitted to pass is not permited if this url contains URI parms.

The decision to allow or not to pass (or the way to get the action) its check the path, and not the url.

Some URLs that is not possible get the actions of the urls are:

    | json   | /v1/registry/contextAvailabilitySubscriptions?details=on&limit=15&offset=0                                 | POST   |
    | json   | /v1/contextSubscriptions?details=on&limit=15&offset=0                                                      | POST   |
    | json   | /v1/registry/subscribeContextAvailability?details=on&limit=15&offset=0                                     | POST   |
    | json   | /v1/registry/updateContextAvailabilitySubscription?details=on&limit=15&offset=0                            | POST   |
    | json   | /v1/registry/unsubscribeContextAvailability?details=on&limit=15&offset=0                                   | POST   |
    | json   | /v1/registry/discoverContextAvailability?details=on&limit=15&offset=0                                      | POST   |
    | json   | /v1/registry/registerContext?details=on&limit=15&offset=0                                                  | POST   |
    | json   | /v1/subscribeContext?details=on&limit=15&offset=0                                                          | POST   |
    | json   | /v1/updateContextSubscription?details=on&limit=15&offset=0                                                 | POST   |
    | json   | /v1/unsubscribeContext?details=on&limit=15&offset=0                                                        | POST   |
    | json   | /v1/queryContext?details=on&limit=15&offset=0                                                              | POST   |

PEP tries 4 times a bad authentication

When keystone deny a user token, retry the authentication four times has no sense, the result will be the same always:

time=2014-12-10T14:01:38.420Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authenticating against Keystone {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2014-12-10T14:01:38.623Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.582985Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.583032Z"
    }
}
time=2014-12-10T14:01:38.623Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.582985Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.583032Z"
    }
}


time=2014-12-10T14:01:38.624Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEwVDE1OjAxOjM4LjU4Mjk4NVoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTBUMTQ6MDE6MzguNTgzMDMyWiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAeFN4HEWW5zWqsz+c1SgxwIobZlxlbW2xbkL4giEaOayCY0t9BO9qBGOnQ8BpNmjnwXAONd8SYuS+dWeagY9XRPqXRFODNQ2kQYOSz6e8q9a-JgbDReozEJevrxALCdwIRB-mfdDCubLIsb-MxIXcaUfGrbQ2iyQ5To0NnzXw6kfq3oY6MsY1x2dkoNVkRUfTjqtBS7COQJckDaNJWHq9D+EUNLJEvMDLrxi0GJ+8RGnq2OYJiSEFJmW6UrI1clqQZSMqu5nJUOt8CoBS-JhxES14vL4z6-aAc0f6DLzaB3uYDrM0GdncRKBMrFEgN-IIyubP-Y2n2baOPlj1RnSGH",
        "X-Subject-Token": "token_1"
    }
}
time=2014-12-10T14:01:38.640Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "Could not find token, token_1.",
        "code": 404,
        "title": "Not Found"
    }
}
time=2014-12-10T14:01:38.640Z | lvl=ERROR | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Invalid token: token_1
time=2014-12-10T14:01:38.640Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authenticating against Keystone {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2014-12-10T14:01:38.761Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.731427Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.731459Z"
    }
}
time=2014-12-10T14:01:38.761Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.731427Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.731459Z"
    }
}


time=2014-12-10T14:01:38.762Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEwVDE1OjAxOjM4LjczMTQyN1oiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTBUMTQ6MDE6MzguNzMxNDU5WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQCWYC0xqYHjliZtkCEiomwKZ-Jro6hQyd3xUKBwAY0V9BGDkse5gtEGn8i1+YLBQ+bz5lmegGVMPCjd7Oo8ETeDsSYaf9VjuXngkY7Sx8Np13EtHNoLJw-88fiwAUdqW5VV7X-jpY9+7HGniJO56XgY9T8LPb51QbEg98mvOkP3AiaE1g+k7PYBFhDZtE0oL1fH8qBLXEnWfHnyyJ-ru4TDa6A3BMcf9zaI1722XNqD+FGllmYj38fJ4pywD+M7wSMTAl8mu2XeRWwYVPjsoqfKPxwKetdnGblOu0+QpaxPMtGiK8S2WSYEmkXU8IXtp5dIjszGBXm-GV2ySzKLGAHf",
        "X-Subject-Token": "token_1"
    }
}
time=2014-12-10T14:01:38.776Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "Could not find token, token_1.",
        "code": 404,
        "title": "Not Found"
    }
}
time=2014-12-10T14:01:38.776Z | lvl=ERROR | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Invalid token: token_1
time=2014-12-10T14:01:38.776Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authenticating against Keystone {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2014-12-10T14:01:38.894Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.863767Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.863796Z"
    }
}
time=2014-12-10T14:01:38.894Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.863767Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.863796Z"
    }
}


time=2014-12-10T14:01:38.895Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEwVDE1OjAxOjM4Ljg2Mzc2N1oiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTBUMTQ6MDE6MzguODYzNzk2WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQBBk-pRxX+eSUZDieE1UZzkQCjxAtOBPomRVSa9UKXLvTEiHiGWdml4JjLINxSllXJqdCfp86Y-PVp3buvN3nynitZXMLO-VzvjLkBvWRH7+Y8i3Tsmi1jQmVBwYsc6LHL20INq-0uxgE8Zrh7HoavJK5t3JJapCDS82Zkf5UQonVQeKHpUWj9+gWcqRhbz1ZOoUeZS2Rb1SZlehNLTppk9aimUbj4xpFsUsRZ8ewMSJS4xqZnh36QRZSNZM4QY81yHhF54hu-3DYMqL-xDvAaXktdEnYTZx22Tbb7k19cDJPKTh5jS+q6WymEuR-COt7kDPNIWb3SDfaODA4B0wFP9",
        "X-Subject-Token": "token_1"
    }
}
time=2014-12-10T14:01:38.910Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "Could not find token, token_1.",
        "code": 404,
        "title": "Not Found"
    }
}
time=2014-12-10T14:01:38.910Z | lvl=ERROR | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Invalid token: token_1
time=2014-12-10T14:01:38.910Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authenticating against Keystone {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2014-12-10T14:01:39.028Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.994715Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.994744Z"
    }
}
time=2014-12-10T14:01:39.030Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:38.994715Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:38.994744Z"
    }
}


time=2014-12-10T14:01:39.031Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEwVDE1OjAxOjM4Ljk5NDcxNVoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTBUMTQ6MDE6MzguOTk0NzQ0WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQCs2wqKk7jjI0WEHVTUuH7qV0n4UPDludflerh-MtBlelkcuJEkBp9OyCjf0YMiBxjYJXZ6c6XvFswvhur+qycVjR3cssi1YrUiI5rVXrtY45Qs9isviOlJ2oJfhdsg3vBmcRhH+vK-xrUL66L3Kpia+rDtDAAV2RVXoEAnM2xqJ6ikQHlxQr1xsuAUdaOfTMq9+7J2i9JViAhivdGCt6C1VyQO3ur28yy9ttRhONaA4MjLtQH7HjVoK7ATWhh1NdwFG7Rcq6IlVc0blGMvM8mqF7+PewXQoI+BmeArD703-yXx9J1V7VkKivg4vpDAS2DZg5GTS26IA94caZpfiYqv",
        "X-Subject-Token": "token_1"
    }
}
time=2014-12-10T14:01:39.052Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "Could not find token, token_1.",
        "code": 404,
        "title": "Not Found"
    }
}
time=2014-12-10T14:01:39.052Z | lvl=ERROR | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Invalid token: token_1
time=2014-12-10T14:01:39.052Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authenticating against Keystone {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "POST",
    "json": {
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "domain": {
                            "name": "admin_domain"
                        },
                        "name": "pep",
                        "password": "pep"
                    }
                }
            },
            "scope": {
                "domain": {
                    "name": "admin_domain"
                }
            }
        }
    }
}
time=2014-12-10T14:01:39.172Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response authenticating PEP:

 {
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:39.142121Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:39.142147Z"
    }
}
time=2014-12-10T14:01:39.172Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Authentication to keystone success:
{
    "token": {
        "domain": {
            "id": "71693d05e4e24b879fafe0f6b1e62287",
            "name": "admin_domain"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "6e8fb291930d43299800d5372ff58b7e",
                "name": "service"
            }
        ],
        "expires_at": "2014-12-10T15:01:39.142121Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "71693d05e4e24b879fafe0f6b1e62287",
                "name": "admin_domain"
            },
            "id": "ae37f927f9da41189f12306c3e90cd32",
            "name": "pep"
        },
        "issued_at": "2014-12-10T14:01:39.142147Z"
    }
}


time=2014-12-10T14:01:39.173Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEwVDE1OjAxOjM5LjE0MjEyMVoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTBUMTQ6MDE6MzkuMTQyMTQ3WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQB6D6iqHKPmMJx50SCLbbmY7j+sfLLDiRfP+bjBSA+keR6wL-Gm4vM8xxlL-bO9iT-p+YMWKSe5NVWfUJDbRfl-PF9ek5Nduk0HDelVR1Q5G+6Z9HqpXxrF52DKiMu1mhlVQJzimLZ96RC86JGNryKCTU6jt9tbV7r3H4kO9lYOPhDijapnxFoBevFcATo7DHgFtHqfC6lq7gELWBfQ29K85wCDqDwEEkmV9hRJi9PToP1A3zBode0HaVvccpbYJzxuhcpPE9ZRh0yBqEfVYSgUjrc0hTSOu8g3sXdo6RjKhuMxLbI9tIsxftsBSAezDPQcXKADhZnMkoX3m3yNEqoS",
        "X-Subject-Token": "token_1"
    }
}
time=2014-12-10T14:01:39.188Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Keystone response retrieving user:

 {
    "error": {
        "message": "Could not find token, token_1.",
        "code": 404,
        "title": "Not Found"
    }
}
time=2014-12-10T14:01:39.189Z | lvl=ERROR | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=Invalid token: token_1
time=2014-12-10T14:01:39.189Z | lvl=DEBUG | corr=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | trans=1e022df6-7f25-47cb-9e96-a2a9a925ab99 | op=/v1/contextEntities | msg=response-time: 769 statusCode: 401


The asks of roles is done without the "effective" URI parms

When PEP ask for roles of a user, use the url in the configuration, and adds as a URI parm the user.id of the user who owns the roles.

If the role is assignment directly, its works fine, but if the role is inherit, the keystone not respond with this roles, unless &effective URI parm is added, then, PEP never sent this roles to Keypass(AccessControl) and respond with an error

A READ operation is recognize as CREATE operation

In the doc

  • GET /ngsi10/contextEntities/{EntityID} R

Log:

See:

  • "method": "GET"
  • op=/v1/contextEntities/%7BEntityID%7D
  • <Attribute IncludeInResult=\"false\"\n AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n >create</AttributeValue>\n </Attribute>
time=2014-12-12T09:37:58.311Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.4:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEyVDEwOjM2OjI0LjI2NDU5NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTJUMDk6MzY6MjQuMjY0NjQ2WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQB4-zDmv6aWySy-9ZdOZO9rnNCwftrNEZBQ54oZl3PvYfbdb8UO5kpX+tg7zt5Jn-pEOTvGhdn7EBg66yVImpHztbODlgwFlpa3BnROPI7JbGGbLv8acNjM2-+la4L7K7JlbJXDL-ZxYp8BS9imFHr9qR4BX11a-TioqHKZTAbJt1NCR97q9H0mGnWBCYp+avM7f3RSz+caAz5AZ-zPpN2jSwZSnkWd5BnJiYQ9VNUj9qZwD2wK8j75Toj1OarwTSuT3+CNGReq2bUoXG6KS3BGuLB2zR48bzTSUbS0eAF6EXi1CKPTEOt2m65JU4yUk50tHofgKnopumdi0RGpXCht",
        "X-Subject-Token": "MIIDpQYJKoZIhvcNAQcCoIIDljCCA5ICAQExCTAHBgUrDgMCGjCCAfsGCSqGSIb3DQEHAaCCAewEggHoeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICIzYjY1NzJlYTRiN2U0NjU4YmY3YzIxNWU4MmMwMDZjMyIsICJuYW1lIjogImF0bGFudGljIn0sICJtZXRob2RzIjogWyJwYXNzd29yZCJdLCAicm9sZXMiOiBbeyJpZCI6ICJiOWU0MTVkNjc0NGU0MDMzOTZlMmE2NjdhM2I0Y2U4ZSIsICJuYW1lIjogIjNiNjU3MmVhNGI3ZTQ2NThiZjdjMjE1ZTgyYzAwNmMzI1N1YlNlcnZpY2VBZG1pbiJ9XSwgImV4cGlyZXNfYXQiOiAiMjAxNC0xMi0xMlQxMDozNzo1OC4yNzcwNDlaIiwgImNhdGFsb2ciOiBbXSwgImV4dHJhcyI6IHt9LCAidXNlciI6IHsiZG9tYWluIjogeyJpZCI6ICIzYjY1NzJlYTRiN2U0NjU4YmY3YzIxNWU4MmMwMDZjMyIsICJuYW1lIjogImF0bGFudGljIn0sICJpZCI6ICJiNTFhYzRiOWIxNjE0ODE4OTkwY2NmOWUxNmJmZDFjNiIsICJuYW1lIjogIm9jdG9wdXMifSwgImlzc3VlZF9hdCI6ICIyMDE0LTEyLTEyVDA5OjM3OjU4LjI3NzEwM1oifX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAM19BgKeohD2p2r7hDcjo1CBRijVCpI+D+1v-vrtIAPCCnuo3jLSlFiTlea7z0tBnouh7ELYAtxZ7lGZqxViNOpp0aOBbAMy53WTtsqmvYSd1Iro-yUyKBxfYNPRJ1gRSSAtrzMK8Et7QIaSgTgokIBCYm58XjWvwKUskmBgxoSfJzkcFCoVdIkD3356nqbhLtFfzbkm5ytXs-12wZ7AEB0+5-6vUqpBccZAjo9jG5wTv1lnj2GWKJrniXRifKan92CJT6LdF+e4NIyYrZTtTVZAO2xop5blUtVqj2yDKHZziiEor-Gmctqq+HIBoR0gvoVWAFQoqsIv5xiwZK6yf+Q=="
    }
}
time=2014-12-12T09:37:58.332Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Keystone response retrieving user:

 {
    "token": {
        "domain": {
            "id": "3b6572ea4b7e4658bf7c215e82c006c3",
            "name": "atlantic"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "b9e415d6744e403396e2a667a3b4ce8e",
                "name": "3b6572ea4b7e4658bf7c215e82c006c3#SubServiceAdmin"
            }
        ],
        "expires_at": "2014-12-12T10:37:58.277049Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "3b6572ea4b7e4658bf7c215e82c006c3",
                "name": "atlantic"
            },
            "id": "b51ac4b9b1614818990ccf9e16bfd1c6",
            "name": "octopus"
        },
        "issued_at": "2014-12-12T09:37:58.277103Z"
    }
}
time=2014-12-12T09:37:58.339Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=User response from Keystone:
{
    "token": {
        "domain": {
            "id": "3b6572ea4b7e4658bf7c215e82c006c3",
            "name": "atlantic"
        },
        "methods": [
            "password"
        ],
        "roles": [
            {
                "id": "b9e415d6744e403396e2a667a3b4ce8e",
                "name": "3b6572ea4b7e4658bf7c215e82c006c3#SubServiceAdmin"
            }
        ],
        "expires_at": "2014-12-12T10:37:58.277049Z",
        "catalog": [],
        "extras": {},
        "user": {
            "domain": {
                "id": "3b6572ea4b7e4658bf7c215e82c006c3",
                "name": "atlantic"
            },
            "id": "b51ac4b9b1614818990ccf9e16bfd1c6",
            "name": "octopus"
        },
        "issued_at": "2014-12-12T09:37:58.277103Z"
    }
}


time=2014-12-12T09:37:58.344Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Retrieving subservice ID from keystone:  {
    "url": "http://172.17.0.4:5000/v3/projects",
    "method": "GET",
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEyVDEwOjM2OjI0LjI2NDU5NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTJUMDk6MzY6MjQuMjY0NjQ2WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQB4-zDmv6aWySy-9ZdOZO9rnNCwftrNEZBQ54oZl3PvYfbdb8UO5kpX+tg7zt5Jn-pEOTvGhdn7EBg66yVImpHztbODlgwFlpa3BnROPI7JbGGbLv8acNjM2-+la4L7K7JlbJXDL-ZxYp8BS9imFHr9qR4BX11a-TioqHKZTAbJt1NCR97q9H0mGnWBCYp+avM7f3RSz+caAz5AZ-zPpN2jSwZSnkWd5BnJiYQ9VNUj9qZwD2wK8j75Toj1OarwTSuT3+CNGReq2bUoXG6KS3BGuLB2zR48bzTSUbS0eAF6EXi1CKPTEOt2m65JU4yUk50tHofgKnopumdi0RGpXCht"
    },
    "query": {
        "domain_id": "3b6572ea4b7e4658bf7c215e82c006c3",
        "name": "/coral"
    },
    "json": {}
}
time=2014-12-12T09:37:58.360Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Keystone response retrieving subservice ID:

 {
    "links": {
        "self": "http://172.17.0.4:5000/v3/projects",
        "previous": null,
        "next": null
    },
    "projects": [
        {
            "description": "Nemos house",
            "links": {
                "self": "http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da"
            },
            "enabled": true,
            "id": "9dd0d2b8c9d347e7870eb8a80f6324da",
            "domain_id": "3b6572ea4b7e4658bf7c215e82c006c3",
            "name": "/coral"
        },
        {
            "description": "Admin Tenant",
            "links": {
                "self": "http://172.17.0.4:5000/v3/projects/ad350e4b9ab741969d96104c2dbc3c5c"
            },
            "enabled": true,
            "id": "ad350e4b9ab741969d96104c2dbc3c5c",
            "domain_id": "default",
            "name": "admin"
        }
    ]
}
time=2014-12-12T09:37:58.373Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Subservice body response from Keystone:
{
    "links": {
        "self": "http://172.17.0.4:5000/v3/projects",
        "previous": null,
        "next": null
    },
    "projects": [
        {
            "description": "Nemos house",
            "links": {
                "self": "http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da"
            },
            "enabled": true,
            "id": "9dd0d2b8c9d347e7870eb8a80f6324da",
            "domain_id": "3b6572ea4b7e4658bf7c215e82c006c3",
            "name": "/coral"
        },
        {
            "description": "Admin Tenant",
            "links": {
                "self": "http://172.17.0.4:5000/v3/projects/ad350e4b9ab741969d96104c2dbc3c5c"
            },
            "enabled": true,
            "id": "ad350e4b9ab741969d96104c2dbc3c5c",
            "domain_id": "default",
            "name": "admin"
        }
    ]
}


time=2014-12-12T09:37:58.376Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Extracting roles for token {
    "url": "http://172.17.0.4:5000/v3/role_assignments",
    "method": "GET",
    "qs": {
        "user.id": "b51ac4b9b1614818990ccf9e16bfd1c6"
    },
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTEyVDEwOjM2OjI0LjI2NDU5NloiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTJUMDk6MzY6MjQuMjY0NjQ2WiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQB4-zDmv6aWySy-9ZdOZO9rnNCwftrNEZBQ54oZl3PvYfbdb8UO5kpX+tg7zt5Jn-pEOTvGhdn7EBg66yVImpHztbODlgwFlpa3BnROPI7JbGGbLv8acNjM2-+la4L7K7JlbJXDL-ZxYp8BS9imFHr9qR4BX11a-TioqHKZTAbJt1NCR97q9H0mGnWBCYp+avM7f3RSz+caAz5AZ-zPpN2jSwZSnkWd5BnJiYQ9VNUj9qZwD2wK8j75Toj1OarwTSuT3+CNGReq2bUoXG6KS3BGuLB2zR48bzTSUbS0eAF6EXi1CKPTEOt2m65JU4yUk50tHofgKnopumdi0RGpXCht"
    }
}
time=2014-12-12T09:37:58.396Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Keystone response retrieving roles:

 "{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"2ea6fd4a01924d8ca4d25029b708dfb4\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/2ea6fd4a01924d8ca4d25029b708dfb4\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"300e3805cfc2442487451a1f1f351f60\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/300e3805cfc2442487451a1f1f351f60\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"7bc2f04379f842d8918759b2bc84c732\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/7bc2f04379f842d8918759b2bc84c732\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"8013ef2afbab423689011575017ff304\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/8013ef2afbab423689011575017ff304\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"c5f4ec4ff09649e6863b80955a22b096\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/c5f4ec4ff09649e6863b80955a22b096\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"e219aa69f3654b138071e81317530bd6\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/e219aa69f3654b138071e81317530bd6\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"e8f8ffff2b994b0a9d06bb0610ad23ca\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/e8f8ffff2b994b0a9d06bb0610ad23ca\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"f50051c10d9a48c5a2b0bee4385d7e52\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/f50051c10d9a48c5a2b0bee4385d7e52\"}}, {\"scope\": {\"domain\": {\"id\": \"3b6572ea4b7e4658bf7c215e82c006c3\"}}, \"role\": {\"id\": \"b9e415d6744e403396e2a667a3b4ce8e\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/domains/3b6572ea4b7e4658bf7c215e82c006c3/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/b9e415d6744e403396e2a667a3b4ce8e\"}}], \"links\": {\"self\": \"http://172.17.0.4:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"
time=2014-12-12T09:37:58.397Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Roles response from Keystone:
"{\"role_assignments\": [{\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"2ea6fd4a01924d8ca4d25029b708dfb4\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/2ea6fd4a01924d8ca4d25029b708dfb4\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"300e3805cfc2442487451a1f1f351f60\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/300e3805cfc2442487451a1f1f351f60\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"7bc2f04379f842d8918759b2bc84c732\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/7bc2f04379f842d8918759b2bc84c732\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"8013ef2afbab423689011575017ff304\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/8013ef2afbab423689011575017ff304\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"c5f4ec4ff09649e6863b80955a22b096\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/c5f4ec4ff09649e6863b80955a22b096\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"e219aa69f3654b138071e81317530bd6\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/e219aa69f3654b138071e81317530bd6\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"e8f8ffff2b994b0a9d06bb0610ad23ca\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/e8f8ffff2b994b0a9d06bb0610ad23ca\"}}, {\"scope\": {\"project\": {\"id\": \"9dd0d2b8c9d347e7870eb8a80f6324da\"}}, \"role\": {\"id\": \"f50051c10d9a48c5a2b0bee4385d7e52\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/projects/9dd0d2b8c9d347e7870eb8a80f6324da/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/f50051c10d9a48c5a2b0bee4385d7e52\"}}, {\"scope\": {\"domain\": {\"id\": \"3b6572ea4b7e4658bf7c215e82c006c3\"}}, \"role\": {\"id\": \"b9e415d6744e403396e2a667a3b4ce8e\"}, \"user\": {\"id\": \"b51ac4b9b1614818990ccf9e16bfd1c6\"}, \"links\": {\"assignment\": \"http://172.17.0.4:5000/v3/domains/3b6572ea4b7e4658bf7c215e82c006c3/users/b51ac4b9b1614818990ccf9e16bfd1c6/roles/b9e415d6744e403396e2a667a3b4ce8e\"}}], \"links\": {\"self\": \"http://172.17.0.4:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"


time=2014-12-12T09:37:58.399Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Creating access request for user [["2ea6fd4a01924d8ca4d25029b708dfb4","300e3805cfc2442487451a1f1f351f60","7bc2f04379f842d8918759b2bc84c732","8013ef2afbab423689011575017ff304","c5f4ec4ff09649e6863b80955a22b096","e219aa69f3654b138071e81317530bd6","e8f8ffff2b994b0a9d06bb0610ad23ca","f50051c10d9a48c5a2b0bee4385d7e52"]], with organization [fiware:orion:atlantic:/coral::] and action [create]
time=2014-12-12T09:37:58.399Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Sending access request:
{
    "uri": "http://172.17.0.2:8080/pdp/v3",
    "method": "POST",
    "headers": {
        "Content-Type": "application/xml",
        "Accept": "application/xml",
        "fiware-service": "atlantic",
        "fiware-servicepath": "/coral"
    },
    "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Request xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"\n         ReturnPolicyIdList=\"false\"\n         CombinedDecision=\"false\">\n<!-- user roles identifiers-->\n<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">\n    <Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >2ea6fd4a01924d8ca4d25029b708dfb4</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >300e3805cfc2442487451a1f1f351f60</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >7bc2f04379f842d8918759b2bc84c732</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >8013ef2afbab423689011575017ff304</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >c5f4ec4ff09649e6863b80955a22b096</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >e219aa69f3654b138071e81317530bd6</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >e8f8ffff2b994b0a9d06bb0610ad23ca</AttributeValue>\n</Attribute><Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >f50051c10d9a48c5a2b0bee4385d7e52</AttributeValue>\n</Attribute>\n</Attributes>\n<!-- fiware resource name being accessed: organization id -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >fiware:orion:atlantic:/coral::</AttributeValue>\n    </Attribute>\n</Attributes>\n<!-- action performed -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >create</AttributeValue>\n    </Attribute>\n</Attributes>\n</Request>"
}

time=2014-12-12T09:37:58.434Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=Request access denied
time=2014-12-12T09:37:58.435Z | lvl=DEBUG | corr=f5d59b80-0c5f-4b07-886a-a9b1851557cf | trans=f5d59b80-0c5f-4b07-886a-a9b1851557cf | op=/v1/contextEntities/%7BEntityID%7D | msg=response-time: 123 statusCode: 403

release.sh script doesn't change create-rpm.sh

create-rpm.sh script including the following:

if [ -z "$PROXY_VERSION" ]; then
   PROXY_VERSION=0.4.0
fi

That PROXY_VERSION=0.4.0 is supposed to be changed by release.sh, in order to keep it synchronized regarding the version in the package.json package. However, current release.sh script is not doing so.

Normalize service and subservice names

The fiware-service and fiware-servicepath headers, along with the concepts they represent, have changed in name multiple times from the beginning of the project: service, tenant, organization, path, domain, application... The current use of this names in the code is a mess. Function names, variables and constants should be changed along the code to make sure they fit the current vocabulary.

Effort: 1 man day

In some CB urls, pep set the action "suscribe" instead of "subscribe"

In the urls:

POST    /ngsi10/contextSubscriptions    S
PUT /ngsi10/contextSubscriptions/{subscriptionID}   S
DELETE  /ngsi10/contextSubscriptions/{subscriptionID}   S

PEP sets the action "suscribe" instedad of "subscribe":

LOG of one example

time=2014-12-17T10:52:25.979Z | lvl=DEBUG | corr=04ae81da-b450-4805-b17c-5671cb2aee32 | trans=04ae81da-b450-4805-b17c-5671cb2aee32 | op=/v1/contextSubscriptions/subscriptionID | msg=Creating access request for user [["bd6d3143ea9e42e683ece9bc178608eb"]], with organization [fiware:orion:atlantic_only_project:/cave::] and action [suscribe]
time=2014-12-17T10:52:25.982Z | lvl=DEBUG | corr=04ae81da-b450-4805-b17c-5671cb2aee32 | trans=04ae81da-b450-4805-b17c-5671cb2aee32 | op=/v1/contextSubscriptions/subscriptionID | msg=Sending access request:
{
    "uri": "http://172.17.0.2:8080/pdp/v3",
    "method": "POST",
    "headers": {
        "Content-Type": "application/xml",
        "Accept": "application/xml",
        "fiware-service": "atlantic_only_project",
        "fiware-servicepath": "/cave"
    },
    "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Request xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"\n         ReturnPolicyIdList=\"false\"\n         CombinedDecision=\"false\">\n<!-- user roles identifiers-->\n<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">\n    <Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >bd6d3143ea9e42e683ece9bc178608eb</AttributeValue>\n</Attribute>\n</Attributes>\n<!-- fiware resource name being accessed: organization id -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >fiware:orion:atlantic_only_project:/cave::</AttributeValue>\n    </Attribute>\n</Attributes>\n<!-- action performed -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >suscribe</AttributeValue>\n    </Attribute>\n</Attributes>\n</Request>"
}

Investigate when PEP dies because a socket exception

Candidates errors:

time=2014-12-11T01:07:39.869Z | lvl=ERROR | corr=e99d0b0d-7719-41b2-a989-04db1b93a333 | trans=e99d0b0d-7719-41b2-a989-04db1b93a333 | op=/v1/updateContext | msg=Error: connect EHOSTUNREACH
time=2014-12-11T01:10:56.509Z | lvl=ERROR | corr=8a9da1b9-ddc8-4c0e-ab68-37e273965e8a | trans=8a9da1b9-ddc8-4c0e-ab68-37e273965e8a | op=/v1/updateContext | msg=Error: socket hang up

Errors not shown

When the payload is not serializable to json, the error is not shown in the log. Note in the payload, the object send is not json (see " element)

The url requested is:

http://127.0.0.1:1025/v1/updateContext

With the headers:

{'Fiware-Service': 'atlantic', 'content-type': 'application/json', 'fiware-servicepath': 'coral', 'Accept': 'application/json', 'x-auth-token': 'MIIDfgYJKoZIhvcNAQcCoIIDbzCCA2sCAQExCTAHBgUrDgMCGjCCAdQGCSqGSIb3DQEHAaCCAcUEggHBeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICJjYjUwNmQ4ZjRjNzY0ZDQ2YTkxODgzYzBkZDVlZTkxMiIsICJuYW1lIjogImF0bGFudGljIn0sICJtZXRob2RzIjogWyJwYXNzd29yZCJdLCAicm9sZXMiOiBbeyJpZCI6ICIzNzY0NmIzN2YzYTE0OGYzYTY3MGYzOWM2N2ZmNjJiYiIsICJuYW1lIjogImFkbWluIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTAyVDE3OjQyOjA4LjU1MTUyNFoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogImNiNTA2ZDhmNGM3NjRkNDZhOTE4ODNjMGRkNWVlOTEyIiwgIm5hbWUiOiAiYXRsYW50aWMifSwgImlkIjogIjUyOGE4ODAyYzJkYzQwMTlhZGE0ODZhYzg4N2MxYzE3IiwgIm5hbWUiOiAid2hpdGVfc2hhcmsifSwgImlzc3VlZF9hdCI6ICIyMDE0LTEyLTAyVDE2OjQyOjA4LjU1MTU2MVoifX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEAikECWVU7NVG6NzXnNNMwkcgtYvdz+YyzTnc0XslbwjwOP4wjd70yQYU10jZa8jwOX3cm-NMq27nRogR-lf01SjLl8tM5LivPq2P1rCFVNJqpnJ5wK2zqzKqrq-JOxReNz3L130TnbqtmdFK-cTjH7OOMdvsQo8g17tu4AaMUeTRGBkSmX5KRNEnSh3MnBHJT8YD93oDVUaxkPez0BZC436+UbRJ8Su6OB-NHOuVuhgOJ5NBfYxqkA6f7Dah+76620vi8lSfla-jOS2V5mgsBbdPwnh8uga+fTUMLd1Ru-w3etVb5FfCK9E2Okxj9+W9G1ussBwCdds7+xkzxruO86A=='}

And the payload:

{
        "contextElements": [
            {
                "type": "Car",
                "isPattern": "false",
                "id": "Car01",
                "attributes": [{&quot;name&quot;: &quot;temperature&quot;, &quot;type&quot;: &quot;centigrade&quot;, &quot;value&quot;: &quot;99&quot;}]
            }],
        "updateAction": "APPEND"
    }

When a request is sent to v1/queryContext PEP dont recognize the action

When a POST request is ask to pep with the url

/v1/queryContext

It works in the old format /NGSI10/queryContext
PEP dont find the action "read"

LOG KO

time=2014-12-11T16:22:00.139Z | lvl=DEBUG | corr=0f1ebac3-9e88-4c98-bfb5-2e1b94eda3a1 | trans=0f1ebac3-9e88-4c98-bfb5-2e1b94eda3a1 | op=/v1/queryContext | msg=Extracting action from the URL "/v1/queryContext"
time=2014-12-11T16:22:00.139Z | lvl=ERROR | corr=0f1ebac3-9e88-4c98-bfb5-2e1b94eda3a1 | trans=0f1ebac3-9e88-4c98-bfb5-2e1b94eda3a1 | op=/v1/queryContext | msg=[ORION-PLUGIN-005] Action not found

LOG old format

time=2014-12-11T16:28:03.855Z | lvl=DEBUG | corr=3e32d501-9b6a-419b-98e2-eab7863bab4b | trans=3e32d501-9b6a-419b-98e2-eab7863bab4b | op=/NGSI10/queryContext | msg=Extracting action from the URL "/NGSI10/queryContext"
time=2014-12-11T16:28:03.856Z | lvl=DEBUG | corr=3e32d501-9b6a-419b-98e2-eab7863bab4b | trans=3e32d501-9b6a-419b-98e2-eab7863bab4b | op=/NGSI10/queryContext | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.4:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
.
.
.

When a updateContext with action in payload is sent with URI parms, pep can not found the action

When a /v1/updateContext/request is done to PEP with URI parms, PEP not found the ACTION in the url.

URL

http://127.0.0.1:1025/v1/updateContext?details=on&limit=15&offset=0

Headers

{'Fiware-Service': 'atlantic', 'content-type': u'application/json', 'Fiware-Servicepath': '/coral', 'Accept': u'application/json', 'X-Auth-Token': 'MIIC2QYJKoZIhvcNAQcCoIICyjCCAsYCAQExCTAHBgUrDgMCGjCCAS8GCSqGSIb3DQEHAaCCASAEggEceyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTUtMDItMDlUMDc6NTc6MDAuOTkxNjk3WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTUtMDItMDlUMDg6NTc6MDAuOTkxNjM1WiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjI3OWJmZGRlNDc1MjRiMjlhOWFjZmFlNGRmMTNjOTdiIiwgIm5hbWUiOiAiYXRsYW50aWMifSwgImlkIjogIjJjOGQ1MDFjMTczNTRkYmM4NWEzM2E3OTY4NDY2ZTM0IiwgIm5hbWUiOiAib2N0b3B1cyJ9fX0xggGBMIIBfQIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVVbnNldDEOMAwGA1UEBwwFVW5zZXQxDjAMBgNVBAoMBVVuc2V0MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEggEA3y6ODSP-1e8oqGpwSJPkVUODdV3fuFp7JAAzlD1hsuR8rTyqzEv-j9bPNpNHLePGp0gkxtrJlCBxdKhmF3bVhNLc0hI9aXJ9596ULims3mKd9BJUEUcbA+nqcrpjozeV2LNGjLIDucvlYxG6iQEnIsOjmQl5atDU4-NqRtlcTC4UvVf1tWNuLrQcx5lT+wUDzUT-aLFyu6WwvgHHGnJxhGvZWilJ1kliK9OttWT6L4p4v5Mm9d20fIAzE6HrFWD3A+ED2wzl56tOLj2v--67LvwR6eJ5ZfRA+XrPfU5G8bPKVq-UVg-h-33NAQ36L2t88wds0MjhYPcnhvu+Q0TpNQ=='}

Payload

{"updateAction": "DELETE"}

PeP log

time=2015-02-09T07:57:01.052Z | lvl=DEBUG | corr=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | trans=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | op=/v1/updateContext?details=on&limit=15&offset=0 | msg=Extracting action from the URL "/v1/updateContext?details=on&limit=15&offset=0"
time=2015-02-09T07:57:01.052Z | lvl=ERROR | corr=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | trans=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | op=/v1/updateContext?details=on&limit=15&offset=0 | msg=[ORION-PLUGIN-005] Action not found
time=2015-02-09T07:57:01.053Z | lvl=DEBUG | corr=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | trans=40a4e0d1-a5c1-4cd3-849e-0d263c979010 | op=/v1/updateContext?details=on&limit=15&offset=0 | msg=response-time: 2 statusCode: 403

Fix suggested : change req.url to req.path

/**
 * Middleware to calculate what Context Broker action has been received based on the path and the request payload.
 *
 * @param {Object} req           Incoming request.
 * @param {Object} res           Outgoing response.
 */
function extractCBAction(req, res, callback) {
    if (req.url.toLowerCase().match(/\/(ngsi10|v1)\/updatecontext$/)) {
        inspectBody(req, res, callback);
    } else {
        inspectUrl(req, res, callback);
    }
}

Add "test" mode to pep

For security reasons, its good to dont give any information about the internal errors (bad requests, bad auth, deny access, etc...).

But, for tests porpouses, is "nice to have" a "test" mode of the app. In this mode, the response give detailed information about what happend with the request in the integration process with Keystone and AccessControl

Effort: 1 man day

PEP checks headers in different ways

When the header doesnt exist, PEP do the following checks

header check
Accept Not Checked, go to AC
content-type checked in the first pep petition
Fiware-service checked in the first pep petition
Fiware-Servicepath checked in the "projects" petition to Keystone

The functionality is OK, but is a good enhancement do all checks in the same way

Log Accept

time=2015-01-05T13:03:06.725Z | lvl=DEBUG | corr=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | trans=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | op=/v1/updateContext | msg=Sending access request:
{
    "uri": "http://192.168.1.37:8082/pdp/v3",
    "method": "POST",
    "headers": {
        "Content-Type": "application/xml",
        "Accept": "application/xml",
        "fiware-service": "atlantic",
        "fiware-servicepath": "/"
    },
    "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Request xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"\n         ReturnPolicyIdList=\"false\"\n         CombinedDecision=\"false\">\n<!-- user roles identifiers-->\n<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">\n    <Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >33be1f92b96f45f69dd904eecf3098fd</AttributeValue>\n</Attribute>\n</Attributes>\n<!-- fiware resource name being accessed: organization id -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >fiware:orion:atlantic:/::</AttributeValue>\n    </Attribute>\n</Attributes>\n<!-- action performed -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >create</AttributeValue>\n    </Attribute>\n</Attributes>\n</Request>"
}

time=2015-01-05T13:03:06.744Z | lvl=DEBUG | corr=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | trans=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | op=/v1/updateContext | msg=Request access denied
time=2015-01-05T13:03:06.744Z | lvl=DEBUG | corr=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | trans=489d5d85-69c1-44ac-a3c9-2ee020ce77fe | op=/v1/updateContext | msg=response-time: 67 statusCode: 403

Log content-type

time=2015-01-05T13:04:23.757Z | lvl=ERROR | corr=94e838f2-d649-4c80-91b7-22e18d29ff9d | trans=94e838f2-d649-4c80-91b7-22e18d29ff9d | op=/v1/updateContext | msg=[ORION-PLUGIN-004] Unknown content type: undefined
time=2015-01-05T13:04:23.764Z | lvl=DEBUG | corr=94e838f2-d649-4c80-91b7-22e18d29ff9d | trans=94e838f2-d649-4c80-91b7-22e18d29ff9d | op=/v1/updateContext | msg=response-time: 11 statusCode: 403

Fiware-Service

time=2015-01-05T13:00:59.834Z | lvl=ERROR | corr=8b003fd4-6972-4330-a55a-c7da513a36d9 | trans=8b003fd4-6972-4330-a55a-c7da513a36d9 | op=/v1/updateContext | msg=[PROXY-GEN-001] Organization headers not found
time=2015-01-05T13:00:59.835Z | lvl=DEBUG | corr=8b003fd4-6972-4330-a55a-c7da513a36d9 | trans=8b003fd4-6972-4330-a55a-c7da513a36d9 | op=/v1/updateContext | msg=response-time: 1 statusCode: 403

Fiware-Servicepath

time=2015-01-05T13:00:59.306Z | lvl=ERROR | corr=68312705-2ae7-46f1-82f3-5d0038f4b309 | trans=68312705-2ae7-46f1-82f3-5d0038f4b309 | op=/v1/updateContext | msg=Couldn't find subservice id in Keystone with name undefined
time=2015-01-05T13:00:59.310Z | lvl=DEBUG | corr=68312705-2ae7-46f1-82f3-5d0038f4b309 | trans=68312705-2ae7-46f1-82f3-5d0038f4b309 | op=/v1/updateContext | msg=response-time: 403 statusCode: 403

When the payload sent to PEP is an XML, PEP sends '{}

For example, in ContextBroker, the payload can be in xml and in json.
When the payload is sent in xml, PEP sends the literal {}

# LOG (see the last line, the body is '{}')

time=2014-12-19T15:32:19.360Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Inspecting XML body to discover action:
<updateAction>APPEND</updateAction>


time=2014-12-19T15:32:19.360Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Discovered action was: create
time=2014-12-19T15:32:19.360Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Retrieving user from keystone:  {
    "url": "http://172.17.0.3:5000/v3/auth/tokens",
    "method": "GET",
    "json": {},
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDE2OjI0OjA3LjAwMTQwOVoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTU6MjQ6MDcuMDAxNDQyWiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQA5dVGKcMVDNx+GxrH7Tsbyt30y5J13t7Jn51N83e2O0rlVgu2j9wPJ75nF5YWKkkkXamwA1tTpAVVQbb+wegJkYM1LaIyyAhGpehjUBJ+AMagvCi-CO9dmqwxTWANi0aWv3NMxrtQ7lqarFGdUF2Qnonn1rGtfF-B2JO09OJ+zoInTP6ROpUW+rXQsbxojWFlVx-RrGeQ1xcws9PvkLdi8RGAKHXbHEqvJwypz82U5h9OlBTLO5XjZV9QPIsgg+kum0gs9vlpLC3Rzr7XXWcvYdmrBnKI7YqQu8B2jxX5MA82tXqXezyQntdum1n6G93WcozHuJKdFHe81T-1fMbkL",
        "X-Subject-Token": "MIIC6QYJKoZIhvcNAQcCoIIC2jCCAtYCAQExCTAHBgUrDgMCGjCCAT8GCSqGSIb3DQEHAaCCATAEggEseyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTU6MzI6MTkuMzI1OTU4WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTItMTlUMTY6MzI6MTkuMzI1OTMzWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogImUwYzA4MjFkOGZkMTRjMGZhZWI0YjA1Yzc3Y2ViOTU5IiwgIm5hbWUiOiAiYXRsYW50aWNfb25seV9kb21haW4ifSwgImlkIjogIjg0NWJmMjk1NTNmMzQ1MzhiYTMxNjU4MWIzNTMzMjYwIiwgIm5hbWUiOiAiY3JhYl9jcmVhdGUifX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBAHYqui888Zludq21VCAlOeiNLgnMGKTDjlEwCbXkyH3HzC6gz1+hJ4StXzTJ1dUVUGX+fMZpmpR0N+CEhjjWaHVbRKIG8OTHRaHQ920gP2t7FpdmpJXG8cDxkCjXJoPh5InHxRwrk7RI-jaenXC-pr3JEv+DPo7KC5ug4IKU1a9BR939rK72VG+INYQHBC5DWlhYLdogNBuUacwDF8fiduqnIDgciZzeNP4so1f0Q6n9N8xgwq-AC3Uo+02SHO57CCvapBK6QvLURhlqOGccQeiCpH8XEx6ilgGW2Jja5WlvxR6MUX6E2UEYb0lXYDZIX-CVFn2VxeYfHCc40dDk9No="
    }
}
time=2014-12-19T15:32:19.383Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Keystone response retrieving user:

 {
    "token": {
        "issued_at": "2014-12-19T15:32:19.325958Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T16:32:19.325933Z",
        "user": {
            "domain": {
                "id": "e0c0821d8fd14c0faeb4b05c77ceb959",
                "name": "atlantic_only_domain"
            },
            "id": "845bf29553f34538ba316581b3533260",
            "name": "crab_create"
        }
    }
}
time=2014-12-19T15:32:19.385Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=User response from Keystone:
{
    "token": {
        "issued_at": "2014-12-19T15:32:19.325958Z",
        "extras": {},
        "methods": [
            "password"
        ],
        "expires_at": "2014-12-19T16:32:19.325933Z",
        "user": {
            "domain": {
                "id": "e0c0821d8fd14c0faeb4b05c77ceb959",
                "name": "atlantic_only_domain"
            },
            "id": "845bf29553f34538ba316581b3533260",
            "name": "crab_create"
        }
    }
}


time=2014-12-19T15:32:19.387Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Extracting roles for token {
    "url": "http://172.17.0.3:5000/v3/role_assignments",
    "method": "GET",
    "qs": {
        "user.id": "845bf29553f34538ba316581b3533260"
    },
    "headers": {
        "X-Auth-Token": "MIIDgAYJKoZIhvcNAQcCoIIDcTCCA20CAQExCTAHBgUrDgMCGjCCAdYGCSqGSIb3DQEHAaCCAccEggHDeyJ0b2tlbiI6IHsiZG9tYWluIjogeyJpZCI6ICI3MTY5M2QwNWU0ZTI0Yjg3OWZhZmUwZjZiMWU2MjI4NyIsICJuYW1lIjogImFkbWluX2RvbWFpbiJ9LCAibWV0aG9kcyI6IFsicGFzc3dvcmQiXSwgInJvbGVzIjogW3siaWQiOiAiNmU4ZmIyOTE5MzBkNDMyOTk4MDBkNTM3MmZmNThiN2UiLCAibmFtZSI6ICJzZXJ2aWNlIn1dLCAiZXhwaXJlc19hdCI6ICIyMDE0LTEyLTE5VDE2OjI0OjA3LjAwMTQwOVoiLCAiY2F0YWxvZyI6IFtdLCAiZXh0cmFzIjoge30sICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogIjcxNjkzZDA1ZTRlMjRiODc5ZmFmZTBmNmIxZTYyMjg3IiwgIm5hbWUiOiAiYWRtaW5fZG9tYWluIn0sICJpZCI6ICJhZTM3ZjkyN2Y5ZGE0MTE4OWYxMjMwNmMzZTkwY2QzMiIsICJuYW1lIjogInBlcCJ9LCAiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTU6MjQ6MDcuMDAxNDQyWiJ9fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQA5dVGKcMVDNx+GxrH7Tsbyt30y5J13t7Jn51N83e2O0rlVgu2j9wPJ75nF5YWKkkkXamwA1tTpAVVQbb+wegJkYM1LaIyyAhGpehjUBJ+AMagvCi-CO9dmqwxTWANi0aWv3NMxrtQ7lqarFGdUF2Qnonn1rGtfF-B2JO09OJ+zoInTP6ROpUW+rXQsbxojWFlVx-RrGeQ1xcws9PvkLdi8RGAKHXbHEqvJwypz82U5h9OlBTLO5XjZV9QPIsgg+kum0gs9vlpLC3Rzr7XXWcvYdmrBnKI7YqQu8B2jxX5MA82tXqXezyQntdum1n6G93WcozHuJKdFHe81T-1fMbkL"
    }
}
time=2014-12-19T15:32:19.407Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Keystone response retrieving roles:

 "{\"role_assignments\": [{\"scope\": {\"domain\": {\"id\": \"e0c0821d8fd14c0faeb4b05c77ceb959\"}}, \"role\": {\"id\": \"492d161511134e74b7363f787dcbdfc4\"}, \"user\": {\"id\": \"845bf29553f34538ba316581b3533260\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/e0c0821d8fd14c0faeb4b05c77ceb959/users/845bf29553f34538ba316581b3533260/roles/492d161511134e74b7363f787dcbdfc4\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"
time=2014-12-19T15:32:19.407Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Roles response from Keystone:
"{\"role_assignments\": [{\"scope\": {\"domain\": {\"id\": \"e0c0821d8fd14c0faeb4b05c77ceb959\"}}, \"role\": {\"id\": \"492d161511134e74b7363f787dcbdfc4\"}, \"user\": {\"id\": \"845bf29553f34538ba316581b3533260\"}, \"links\": {\"assignment\": \"http://172.17.0.3:5000/v3/domains/e0c0821d8fd14c0faeb4b05c77ceb959/users/845bf29553f34538ba316581b3533260/roles/492d161511134e74b7363f787dcbdfc4\"}}], \"links\": {\"self\": \"http://172.17.0.3:5000/v3/role_assignments\", \"previous\": null, \"next\": null}}"


time=2014-12-19T15:32:19.409Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Creating access request for user [["492d161511134e74b7363f787dcbdfc4"]], with organization [fiware:orion:atlantic_only_domain:/::] and action [create]
time=2014-12-19T15:32:19.410Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Sending access request:
{
    "uri": "http://172.17.0.4:8080/pdp/v3",
    "method": "POST",
    "headers": {
        "Content-Type": "application/xml",
        "Accept": "application/xml",
        "fiware-service": "atlantic_only_domain",
        "fiware-servicepath": "/"
    },
    "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Request xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"\n         ReturnPolicyIdList=\"false\"\n         CombinedDecision=\"false\">\n<!-- user roles identifiers-->\n<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">\n    <Attribute IncludeInResult=\"false\"\n           AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">\n    <AttributeValue\n            DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n            >492d161511134e74b7363f787dcbdfc4</AttributeValue>\n</Attribute>\n</Attributes>\n<!-- fiware resource name being accessed: organization id -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >fiware:orion:atlantic_only_domain:/::</AttributeValue>\n    </Attribute>\n</Attributes>\n<!-- action performed -->\n<Attributes\n        Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">\n    <Attribute IncludeInResult=\"false\"\n               AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">\n        <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"\n                >create</AttributeValue>\n    </Attribute>\n</Attributes>\n</Request>"
}

time=2014-12-19T15:32:19.422Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Request access accepted
time=2014-12-19T15:32:19.422Z | lvl=DEBUG | corr=92879909-9516-42fd-a876-3d2dcdd5336c | trans=92879909-9516-42fd-a876-3d2dcdd5336c | op=/v1/updateContext | msg=Forwarding request:

{"uri":"http://192.168.56.1:1026/v1/updateContext","method":"POST","headers":{"host":"127.0.0.1:1025","accept-encoding":"gzip, deflate","fiware-service":"atlantic_only_domain","fiware-servicepath":"/","accept":"application/xml","user-agent":"python-requests/2.5.0 CPython/2.7.8 Windows/8","connection":"close","x-auth-token":"MIIC6QYJKoZIhvcNAQcCoIIC2jCCAtYCAQExCTAHBgUrDgMCGjCCAT8GCSqGSIb3DQEHAaCCATAEggEseyJ0b2tlbiI6IHsiaXNzdWVkX2F0IjogIjIwMTQtMTItMTlUMTU6MzI6MTkuMzI1OTU4WiIsICJleHRyYXMiOiB7fSwgIm1ldGhvZHMiOiBbInBhc3N3b3JkIl0sICJleHBpcmVzX2F0IjogIjIwMTQtMTItMTlUMTY6MzI6MTkuMzI1OTMzWiIsICJ1c2VyIjogeyJkb21haW4iOiB7ImlkIjogImUwYzA4MjFkOGZkMTRjMGZhZWI0YjA1Yzc3Y2ViOTU5IiwgIm5hbWUiOiAiYXRsYW50aWNfb25seV9kb21haW4ifSwgImlkIjogIjg0NWJmMjk1NTNmMzQ1MzhiYTMxNjU4MWIzNTMzMjYwIiwgIm5hbWUiOiAiY3JhYl9jcmVhdGUifX19MYIBgTCCAX0CAQEwXDBXMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVW5zZXQxDjAMBgNVBAcMBVVuc2V0MQ4wDAYDVQQKDAVVbnNldDEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tAgEBMAcGBSsOAwIaMA0GCSqGSIb3DQEBAQUABIIBAHYqui888Zludq21VCAlOeiNLgnMGKTDjlEwCbXkyH3HzC6gz1+hJ4StXzTJ1dUVUGX+fMZpmpR0N+CEhjjWaHVbRKIG8OTHRaHQ920gP2t7FpdmpJXG8cDxkCjXJoPh5InHxRwrk7RI-jaenXC-pr3JEv+DPo7KC5ug4IKU1a9BR939rK72VG+INYQHBC5DWlhYLdogNBuUacwDF8fiduqnIDgciZzeNP4so1f0Q6n9N8xgwq-AC3Uo+02SHO57CCvapBK6QvLURhlqOGccQeiCpH8XEx6ilgGW2Jja5WlvxR6MUX6E2UEYb0lXYDZIX-CVFn2VxeYfHCc40dDk9No=","content-type":"application/xml","x-forwarded-for":"10.0.2.2"},"body":"{}"}

Use a cache for the project IDs

Currently, each time a request arrives to the server it's subservice UUID is resolved against keystone. This requests should be cached.

Effort: 2 man day

There are urls that PEP not recognize, but are in the doc

Subscribe

  • updateContextSubscription
time=2014-12-12T08:56:46.038Z | lvl=DEBUG | corr=480967b7-b28b-44c0-9bcf-d2bdd34f750c | trans=480967b7-b28b-44c0-9bcf-d2bdd34f750c | op=/v1/updateContextSubscription | msg=Inspecting XML body to discover action:



time=2014-12-12T08:56:46.041Z | lvl=ERROR | corr=480967b7-b28b-44c0-9bcf-d2bdd34f750c | trans=480967b7-b28b-44c0-9bcf-d2bdd34f750c | op=/v1/updateContextSubscription | msg=[ORION-PLUGIN-006] Wrong XML Payload. Parsing error: Unclosed root tag
Line: 0
Column: 0
Char:
time=2014-12-12T08:56:46.042Z | lvl=DEBUG | corr=480967b7-b28b-44c0-9bcf-d2bdd34f750c | trans=480967b7-b28b-44c0-9bcf-d2bdd34f750c | op=/v1/updateContextSubscription | msg=response-time: 4 statusCode: 403
time=2014-12-12T08:56:46.043Z | lvl=ERROR | corr=n/a | trans=n/a | op=n/a | msg=[ORION-PLUGIN-001] Wrong XML Payload. Action not found
WRONG_XML_PAYLOAD: The system wasn't able to parse the given XML payload
time=2014-12-12T08:56:48.456Z | lvl=DEBUG | corr=c7d16c0e-e380-4f97-b883-747c2084b5f5 | trans=c7d16c0e-e380-4f97-b883-747c2084b5f5 | op=/v1/updateContextSubscription | msg=Inspecting JSON body to discover action:
{}


time=2014-12-12T08:56:48.457Z | lvl=ERROR | corr=c7d16c0e-e380-4f97-b883-747c2084b5f5 | trans=c7d16c0e-e380-4f97-b883-747c2084b5f5 | op=/v1/updateContextSubscription | msg=[ORION-PLUGIN-003] Wrong JSON Payload: updateAction element not found
time=2014-12-12T08:56:48.459Z | lvl=DEBUG | corr=c7d16c0e-e380-4f97-b883-747c2084b5f5 | trans=c7d16c0e-e380-4f97-b883-747c2084b5f5 | op=/v1/updateContextSubscription | msg=response-time: 3 statusCode: 403
  • unsubscribeContext
time=2014-12-12T08:56:51.065Z | lvl=DEBUG | corr=cc63648c-d3c9-4981-96dc-236b2b2f451d | trans=cc63648c-d3c9-4981-96dc-236b2b2f451d | op=/v1/unsubscribeContext | msg=Extracting action from the URL "/v1/unsubscribeContext"
time=2014-12-12T08:56:51.065Z | lvl=ERROR | corr=cc63648c-d3c9-4981-96dc-236b2b2f451d | trans=cc63648c-d3c9-4981-96dc-236b2b2f451d | op=/v1/unsubscribeContext | msg=[ORION-PLUGIN-005] Action not found
time=2014-12-12T08:56:51.067Z | lvl=DEBUG | corr=cc63648c-d3c9-4981-96dc-236b2b2f451d | trans=cc63648c-d3c9-4981-96dc-236b2b2f451d | op=/v1/unsubscribeContext | msg=response-time: 3 statusCode: 403
time=2014-12-12T08:56:53.359Z | lvl=DEBUG | corr=a7edb72f-c339-413f-baa4-b69070b7a4c1 | trans=a7edb72f-c339-413f-baa4-b69070b7a4c1 | op=/v1/unsubscribeContext | msg=Extracting action from the URL "/v1/unsubscribeContext"
time=2014-12-12T08:56:53.359Z | lvl=ERROR | corr=a7edb72f-c339-413f-baa4-b69070b7a4c1 | trans=a7edb72f-c339-413f-baa4-b69070b7a4c1 | op=/v1/unsubscribeContext | msg=[ORION-PLUGIN-005] Action not found
time=2014-12-12T08:56:53.361Z | lvl=DEBUG | corr=a7edb72f-c339-413f-baa4-b69070b7a4c1 | trans=a7edb72f-c339-413f-baa4-b69070b7a4c1 | op=/v1/unsubscribeContext | msg=response-time: 1 statusCode: 403

subscribe-availability

  • updateContextAvailabilitySubscription
time=2014-12-12T09:14:14.953Z | lvl=DEBUG | corr=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | trans=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | op=/v1/updateContextAvailabilitySubscription | msg=Inspecting XML body to discover action:



time=2014-12-12T09:14:14.955Z | lvl=ERROR | corr=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | trans=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | op=/v1/updateContextAvailabilitySubscription | msg=[ORION-PLUGIN-006] Wrong XML Payload. Parsing error: Unclosed root tag
Line: 0
Column: 0
Char:
time=2014-12-12T09:14:14.956Z | lvl=DEBUG | corr=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | trans=88b8c445-b2fa-41cb-8bb4-68de4ad4bbb3 | op=/v1/updateContextAvailabilitySubscription | msg=response-time: 3 statusCode: 403
time=2014-12-12T09:14:14.956Z | lvl=ERROR | corr=n/a | trans=n/a | op=n/a | msg=[ORION-PLUGIN-001] Wrong XML Payload. Action not found
WRONG_XML_PAYLOAD: The system wasn't able to parse the given XML payload
time=2014-12-12T09:14:17.273Z | lvl=DEBUG | corr=5cf45b82-25c7-438a-a306-ec8bfee88880 | trans=5cf45b82-25c7-438a-a306-ec8bfee88880 | op=/v1/updateContextAvailabilitySubscription | msg=Inspecting JSON body to discover action:
{}


time=2014-12-12T09:14:17.274Z | lvl=ERROR | corr=5cf45b82-25c7-438a-a306-ec8bfee88880 | trans=5cf45b82-25c7-438a-a306-ec8bfee88880 | op=/v1/updateContextAvailabilitySubscription | msg=[ORION-PLUGIN-003] Wrong JSON Payload: updateAction element not found
time=2014-12-12T09:14:17.275Z | lvl=DEBUG | corr=5cf45b82-25c7-438a-a306-ec8bfee88880 | trans=5cf45b82-25c7-438a-a306-ec8bfee88880 | op=/v1/updateContextAvailabilitySubscription | msg=response-time: 1 statusCode: 403

  • unsubscribeContextAvailability
time=2014-12-12T09:14:19.607Z | lvl=DEBUG | corr=908d9c68-0518-49dc-b7a1-dec05da5409c | trans=908d9c68-0518-49dc-b7a1-dec05da5409c | op=/v1/unsubscribeContextAvailability | msg=Extracting action from the URL "/v1/unsubscribeContextAvailability"
time=2014-12-12T09:14:19.608Z | lvl=ERROR | corr=908d9c68-0518-49dc-b7a1-dec05da5409c | trans=908d9c68-0518-49dc-b7a1-dec05da5409c | op=/v1/unsubscribeContextAvailability | msg=[ORION-PLUGIN-005] Action not found
time=2014-12-12T09:14:19.608Z | lvl=DEBUG | corr=908d9c68-0518-49dc-b7a1-dec05da5409c | trans=908d9c68-0518-49dc-b7a1-dec05da5409c | op=/v1/unsubscribeContextAvailability | msg=response-time: 1 statusCode: 403
time=2014-12-12T09:14:22.171Z | lvl=DEBUG | corr=6c1a4e86-03bf-4e02-b080-521980af933f | trans=6c1a4e86-03bf-4e02-b080-521980af933f | op=/v1/unsubscribeContextAvailability | msg=Extracting action from the URL "/v1/unsubscribeContextAvailability"
time=2014-12-12T09:14:22.172Z | lvl=ERROR | corr=6c1a4e86-03bf-4e02-b080-521980af933f | trans=6c1a4e86-03bf-4e02-b080-521980af933f | op=/v1/unsubscribeContextAvailability | msg=[ORION-PLUGIN-005] Action not found
time=2014-12-12T09:14:22.173Z | lvl=DEBUG | corr=6c1a4e86-03bf-4e02-b080-521980af933f | trans=6c1a4e86-03bf-4e02-b080-521980af933f | op=/v1/unsubscribeContextAvailability | msg=response-time: 3 statusCode: 403

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.