Closed nichtich closed 3 years ago
I see your point. There are several different issues here though:
/status
./status
, we don't need to assume any another values. But /status
itself has to be assumed if only api
is given.What do you think?
A solved my use case for this issue by putting jskos-server instance behind a proxy so I could change endpoint base URIs. We could document the current behavior:
api
is given. Explicitly disable an endpoint by setting an it to undef
(not tested, should solve #20)status
endpoint is set (explicitly or implicitly via api
) it's return value will override all endpoints.That's a good solution. Would you be opposed to using null
instead of undefined
for explicitly disabling an endpoint? It's much easier to check: status.type === null
vs status.hasOwnProperty("type") && status.type === undefined
.
Nevermind null
!
So, it is now implemented this way:
null
).
undefined
will be set with the result of the status endpoint.undefined
will be implicitly set if the api
key is given.Also, if the request to /status
returns explicitly with a 404 error (i.e. it's not a network issue or some other server issue), we'll define that status endpoint as null
.
Together with https://github.com/gbv/jskos-server/issues/119, this should now work as expected.
We could change one more thing @nichtich, if you want: If the request to /status
was successful, even endpoints that are not explicitly set to null
will not be assumed to be there, considering that the server should know best which endpoints exist. What do you think?
This makes a lot of sense
I forgot to implement this because the issue was closed, oops. Will ship a 1.0.1 tomorrow.
Given a configuration
The
schemes
endpoint will be ignored but overridden by what is returned by/status
endpoint.I think this and #20 could be solved by filling
this._api
only after initialization with values from/status
in_setup
instead of_prepare
.