Git Product home page Git Product logo

ega-data-api's People

Contributors

amgadhanafy avatar anandmohan777 avatar blankdots avatar dtitov avatar jbygdell avatar juhtornr avatar nanjiangshu avatar omllobet avatar silverdaz avatar viklund avatar

Watchers

 avatar  avatar  avatar

ega-data-api's Issues

Review log messages and have more meaningful messages

Description

Review existing log messages in order to have better and more meaningful messages for debugging and production monitoring.

Such logs are not ok:

log.info("NO!!");

Definition of Done

Logs have information that is meaningful for debugging and monitoring purposes.

How to test

Peer review, Unit tests log output.

Enabling HTTP endpoint

Description

We need to have the option to enable HTTP or HTTPS traffic between services.
DataEdge and RES are the main ones.

Definition of Done

We need to see the changes and add an option to enable HTTP or HTTPS, We can work with profiles in JAVA.

How to test

Integration tests pass for both HTTP and HTTPS

Show elixir user id in the logs when a download happens

Expected Behavior

We want to process ELIXIR AAI JWT tokens that contain the user information in the sub claim. The minimal information needed currently in a token is:

{
  "sub": "<user_id_hash>@elixir-europe.org",
  "authorities": [
    "EGAD00010000919"
  ]
}

We want to have logs that contain that information:

User [email protected] attempt successfully to download file DownloadEntry [downloadLogId=0, clientIp=172.23.0.1, server=file, [email protected], fileId=EGAF00000000014, downloadSpeed=0.005708738814952762, downloadStatus=success, encryptionType=plain, startCoordinate=0, endCoordinate=0, bytes=1287, created=2019-10-17 05:35:22.152, TokenSource=EGA]

Current Behavior

Dataedge accepts JWT tokens but can only read the user only from tokens that are formated as:

{
  "user_name": "<user_id_hash>@elixir-europe.org",
  "authorities": [
    "EGAD00010000919"
  ]
}

When using sub instead of user_name we get no user in the logs:

User  attempt successfully to download file DownloadEntry [downloadLogId=0, clientIp=172.23.0.1, server=file, email=, fileId=EGAF00000000014, downloadSpeed=0.005267720365728943, downloadStatus=success, encryptionType=plain, startCoordinate=0, endCoordinate=0, bytes=1287, created=2019-10-17 06:11:09.613, TokenSource=EGA]

Notice the user is null

Possible Solution

These lines should override the default parameter:
https://github.com/neicnordic/ega-data-api/blob/master/ega-data-api-dataedge/src/main/java/eu/elixir/ega/ebi/dataedge/config/MyUserAuthenticationConverter.java#L43-L44

but changing it to it does not yeild any result.
So the issue must be somewhere else ๐Ÿ˜ž

Steps to Reproduce

  1. see integration tests
    or
  2. build images
    • docker build -t ega-data-api/ega-dataedge --file Dockerfile.dataedge .
    • docker build -t ega-data-api/ega-res --file Dockerfile.res .
    • docker build -t ega-data-api/ega-keyserver --file Dockerfile.keyserver .
    • docker build -t ega-data-api/ega-filedatabase --file Dockerfile.filedatabase .
    • docker build -t ega-data-api/ega-postgres --file extras/postgresdb/Dockerfile .
  3. cd extras && source ./variables.sh
  4. docker-compose up -d
  5. export TOKEN=<give_token>
  6. curl -k -vvvv -H "Authorization: Bearer $TOKEN" "https://localhost:9058/files/EGAF00000000014"

Context (Environment)

Logging needs to be in place.

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.