International-Data-Spaces-Association / omejdn-daps

Open Source implementation of the Dynamic Attribute Provisioning Service based on http://github.com/Fraunhofer-AISEC/omejdn-server
Apache License 2.0
7 stars 10 forks source link

Error running the test.sh #9

Closed arnabghosh3654 closed 2 years ago

arnabghosh3654 commented 3 years ago

Describe the bug Error on running the test.sh script

To Reproduce I tried to run the server and the test script. So, I followed the documentation. First cloned the server and downloaded the submodule. Thereafter, followed the following steps:

  1. Created certificates for the DAPS.

  2. Added a sample connector to the clients.yml file: Command used:./scripts/register_connector.sh sampleconnector>>config/clients.yml This was a success. Client.yml file contents:

    - client_id: 54:A9:2D:CE:13:83:39:41:FC:9B:9C:6D:8F:1C:E1:94:0F:7F:97:06:keyid:54:A9:2D:CE:13:83:39:41:FC:9B:9C:6D:8F:1C:E1:94:0F:7F:97:06
    name: sampleconnector
    redirect_uri: 
    allowed_scopes:
    - idsc:IDS_CONNECTOR_ATTRIBUTES_ALL
    attributes:
    - key: securityProfile
    value: idsc:BASE_SECURITY_PROFILE
    - key: referringConnector
    value: http://sampleconnector.demo
    - key: "@type"
    value: ids:DatPayload
    - key: "@context"
    value: https://w3id.org/idsa/contexts/context.jsonld
    - key: transportCertsSha256
    value: 4de2d6679fc06d10840e85a17cf48333b7faa4b95b4b5b23ecdad85729b7fd7e
    import_certfile: keys/sampleconnector.cert
  3. Deleted the keys and config folder from the omejdn-server folder. Then copied the keys and config folder from this folder to the omejdn-server folder.

  4. Ran bundle install and started the server using ruby omejdn.rb

  5. Tried to run the test script: ./scripts/test.sh sampleconnector

Expected behavior The DAPS token should have been output

Error Output of the command:

Found client 54:A9:2D:CE:13:83:39:41:FC:9B:9C:6D:8F:1C:E1:94:0F:7F:97:06:keyid:54:A9:2D:CE:13:83:39:41:FC:9B:9C:6D:8F:1C:E1:94:0F:7F:97:06
parse error: Invalid numeric literal at line 1, column 9
Here is the DAT Header:
Here is the DAT Body:

Output log on DAPS server side:

2021-11-21 20:12:54 - Psych::SyntaxError - (<unknown>): mapping values are not allowed in this context at line 19 column 73:
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:456:in `parse'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:456:in `parse_stream'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:390:in `parse'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:349:in `safe_load'
        /home/arnab/newDAPS/omejdn-server/lib/config.rb:23:in `client_config'
        /home/arnab/newDAPS/omejdn-server/lib/client.rb:26:in `load_clients'
        /home/arnab/newDAPS/omejdn-server/lib/client.rb:62:in `find_by_jwt'
        omejdn.rb:162:in `block in <main>'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/logger.rb:17:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/common_logger.rb:38:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:253:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:246:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:86:in `block in pre_process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:84:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:84:in `pre_process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:50:in `block in process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:1077:in `block in spawn_threadpool'
2021-11-21 20:12:54 -0500 Unexpected error while processing request: (<unknown>): mapping values are not allowed in this context at line 19 column 73
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:456:in `parse'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:456:in `parse_stream'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:390:in `parse'
        /home/arnab/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/psych.rb:349:in `safe_load'
        /home/arnab/newDAPS/omejdn-server/lib/config.rb:23:in `client_config'
        /home/arnab/newDAPS/omejdn-server/lib/client.rb:26:in `load_clients'
        /home/arnab/newDAPS/omejdn-server/lib/client.rb:62:in `find_by_jwt'
        omejdn.rb:162:in `block in <main>'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/logger.rb:17:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/common_logger.rb:38:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:253:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:246:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:86:in `block in pre_process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:84:in `catch'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:84:in `pre_process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/thin-1.8.1/lib/thin/connection.rb:50:in `block in process'
        /home/arnab/.rvm/gems/ruby-2.7.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:1077:in `block in spawn_threadpool'

OS and version Ubuntu 16.04 Xenial

bellebaum commented 2 years ago

Thanks for your issue. There appears to be some problem with clients.yml. Are you sure you have provided the entire file? The parser indicates an error on line 19, but you have only provided 17 lines.

bellebaum commented 2 years ago

Due to inactivity, I will assume the problem to be resolved and close this issue. Feel free to reopen, should the problem persist