On Mon, Apr 25, 2022 at 9:40 AM Sergey Beryozkin <
sbia...@redhat.com> wrote:
> On Mon, Apr 25, 2022 at 3:27 PM David Lloyd <
david...@redhat.com> wrote:
>> On Mon, Apr 25, 2022 at 9:15 AM Sergey Beryozkin <
sbia...@redhat.com> wrote:
>> > However, we can have many extensions with some extension specific paths, so I wonder should it really be a user's responsibility to have
>> >
>> > 1) `${quarkus.http.root-path:""}/some-extension-path` in `application.properties` instead of 2) every extension prepending ${quarkus.http.root-path} to `some-extension-path` when checking if the current request matches this `some-extension-path`.
>>
>> Do we really require users to do this manually? Doesn't each extension
>> already provide this kind of info as default configuration values when
>> that extension is enabled?
>>
> Do you mean, that for example, when a user configures `quarkus.oidc.logout.logout-path=/logout` and `quarkus.http.root-path=/root`
>
> then what the extension (in this case, quarkus-oidc) sees, when checking `quarkus.oidc.logout.logout-path`, is `/root/logout` ?
Not exactly, I was thinking more that maybe (in this particular case
at least) the extension could have a default logout path already which
might or might not be enabled separately from the configuration
property that specifies the path.
> It is not the case at the moment as far as I know. So I started with updating some of Quarkus Security code (as per my earlier message) but I'm not sure if it is the right way to continue;
>
> I think I see your point though, expecting users to prepend `${quarkus.http.root-path:""}/some-extension-path` is not convenient for the users...
Yeah, but at the same time it's hard to think of another solution that
doesn't introduce an inconsistency or problem somewhere else. Having
the prepended property is the most flexible because then the user can
put the path somewhere outside of the `root-path`.
That said, maybe another indirection would be better, e.g.:
quarkus.oidc.root-path=${quarkus.http.root-path:"/"} # this would
be the default so the user doesn't have to specify
quarkus.oidc.logout.logout-path=logout # `quarkus.oidc.root-path`
is prepended to this
Then if the user wants to escape the `http.root-path` or use a
sub-path of that path only for OIDC, they can do so, and they also
don't have to add a property expression. The downside is that it is
another property to configure, slightly more complexity, etc.
--
- DML • he/him