You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Konrad Windszus <ko...@gmx.de> on 2018/09/06 15:42:32 UTC
Package extraction of package with hook only as admin (even
dry-runs)?
Hi,
currently in https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L185 <https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L185> the extract method fails in case the package contains a hook and the installing user is not an admin user.
That leads to problems, whenever you do some package operations with service users (like e.g. is the case reported in https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1478 <https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1478>).
What is the reason, why only admin users are supposed to install or even dry run packages containing hooks?
I think dry-runs in combination with a listener are the best (only?) way to recursively figure out, which nodes are covered by a package. Those dry-runs shouldn't require an admin session IMHO.
WDYT?
Thanks,
Konrad
Re: Package extraction of package with hook only as admin (even
dry-runs)?
Posted by Konrad Windszus <ko...@gmx.de>.
Actually my observation is not quite correct. Due to https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L181 <https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L181> hooks are only registered in case you don't do a dry-run. In my case it was in fact a package which had the require-admin flag set. In that case it it probably ok to require an admin session even for the dry-run.
Konrad
> On 6. Sep 2018, at 17:42, Konrad Windszus <ko...@gmx.de> wrote:
>
> Hi,
> currently in https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L185 <https://github.com/apache/jackrabbit-filevault/blob/a39917d0088f84f9491eceac90cb0f15b250ec2f/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/ZipVaultPackage.java#L185> the extract method fails in case the package contains a hook and the installing user is not an admin user.
>
> That leads to problems, whenever you do some package operations with service users (like e.g. is the case reported in https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1478 <https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1478>).
> What is the reason, why only admin users are supposed to install or even dry run packages containing hooks?
>
> I think dry-runs in combination with a listener are the best (only?) way to recursively figure out, which nodes are covered by a package. Those dry-runs shouldn't require an admin session IMHO.
>
> WDYT?
> Thanks,
> Konrad
>