fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

fluree/server support for `application/jwt` content type #92

Closed Jackamus29 closed 2 months ago

Jackamus29 commented 4 months ago

Description

When sending a JWT to fluree/server with a Content-Type header value of application/jwt, an error response is returned rather than correctly handing the request as expected.

Steps to reproduce

  1. With fluree/server running locally on port 58090, issue the following curl request:
    curl -H "Content-Type: application/jwt" -d "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19.eyJ3aGVyZSI6eyJAaWQiOiI_dXNlcnMiLCJAdHlwZSI6InR5cGVzOlVzZXIifSwic2VsZWN0Ijp7Ij91c2VycyI6WyIqIl19LCJmcm9tIjoic2lnbmVkLW1lc3NhZ2VzIiwiQGNvbnRleHQiOnsiZiI6Imh0dHBzOi8vbnMuZmx1ci5lZS9sZWRnZXIjIiwiZXgiOiJodHRwOi8vZXhhbXBsZS5vcmcvIiwidXNlcnMiOiJodHRwOi8vZXhhbXBsZS5vcmcvdXNlcnMvIiwidHlwZXMiOiJodHRwOi8vZXhhbXBsZS5vcmcvdHlwZXMvIiwicHJvcHMiOiJodHRwOi8vZXhhbXBsZS5vcmcvcHJvcHMvIn19.MWMzMDQ1MDIyMTAwY2JkMzJlNDYzNTY3ZmVmYzJmMTIwNDI1YjAyMjRkOWQyNjMwMDg5MTE2NTNmNTBlODM5NTNmNDdjZmJlZjNiYzAyMjAwYWQ4MWNlZWYxMzUxY2EyYTk2OTNhYmJhMmFhMTkxYWZhOTNlMjA4MjgyZWZmOWM2ZGMwYzgyN2YyM2MwMzZi" localhost:58091/fluree/query
  2. Observe the error response:
    {"error":"db/invalid-query","message":"should be a map"}
Jackamus29 commented 3 months ago

Hey @dpetran! I'm going to go ahead and assign this one to you and move it up in the backlog so it doesn't get forgotten. Deploying JWT support in Nexus depends on this ticket as we want to also update the fluree-client js package to use this Content-Type for both Nexus and fluree/server. Thanks!