You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "ronnieroyston (via GitHub)" <gi...@apache.org> on 2023/06/29 04:46:33 UTC

[GitHub] [couchdb] ronnieroyston opened a new issue, #4655: Configuring [jwt_keys] via HTTP PUT Fails

ronnieroyston opened a new issue, #4655:
URL: https://github.com/apache/couchdb/issues/4655

   [Documentation says](https://docs.couchdb.org/en/stable/api/server/configuration.html#put--_node-node-name-_config-section-key):
   
   `PUT /_node/{node-name}/_config/{section}/{key}`
   Updates a configuration value. The new value should be supplied in the request body in the corresponding JSON format. If you are setting a string value, you must supply a valid JSON string. In response CouchDB sends old value for target section key.
   
   ## Description
   
   It don't work. CouchDB replies:
   ```
     "error": "bad_request",
     "reason": "invalid UTF-8 JSON"
   ```
   
   ## Steps to Reproduce
   
   http://localhost:5984/_node/_local/_config/jwt_keys/HS256%3A_default
   
   with body (it's all one single line):
   
   "HS256:_default = -----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhGWT7NHnP/grbzDxmZf/\ndeA+W1pnmcXhr5T3/nt8jhg8mF/hRs6ueIlFSXXXJB5bR8qHB9NPNxLorfDVADD7\nQ3xxxxxxxxxxxxxxxxxxxxxxxxxXrbztF460w\nYTUszEdyeeDykqPM8MLGvJIr5MEFgj12ak3vn2ZlXu4tv74pq62gHkNZ6HA+45Pd\nbl/2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+iolwg0za\nbFRY6KEmKJCDeqZtBenvWn85eUjwWYb/Kr2Au9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAB\n-----END PUBLIC KEY-----"
   
   ## Expected Behaviour
   
   It is supposed to configure this key.
   
   ## Your Environment
   
   Containerized Couch :latest w Chrome
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] big-r81 commented on issue #4655: Configuring [jwt_keys] via HTTP PUT Fails

Posted by "big-r81 (via GitHub)" <gi...@apache.org>.
big-r81 commented on issue #4655:
URL: https://github.com/apache/couchdb/issues/4655#issuecomment-1616640123

   Hi,
   
   you send only the value in the body as JSON string. You will need to double-escape the `\n`.
   
   Example:
   ```
   curl -X PUT "http://a:a@127.0.0.1:15984/_node/_local/_config/jwt_keys/hmac:testkey" -d '"-----BEGIN PUBLIC KEY-----\\nMIIBIjAN....DAQAB\\n-----END PUBLIC KEY-----\\n"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] ronnieroyston commented on issue #4655: Configuring [jwt_keys] via HTTP PUT Fails

Posted by "ronnieroyston (via GitHub)" <gi...@apache.org>.
ronnieroyston commented on issue #4655:
URL: https://github.com/apache/couchdb/issues/4655#issuecomment-1616761391

   > You will need to double-escape the `\n`.
   
   I have not come across that one before. Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] ronnieroyston closed issue #4655: Configuring [jwt_keys] via HTTP PUT Fails

Posted by "ronnieroyston (via GitHub)" <gi...@apache.org>.
ronnieroyston closed issue #4655: Configuring [jwt_keys] via HTTP PUT Fails
URL: https://github.com/apache/couchdb/issues/4655


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org