You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Nicolas Peltier <pe...@gmail.com> on 2019/09/27 15:47:28 UTC
[caconfig] is allow read for everyone on /conf node ok?
Hey
realized on applications using caconfig that if you had read right only on
/conf/<child>, and not on /conf, each (unsucessfull) lookup ended up in a
quiet AccessDeniedException at jackrabbit level, ending up in a null return
value.
It "works", but still under performs (exceptions are expensive at that
intensity). I think that in our context, we can set read rights on /conf,
but i wonder if we shouldn't have "conf roots" for ca configs, or "root
depth" whose lookup is done before reaching JCR.
wdyt?
Nicolas
Re: [caconfig] is allow read for everyone on /conf node ok?
Posted by Robert Munteanu <ro...@apache.org>.
Thanks, Nicolas! I commented on the PR.
Robert
On Thu, 2019-10-03 at 16:01 +0200, Nicolas Peltier wrote:
> Thanks for the link, Robert! did use getItemOrNull too for getParent
> in
> https://issues.apache.org/jira/browse/SLING-8761
> (https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/5
> )
>
> tell me what you think
>
> Le mer. 2 oct. 2019 à 22:51, Robert Munteanu <ro...@apache.org> a
> écrit :
>
> > On Wed, 2019-10-02 at 18:47 +0200, Nicolas Peltier wrote:
> > > I would love this! i'm sure that ca config is not the only one to
> > > use
> > > getParent() and its null return value though, and wonder if it is
> > > "ok" to
> > > mask that potential AccessDeniedException to the developer that
> > > will
> > > make
> > > use of it without knowledge of its cost.
> >
> > What I was speaking of is
> >
> > https://github.com/apache/sling-org-apache-sling-jcr-resource/commit/f03954d
> > . Not sure if it applies to your scenario, probably. If you can see
> > a
> > way we can optimise this kind of access, I'd love to hear about it.
> >
> > Thanks,
> > Robert
> >
> > > Le mar. 1 oct. 2019 à 16:06, Robert Munteanu <ro...@apache.org>
> > > a
> > > écrit :
> > >
> > > > Hi,
> > > >
> > > > On Fri, 2019-09-27 at 17:47 +0200, Nicolas Peltier wrote:
> > > > > Hey
> > > > >
> > > > > realized on applications using caconfig that if you had read
> > > > > right
> > > > > only on
> > > > > /conf/<child>, and not on /conf, each (unsucessfull) lookup
> > > > > ended
> > > > > up
> > > > > in a
> > > > > quiet AccessDeniedException at jackrabbit level, ending up in
> > > > > a
> > > > > null
> > > > > return
> > > > > value.
> > > > > It "works", but still under performs (exceptions are
> > > > > expensive at
> > > > > that
> > > > > intensity). I think that in our context, we can set read
> > > > > rights
> > > > > on
> > > > > /conf,
> > > > > but i wonder if we shouldn't have "conf roots" for ca
> > > > > configs, or
> > > > > "root
> > > > > depth" whose lookup is done before reaching JCR.
> > > > > wdyt?
> > > >
> > > > I seem to recall that at some point we had a way of accessing
> > > > resources
> > > > without getting exceptions, just null back in case of problems.
> > > > I
> > > > don't
> > > > recall the specifics, but maybe this API can be used for the
> > > > caconfig
> > > > as well?
> > > >
> > > > Thanks,
> > > > Robert
> > > >
> > > >
Re: [caconfig] is allow read for everyone on /conf node ok?
Posted by Nicolas Peltier <pe...@gmail.com>.
Thanks for the link, Robert! did use getItemOrNull too for getParent in
https://issues.apache.org/jira/browse/SLING-8761
(https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/5)
tell me what you think
Le mer. 2 oct. 2019 à 22:51, Robert Munteanu <ro...@apache.org> a écrit :
> On Wed, 2019-10-02 at 18:47 +0200, Nicolas Peltier wrote:
> > I would love this! i'm sure that ca config is not the only one to use
> > getParent() and its null return value though, and wonder if it is
> > "ok" to
> > mask that potential AccessDeniedException to the developer that will
> > make
> > use of it without knowledge of its cost.
>
> What I was speaking of is
>
> https://github.com/apache/sling-org-apache-sling-jcr-resource/commit/f03954d
> . Not sure if it applies to your scenario, probably. If you can see a
> way we can optimise this kind of access, I'd love to hear about it.
>
> Thanks,
> Robert
>
> >
> > Le mar. 1 oct. 2019 à 16:06, Robert Munteanu <ro...@apache.org> a
> > écrit :
> >
> > > Hi,
> > >
> > > On Fri, 2019-09-27 at 17:47 +0200, Nicolas Peltier wrote:
> > > > Hey
> > > >
> > > > realized on applications using caconfig that if you had read
> > > > right
> > > > only on
> > > > /conf/<child>, and not on /conf, each (unsucessfull) lookup ended
> > > > up
> > > > in a
> > > > quiet AccessDeniedException at jackrabbit level, ending up in a
> > > > null
> > > > return
> > > > value.
> > > > It "works", but still under performs (exceptions are expensive at
> > > > that
> > > > intensity). I think that in our context, we can set read rights
> > > > on
> > > > /conf,
> > > > but i wonder if we shouldn't have "conf roots" for ca configs, or
> > > > "root
> > > > depth" whose lookup is done before reaching JCR.
> > > > wdyt?
> > >
> > > I seem to recall that at some point we had a way of accessing
> > > resources
> > > without getting exceptions, just null back in case of problems. I
> > > don't
> > > recall the specifics, but maybe this API can be used for the
> > > caconfig
> > > as well?
> > >
> > > Thanks,
> > > Robert
> > >
> > >
>
>
Re: [caconfig] is allow read for everyone on /conf node ok?
Posted by Robert Munteanu <ro...@apache.org>.
On Wed, 2019-10-02 at 18:47 +0200, Nicolas Peltier wrote:
> I would love this! i'm sure that ca config is not the only one to use
> getParent() and its null return value though, and wonder if it is
> "ok" to
> mask that potential AccessDeniedException to the developer that will
> make
> use of it without knowledge of its cost.
What I was speaking of is
https://github.com/apache/sling-org-apache-sling-jcr-resource/commit/f03954d
. Not sure if it applies to your scenario, probably. If you can see a
way we can optimise this kind of access, I'd love to hear about it.
Thanks,
Robert
>
> Le mar. 1 oct. 2019 à 16:06, Robert Munteanu <ro...@apache.org> a
> écrit :
>
> > Hi,
> >
> > On Fri, 2019-09-27 at 17:47 +0200, Nicolas Peltier wrote:
> > > Hey
> > >
> > > realized on applications using caconfig that if you had read
> > > right
> > > only on
> > > /conf/<child>, and not on /conf, each (unsucessfull) lookup ended
> > > up
> > > in a
> > > quiet AccessDeniedException at jackrabbit level, ending up in a
> > > null
> > > return
> > > value.
> > > It "works", but still under performs (exceptions are expensive at
> > > that
> > > intensity). I think that in our context, we can set read rights
> > > on
> > > /conf,
> > > but i wonder if we shouldn't have "conf roots" for ca configs, or
> > > "root
> > > depth" whose lookup is done before reaching JCR.
> > > wdyt?
> >
> > I seem to recall that at some point we had a way of accessing
> > resources
> > without getting exceptions, just null back in case of problems. I
> > don't
> > recall the specifics, but maybe this API can be used for the
> > caconfig
> > as well?
> >
> > Thanks,
> > Robert
> >
> >
Re: [caconfig] is allow read for everyone on /conf node ok?
Posted by Nicolas Peltier <np...@apache.org>.
I would love this! i'm sure that ca config is not the only one to use
getParent() and its null return value though, and wonder if it is "ok" to
mask that potential AccessDeniedException to the developer that will make
use of it without knowledge of its cost.
Le mar. 1 oct. 2019 à 16:06, Robert Munteanu <ro...@apache.org> a écrit :
> Hi,
>
> On Fri, 2019-09-27 at 17:47 +0200, Nicolas Peltier wrote:
> > Hey
> >
> > realized on applications using caconfig that if you had read right
> > only on
> > /conf/<child>, and not on /conf, each (unsucessfull) lookup ended up
> > in a
> > quiet AccessDeniedException at jackrabbit level, ending up in a null
> > return
> > value.
> > It "works", but still under performs (exceptions are expensive at
> > that
> > intensity). I think that in our context, we can set read rights on
> > /conf,
> > but i wonder if we shouldn't have "conf roots" for ca configs, or
> > "root
> > depth" whose lookup is done before reaching JCR.
> > wdyt?
>
> I seem to recall that at some point we had a way of accessing resources
> without getting exceptions, just null back in case of problems. I don't
> recall the specifics, but maybe this API can be used for the caconfig
> as well?
>
> Thanks,
> Robert
>
>
Re: [caconfig] is allow read for everyone on /conf node ok?
Posted by Robert Munteanu <ro...@apache.org>.
Hi,
On Fri, 2019-09-27 at 17:47 +0200, Nicolas Peltier wrote:
> Hey
>
> realized on applications using caconfig that if you had read right
> only on
> /conf/<child>, and not on /conf, each (unsucessfull) lookup ended up
> in a
> quiet AccessDeniedException at jackrabbit level, ending up in a null
> return
> value.
> It "works", but still under performs (exceptions are expensive at
> that
> intensity). I think that in our context, we can set read rights on
> /conf,
> but i wonder if we shouldn't have "conf roots" for ca configs, or
> "root
> depth" whose lookup is done before reaching JCR.
> wdyt?
I seem to recall that at some point we had a way of accessing resources
without getting exceptions, just null back in case of problems. I don't
recall the specifics, but maybe this API can be used for the caconfig
as well?
Thanks,
Robert