linagora / jmap-client-ts

JMAP 1.0 client library in TypeScript
MIT License
39 stars 16 forks source link

Configure test James to provide correct API URLs #66

Open alagane opened 2 years ago

alagane commented 2 years ago

When I run tests, I don't want to use the overridden...Url parameter on jmap-client-ts, the only configurable URL for the client should be the session one, and other URLs are provided by the session.

Since the docker has a dynamic port, the URL is not know before the container is started.

It seems that those URLs are defined in jmap.properties file (see https://james.apache.org/server/config-jmap.html)

Does James support setting those URLs after is is started? With the file? With some commands?

If this is not possible, we can try to set up a proxy to redirect to James, setting proxy destination after it is started, but the proxy should have a constant URL?

qyb commented 2 years ago

What do you think about my solution of using X-JMAP-PREFIX and X-JMAP-WEBSOCKET-PREFIX in fetchSession?

chibenwa commented 2 years ago

Isn't the use of X-JMAP-PREFIX enough?

https://github.com/linagora/jmap-client-ts/pull/65/commits/3617897e96cab1044a19ed91278cfc4f15360868

alagane commented 2 years ago

What do you think about my solution of using X-JMAP-PREFIX and X-JMAP-WEBSOCKET-PREFIX in fetchSession?

Isn't the use of X-JMAP-PREFIX enough?

3617897

Ok, I did not understand how X-JMAP-PREFIX worked, but this seems to be the solution yes.