Re: [security] new use case for a checkPermission API

2020-08-07 Thread Nicolas Peltier
here you are [3], it is not merged in as it still break some unit tests
right now

[3]
https://github.com/npeltier/sling-org-apache-sling-pipes/commit/72d0c2bed3d7a7e31de6e4d6a90b815837ab0009#diff-3e9bcd2a44e6dc255a6d8c3cc17adddaR164-R171

Le ven. 7 août 2020 à 10:50, Nicolas Peltier  a
écrit :

> i was planning to make the API internal for 4.0, and use the outside one
> later, so no change to the API surface.
>
> Le ven. 7 août 2020 à 10:41, Oliver Lietz  a
> écrit :
>
>> On Friday, August 7, 2020 9:15:10 AM CEST Bertrand Delacretaz wrote:
>> > On Fri, Aug 7, 2020 at 9:14 AM Nicolas Peltier
>> >
>> >  wrote:
>> > > ...Assuming we are good to go, should I use an internal API for now in
>> > > pipes, and we discuss around moving it to a bundle later?...
>> >
>> > I think that's a good starting point.
>>
>> Nicolas, are you in hurry to get Pipes 4.0 out soon? I guess adding and
>> switching the check requires (again) a major version.
>>
>> Regards,
>> O.
>>
>>
>> > -Bertrand
>>
>>
>>
>>
>>


Re: Sling Starter switched to the Feature Model

2020-08-07 Thread Eric Norman
Hi Robert,

I think I stumbled upon a regression with the changes done to the build of
the org-apache-sling-launchpad-testing project.  Specifically, if I combine
the "eclipse:eclipse" goal with the "install" or "verify" goal in the same
mvn command line, it results in an error about a duplicate feature file.
This command worked in the past, so maybe you might know what the problem
is?  It appears that the "aggregate-features" goal is getting called twice
during this build scenario and not handling it well.

For example:

*org-apache-sling-launchpad-testing $ **mvn clean eclipse:eclipse verify*


Results in this error:

[ERROR] Failed to execute goal
org.apache.sling:slingfeature-maven-plugin:1.3.6:aggregate-features
(aggregate-features) on project org.apache.sling.launchpad.testing:
Execution aggregate-features of goal
org.apache.sling:slingfeature-maven-plugin:1.3.6:aggregate-features failed:
More than one feature file for classifier testing-oak_tar in project
org.apache.sling:org.apache.sling.launchpad.testing:jar:12-SNAPSHOT :
[aggregate testing-oak_tar, aggregate testing-oak_tar] -> [Help 1]



A workaround is to run the "eclipse:eclipse" goal and the "install" or
"verify goal in separate runs.

Regards,
-Eric


On Wed, Aug 5, 2020 at 10:35 AM Robert Munteanu  wrote:

> Hi,
>
> With the merge of the two PRs for the Sling Starter [1] and Launchpad-
> Testing [2] the Sling starter is now switched to the feature model.
>
> This completes Phase 2, as defined in the migration plan [3]. Please
> keep an eye open for regressions, as it "works on my machine and
> Jenkins".
>
> As a reminder, for Phase 3 we do have a number of important but
> "boring" tasks defined, like documentation, feature model refinements (
> Dan already spotted a potential improvement in the PR [4]), and it
> would be great if others could pick up some of the tasks.
>
> Thanks,
> Robert
>
> [1]: https://github.com/apache/sling-org-apache-sling-starter/pull/11
> [2]:
> https://github.com/apache/sling-org-apache-sling-launchpad-testing/pull/2
> [3]:
> https://cwiki.apache.org/confluence/display/SLING/Migrating+the+Sling+Starter+to+the+Feature+Model
> [4]:
> https://github.com/apache/sling-org-apache-sling-starter/pull/11#pullrequestreview-461877061
>
>


[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] commented on pull request #18: SLING-9620 ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread GitBox


sonarcloud[bot] commented on pull request #18:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/18#issuecomment-670579047


   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18
 lved=false=SECURITY_HOTSPOT) [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [5 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
 [85.7% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
  
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
   
The version of Java (1.8.0_252) you 
have used to run this analysis is deprecated and we will stop accepting it from 
October 2020. Please update to at least Java 11.
   Read more [here](https://sonarcloud.io/documentation/upcoming/)
   
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] removed a comment on pull request #18: SLING-9620 ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread GitBox


sonarcloud[bot] removed a comment on pull request #18:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/18#issuecomment-670478604


   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18
 lved=false=SECURITY_HOTSPOT) [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [5 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
 [85.7% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
  
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
   
The version of Java (1.8.0_252) you 
have used to run this analysis is deprecated and we will stop accepting it from 
October 2020. Please update to at least Java 11.
   Read more [here](https://sonarcloud.io/documentation/upcoming/)
   
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Created] (SLING-9648) SlingPropertiesPrinter fails to activate: No bundle context property 'sling.properties.url' provided

2020-08-07 Thread Robert Munteanu (Jira)
Robert Munteanu created SLING-9648:
--

 Summary: SlingPropertiesPrinter fails to activate: No bundle 
context property 'sling.properties.url' provided
 Key: SLING-9648
 URL: https://issues.apache.org/jira/browse/SLING-9648
 Project: Sling
  Issue Type: Bug
Reporter: Robert Munteanu
 Fix For: Settings 1.4.2


When starting up the Sling Starter I see the following error printed on the 
console:

{noformat}ERROR: bundle org.apache.sling.settings:1.4.0 
(22)[org.apache.sling.settings.impl.SlingPropertiesPrinter(1)] :  Error during 
instantiation of the implementation object
java.lang.reflect.InvocationTargetException
at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
at 
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at 
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at 
org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:312)
at 
org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:279)
at 
org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115)
at 
org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:984)
at 
org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:957)
at 
org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:902)
at 
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:348)
at 
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:248)
at 
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
at org.apache.felix.framework.Felix.getService(Felix.java:3954)
at 
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450)
at 
org.apache.felix.inventory.impl.webconsole.WebConsoleAdapter.addingService(WebConsoleAdapter.java:152)
at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
at 
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871)
at 
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at 
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:321)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264)
at 
org.apache.felix.inventory.impl.webconsole.WebConsoleAdapter.(WebConsoleAdapter.java:68)
at org.apache.felix.inventory.impl.Activator.start(Activator.java:63)
at 
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
at 
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: No bundle context property 
'sling.properties.url' provided
at 
org.apache.sling.settings.impl.SlingPropertiesPrinter.(SlingPropertiesPrinter.java:64)
... 30 more
{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9648) SlingPropertiesPrinter fails to activate: No bundle context property 'sling.properties.url' provided

2020-08-07 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173215#comment-17173215
 ] 

Robert Munteanu commented on SLING-9648:


[~kwin] - is this maybe related to your recent work on the settings bundle?

> SlingPropertiesPrinter fails to activate: No bundle context property 
> 'sling.properties.url' provided
> 
>
> Key: SLING-9648
> URL: https://issues.apache.org/jira/browse/SLING-9648
> Project: Sling
>  Issue Type: Bug
>Reporter: Robert Munteanu
>Priority: Major
> Fix For: Settings 1.4.2
>
>
> When starting up the Sling Starter I see the following error printed on the 
> console:
> {noformat}ERROR: bundle org.apache.sling.settings:1.4.0 
> (22)[org.apache.sling.settings.impl.SlingPropertiesPrinter(1)] :  Error 
> during instantiation of the implementation object
> java.lang.reflect.InvocationTargetException
>   at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>  Method)
>   at 
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>   at 
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>   at 
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
>   at 
> org.apache.felix.scr.impl.inject.internal.ComponentConstructorImpl.newInstance(ComponentConstructorImpl.java:312)
>   at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:279)
>   at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:115)
>   at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:984)
>   at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:957)
>   at 
> org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:902)
>   at 
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:348)
>   at 
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:248)
>   at 
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
>   at org.apache.felix.framework.Felix.getService(Felix.java:3954)
>   at 
> org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450)
>   at 
> org.apache.felix.inventory.impl.webconsole.WebConsoleAdapter.addingService(WebConsoleAdapter.java:152)
>   at 
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
>   at 
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871)
>   at 
> org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
>   at 
> org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
>   at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:321)
>   at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264)
>   at 
> org.apache.felix.inventory.impl.webconsole.WebConsoleAdapter.(WebConsoleAdapter.java:68)
>   at org.apache.felix.inventory.impl.Activator.start(Activator.java:63)
>   at 
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
>   at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
>   at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
>   at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
>   at 
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
>   at java.base/java.lang.Thread.run(Thread.java:834)
> Caused by: java.lang.IllegalStateException: No bundle context property 
> 'sling.properties.url' provided
>   at 
> org.apache.sling.settings.impl.SlingPropertiesPrinter.(SlingPropertiesPrinter.java:64)
>   ... 30 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9634) Sling Dynamic Include not working with version 3.2.0

2020-08-07 Thread Geetika Chhabra (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173214#comment-17173214
 ] 

Geetika Chhabra commented on SLING-9634:


Hi [~jfmitchell],

Wondering if you got a chance to check this one?

Regards,

Geetika

> Sling Dynamic Include not working with version 3.2.0
> 
>
> Key: SLING-9634
> URL: https://issues.apache.org/jira/browse/SLING-9634
> Project: Sling
>  Issue Type: Bug
>Affects Versions: Dynamic Include 3.2.0
>Reporter: Geetika Chhabra
>Priority: Major
> Attachments: image-2020-08-05-14-10-16-218.png
>
>
> In one of our projects, we have been using SDI 3.1.2 and it seems to be 
> working fine. However, in order to use the *disableIgnoreParams* feature 
> introduced in version 3.2.0 (SLING-9045), we switched to version 3.2.0 but 
> the default functionality of SDI doesn't seem to work anymore. We tried with 
> the query parameter and without, it doesn't work in both of the scenarios.
> Additional steps we did to go from version 3.1.2 to 3.2.0:
>  * Updated the SDI version in pom.xml to point to 3.2.0.
>  * Added the *"include-filter.config.disableIgnoreUrlParams="\{Boolean}true"* 
> property in addition to the old ones.
> Please note that it works as expected with version 3.1.2.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9635) Create a kickstart jar during the Sling Starter build

2020-08-07 Thread Andreas Schaefer (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173210#comment-17173210
 ] 

Andreas Schaefer commented on SLING-9635:
-

The Kickstart Maven Plugin is OOTB just starting / stopping Sling. That said it 
is able to start other feature models / archives but I am not 100% sure if that 
is exposed as of now.

I will have a look into this this weekend.

The Kickstart Project for sure can launch any FM / FAR with or without Sling.

> Create a kickstart jar during the Sling Starter build
> -
>
> Key: SLING-9635
> URL: https://issues.apache.org/jira/browse/SLING-9635
> Project: Sling
>  Issue Type: Sub-task
>  Components: Starter
>Reporter: Robert Munteanu
>Priority: Major
> Fix For: Starter 12
>
>
> Separate from SLING-9595, see 
> https://issues.apache.org/jira/browse/SLING-9595?focusedCommentId=17161943=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17161943



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (SLING-9647) [Testing Clients] Store request and response on a ClientException

2020-08-07 Thread Andrei Dulvac (Jira)
Andrei Dulvac created SLING-9647:


 Summary: [Testing Clients] Store request and response on  a 
ClientException 
 Key: SLING-9647
 URL: https://issues.apache.org/jira/browse/SLING-9647
 Project: Sling
  Issue Type: Improvement
  Components: Apache Sling Testing Clients
Affects Versions: Apache Sling Testing Clients 2.0.0
Reporter: Andrei Dulvac
Assignee: Andrei Dulvac
 Fix For: Apache Sling Testing Clients 2.0.2


Allow for ClientException to optionally store the request and response. This 
would be useful for logging them as part of exception handling



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Sling GraphQL

2020-08-07 Thread Andreea Miruna Moise
>3) Clients run such prepared queries by making GET requests to URLs
like /graphqlservlet/prepared/cf81d4.json
To be able to do this a different endpoint would be needed instead of 
org.apache.sling.graphql.core.servlet. GraphQLServlet right?

>4) The responses to such prepared queries requests contain useful HTTP
Cache headers, which might be set from hints supplied by data fetchers
with configurable defaults.
This means that sling would have to compute the headers based on the cache 
hints.

On the other hand I was thinking that the KeyValueCache service can be 
implemented at the sling-graphql-adapter level and sling-graphql-core would 
only provide the interface. It just seemed a simpler solution.

Regards,
Andreea

On 07/08/2020, 17:18, "Bertrand Delacretaz"  wrote:

Hi Andreea,

On Fri, Aug 7, 2020 at 12:41 PM Andreea Miruna Moise
 wrote:
> ...1. In case we provide hooks for SlingDataFetchers we will end up with 
fine-grained cache hints...
> But the major limitation is that this can be used only in case of GET 
requests

> ...2. Now if we think of using POST requests that are not cached by CDN 
the only option is application
> level caching...

I've done a bit more research on GraphQL caching and in particular
noticed the "Caching & GraphQL: Setting the Story Straight" talk by
Marc-André Giroux [1] and I agree very much with his view.

My summary of that is:
-Like any flexible API, GraphQL is harder to cache than requests which
have a narrower scope
-There's no built-in way to use HTTP caching as GraphQL says nothing
about which request/response protocol is used
-Moving to a more HTTP-friendly way to express requests allows using
HTTP caching.

As you say, POST requests are usually not cached, and using GET is
problematic due to the GraphQL query size.

Which means that the client will need to do something beyond plain
GraphQL requests, for caching to work.

However, Sling-based systems usually have an HTTP cache in front, so
if we can take advantage of that it avoids having to reinvent and
maintain something else.

I've also studied Apollo's "Automatic Persisted Queries" [2] which
suggest a client/server protocol extension to cope with this. It's not
as automatic as they claim IMHO but I like the general idea and I
think we could do something similar for Sling while remaining within
our usual HTTP best practices.

Here's what I suggest:

1) GraphQL queries executed via POST are not cached bySling

2) Queries can be prepared in advance by POSTing the query text to
Sling, which returns a "201 created" status with a URL that contains
the query's digest, like cf81d4

3) Clients run such prepared queries by making GET requests to URLs
like /graphqlservlet/prepared/cf81d4.json

4) The responses to such prepared queries requests contain useful HTTP
Cache headers, which might be set from hints supplied by data fetchers
with configurable defaults.

5) There's no guarantee on how long the prepared queries are stored, a
client that gets a 404 on a prepared query request must be prepared to
use the default POST request method or store the prepared query again

I don't think we can achieve efficient caching without some
collaboration with the client, and with this the requirements on the
client are pretty simple to fulfill.

Would that work for your use cases?

-Bertrand

[1] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCV3puKM_G14data=02%7C01%7Csandru%40adobe.com%7C17470ed70bb843dd6ac508d83adcc578%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637324067161406786sdata=wbx768cmx1qkOicioeJErI1xhPZHQPR5PZ%2FaHO8Kf%2BU%3Dreserved=0
[2] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.apollographql.com%2Fblog%2Fimprove-graphql-performance-with-automatic-persisted-queries-c31d27b8e6ea%2Fdata=02%7C01%7Csandru%40adobe.com%7C17470ed70bb843dd6ac508d83adcc578%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637324067161406786sdata=ulttaOpdURR8M6mSNSHDb8AbNnrRkoY1Y5oGcqFd5%2Fg%3Dreserved=0




Re: Sling GraphQL

2020-08-07 Thread Bertrand Delacretaz
Hi Andreea,

On Fri, Aug 7, 2020 at 12:41 PM Andreea Miruna Moise
 wrote:
> ...1. In case we provide hooks for SlingDataFetchers we will end up with 
> fine-grained cache hints...
> But the major limitation is that this can be used only in case of GET 
> requests

> ...2. Now if we think of using POST requests that are not cached by CDN the 
> only option is application
> level caching...

I've done a bit more research on GraphQL caching and in particular
noticed the "Caching & GraphQL: Setting the Story Straight" talk by
Marc-André Giroux [1] and I agree very much with his view.

My summary of that is:
-Like any flexible API, GraphQL is harder to cache than requests which
have a narrower scope
-There's no built-in way to use HTTP caching as GraphQL says nothing
about which request/response protocol is used
-Moving to a more HTTP-friendly way to express requests allows using
HTTP caching.

As you say, POST requests are usually not cached, and using GET is
problematic due to the GraphQL query size.

Which means that the client will need to do something beyond plain
GraphQL requests, for caching to work.

However, Sling-based systems usually have an HTTP cache in front, so
if we can take advantage of that it avoids having to reinvent and
maintain something else.

I've also studied Apollo's "Automatic Persisted Queries" [2] which
suggest a client/server protocol extension to cope with this. It's not
as automatic as they claim IMHO but I like the general idea and I
think we could do something similar for Sling while remaining within
our usual HTTP best practices.

Here's what I suggest:

1) GraphQL queries executed via POST are not cached bySling

2) Queries can be prepared in advance by POSTing the query text to
Sling, which returns a "201 created" status with a URL that contains
the query's digest, like cf81d4

3) Clients run such prepared queries by making GET requests to URLs
like /graphqlservlet/prepared/cf81d4.json

4) The responses to such prepared queries requests contain useful HTTP
Cache headers, which might be set from hints supplied by data fetchers
with configurable defaults.

5) There's no guarantee on how long the prepared queries are stored, a
client that gets a 404 on a prepared query request must be prepared to
use the default POST request method or store the prepared query again

I don't think we can achieve efficient caching without some
collaboration with the client, and with this the requirements on the
client are pretty simple to fulfill.

Would that work for your use cases?

-Bertrand

[1] https://www.youtube.com/watch?v=CV3puKM_G14
[2] 
https://www.apollographql.com/blog/improve-graphql-performance-with-automatic-persisted-queries-c31d27b8e6ea/


[jira] [Created] (SLING-9646) not able to exclude jsp in jspc-maven-plugin configuration

2020-08-07 Thread Pulkit Gupta (Jira)
Pulkit Gupta created SLING-9646:
---

 Summary: not able to exclude jsp in jspc-maven-plugin configuration
 Key: SLING-9646
 URL: https://issues.apache.org/jira/browse/SLING-9646
 Project: Sling
  Issue Type: Bug
Affects Versions: JSPC Maven Plugin 2.2.2
Reporter: Pulkit Gupta


Hi,

 

I am using JspC plugin to pre-compile my JSP. However I have some JSP fragments 
which I do not want to compile. I have added these JSPs in the exclude tag but 
still JspC is picking these JSPs and compiling them resulting in failure.

 


 true
 ${project.build.directory}/jsps-to-compile
 ${project.build.directory}/ignoredjspc
 
/panel/outputs.jsp,
 /panel/editscreen.jsp
 


 

I have also tried this


 true
 ${project.build.directory}/jsps-to-compile
 ${project.build.directory}/ignoredjspc
 
/panel/outputs.jsp
 /panel/editscreen.jsp
 




--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9620) ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173123#comment-17173123
 ] 

Robert Munteanu commented on SLING-9620:


[~angela] - yes, I will definitely look the optimisation enabled scenario as 
well, and I want to test the same scenarios inside the unit test. It's going to 
be a bit slower, but I think the test coverage is worth it.

> ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias
> ---
>
> Key: SLING-9620
> URL: https://issues.apache.org/jira/browse/SLING-9620
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Affects Versions: Resource Resolver 1.6.16
>Reporter: Angela Schreiber
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Resource Resolver 1.6.18
>
> Attachments: SLING-9620-test.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> while investigating an issue involving {{sling:alias}}, i ended up manually 
> adding the property using JCR API calls. this involved first adding the 
> {{sling:ResourceAlias}} and i noticed that {{sling:alias}} can be both single 
> or multi-valued according to the node type definition:
> {code}
> / Mixin node type to enable setting an alias on a resource
> [sling:ResourceAlias]
> mixin
>   
> // alias name(s) for the node (single or multi-value)
>   - sling:alias (string)
>   - sling:alias (string) multiple
> {code}
> when setting multiple values for the {{sling:alias}} property, i found that 
> {{ResourceMapper.getAllMappings}} only returns the first alias.
> looking at the implementation in 
> {{ResourceMapperImpl.loadAliasIfApplicable}}, it seems that line 216 
> ({{String alias = ResourceResolverControl.getProperty(current, 
> ResourceResolverImpl.PROP_ALIAS);}}), is the culprit as call will in any case 
> just return a single string (it calls {{getProperty(res, propName, 
> String.class)}}).
> as a consequence consumers of the {{ResourceMapper.getAllMappings}} method 
> will not get a complete list of all aliases available.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (SLING-9628) Send log messages from subscriber to publisher

2020-08-07 Thread Christian Schneider (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-9628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Christian Schneider resolved SLING-9628.

Resolution: Fixed

> Send log messages from subscriber to publisher
> --
>
> Key: SLING-9628
> URL: https://issues.apache.org/jira/browse/SLING-9628
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.18, Content 
> Distribution Journal Kafka 0.1.6, Content Distribution Journal Messages 0.1.10
>
>
> In the content distribution UI we can display a distribution log per agent.
> Currently this log only shows that package messages are sent out. 
> This issue is about also showing successfully imported packages as well as 
> errors during import on the subscriber side.
> The idea is to send a new message type LogMessage on the discovery topic. 
> These messages are received by the DiscoveryService and added to the 
> DIstributionLog.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9620) ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread Angela Schreiber (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173102#comment-17173102
 ] 

Angela Schreiber commented on SLING-9620:
-

[~rombert], sure... i didn't invest a ton of time in the test case. just aimed 
to have more at hand than just reporting something i spotted in Adobe AEM 
without being able to illustrate it on the ResourceMapper level.

regarding the alias-optimization: since this is (as far as I know) enabled by 
default in AEM, i think it would be really important to have it fixed as well. 
i couldn't right way find the tests for that scenario. but it might be a good 
thing to have additional test-coverage for the optimization-case, given the 
fact that it is not recommended to disable it for performance reasons.

> ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias
> ---
>
> Key: SLING-9620
> URL: https://issues.apache.org/jira/browse/SLING-9620
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Affects Versions: Resource Resolver 1.6.16
>Reporter: Angela Schreiber
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Resource Resolver 1.6.18
>
> Attachments: SLING-9620-test.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> while investigating an issue involving {{sling:alias}}, i ended up manually 
> adding the property using JCR API calls. this involved first adding the 
> {{sling:ResourceAlias}} and i noticed that {{sling:alias}} can be both single 
> or multi-valued according to the node type definition:
> {code}
> / Mixin node type to enable setting an alias on a resource
> [sling:ResourceAlias]
> mixin
>   
> // alias name(s) for the node (single or multi-value)
>   - sling:alias (string)
>   - sling:alias (string) multiple
> {code}
> when setting multiple values for the {{sling:alias}} property, i found that 
> {{ResourceMapper.getAllMappings}} only returns the first alias.
> looking at the implementation in 
> {{ResourceMapperImpl.loadAliasIfApplicable}}, it seems that line 216 
> ({{String alias = ResourceResolverControl.getProperty(current, 
> ResourceResolverImpl.PROP_ALIAS);}}), is the culprit as call will in any case 
> just return a single string (it calls {{getProperty(res, propName, 
> String.class)}}).
> as a consequence consumers of the {{ResourceMapper.getAllMappings}} method 
> will not get a complete list of all aliases available.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[GitHub] [sling-org-apache-sling-resourceresolver] rombert commented on pull request #18: SLING-9620 ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread GitBox


rombert commented on pull request #18:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/18#issuecomment-670480617


   This still needs work, there are a number of failures in the Sling ITs
   
   ```
   [ERROR] Tests run: 62, Failures: 9, Errors: 0, Skipped: 0, Time elapsed: 
35.074 s <<< FAILURE! - in 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest
   [ERROR] 
testMapNamespaceMangling(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.612 s  <<< FAILURE!
   org.junit.ComparisonFailure: Expect unmangled path expected: but 
was:
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testMapNamespaceMangling(ResourceResolverGeneralTest.java:2089)
   
   [ERROR] 
testResolveVirtualHostHttp80Multiple(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.581 s  <<< FAILURE!
   org.junit.ComparisonFailure: expected:<[http://de.host.com]/playground.html> 
but was:<[/de]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttp80Multiple(ResourceResolverGeneralTest.java:716)
   
   [ERROR] 
testResolveVirtualHostHttp8080(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.575 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[http://virtual.host.com:8080]/playground.html> but 
was:<[/virtual]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttp8080(ResourceResolverGeneralTest.java:880)
   
   [ERROR] 
testResolveVirtualHostHttps443(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.568 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[https://virtual.host.com]/playground.html> but 
was:<[/virtual]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttps443(ResourceResolverGeneralTest.java:950)
   
   [ERROR] 
testResolveVirtualHostHttps4443(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.563 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[https://virtual.host.com:4443]/playground.html> but 
was:<[/virtual]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttps4443(ResourceResolverGeneralTest.java:984)
   
   [ERROR] 
testMapURLEscaping(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.581 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[http://internal.host.com]/sample%20with%20spa...> but 
was:<[/internal]/sample%20with%20spa...>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testMapURLEscaping(ResourceResolverGeneralTest.java:2029)
   
   [ERROR] 
testResolveResourceInternalRedirectExact(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.55 s  <<< FAILURE!
   org.junit.ComparisonFailure: expected:<[https://localhost/virtua]l> but 
was:<[/virtual.htm]l>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveResourceInternalRedirectExact(ResourceResolverGeneralTest.java:600)
   
   [ERROR] 
testResolveVirtualHostHttp80(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.561 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[http://virtual.host.com]/playground.html> but 
was:<[/virtual]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttp80(ResourceResolverGeneralTest.java:667)
   
   [ERROR] 
testResolveVirtualHostHttpVsHttps(org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest)
  Time elapsed: 0.555 s  <<< FAILURE!
   org.junit.ComparisonFailure: 
expected:<[http://www.host.com]/playground.html> but 
was:<[/page]/playground.html>
at 
org.apache.sling.launchpad.webapp.integrationtest.resourceresolver.ResourceResolverGeneralTest.testResolveVirtualHostHttpVsHttps(ResourceResolverGeneralTest.java:1043)
   
   ```



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] commented on pull request #18: SLING-9620 ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread GitBox


sonarcloud[bot] commented on pull request #18:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/18#issuecomment-670478604


   Kudos, SonarCloud Quality Gate passed!
   
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=BUG)
  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=VULNERABILITY)
 (and [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18
 lved=false=SECURITY_HOTSPOT) [0 Security 
Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=SECURITY_HOTSPOT)
 to review)  
   [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
 [5 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=18=false=CODE_SMELL)
   
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
 [85.7% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_coverage=list)
  
   [](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
 [0.0% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=18=new_duplicated_lines_density=list)
   
The version of Java (1.8.0_252) you 
have used to run this analysis is deprecated and we will stop accepting it from 
October 2020. Please update to at least Java 11.
   Read more [here](https://sonarcloud.io/documentation/upcoming/)
   
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-resourceresolver] rombert opened a new pull request #18: SLING-9620 ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread GitBox


rombert opened a new pull request #18:
URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/18


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Commented] (SLING-9620) ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias

2020-08-07 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173085#comment-17173085
 ] 

Robert Munteanu commented on SLING-9620:


[~angela] - thank your for the report and for the patch. I am getting close to 
finalising the bug fix (at least for the optimise alias resolution disabled 
scenario ).

To make the test advance I needed to make a small change to your patch, see 
below:

{noformat}
diff --git 
a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/InMemoryResourceProvider.java
 
b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/InMemoryResourceProvider.java
index bc288e3..28a8c1b 100644
--- 
a/src/test/java/org/apache/sling/resourceresolver/impl/mapping/InMemoryResourceProvider.java
+++ 
b/src/test/java/org/apache/sling/resourceresolver/impl/mapping/InMemoryResourceProvider.java
@@ -19,7 +19,6 @@
 
 package org.apache.sling.resourceresolver.impl.mapping;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -67,7 +66,7 @@ public class InMemoryResourceProvider extends 
ResourceProvider {
 }
 
 public void putResource(String path, String key, Object... values) {
-putResource(path, Collections.singletonMap(key, 
Arrays.asList(values)));
+putResource(path, Collections.singletonMap(key, values));
 }
 
 public void putResource(String path, String key, Object value, String 
key2, Object value2) {
{noformat}

Otherwise the property conversion will not work as expected. Does that look OK 
to you?

> ResourceMapperImpl.getAllMappings does not respect multi-valued sling:alias
> ---
>
> Key: SLING-9620
> URL: https://issues.apache.org/jira/browse/SLING-9620
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Affects Versions: Resource Resolver 1.6.16
>Reporter: Angela Schreiber
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Resource Resolver 1.6.18
>
> Attachments: SLING-9620-test.patch
>
>
> while investigating an issue involving {{sling:alias}}, i ended up manually 
> adding the property using JCR API calls. this involved first adding the 
> {{sling:ResourceAlias}} and i noticed that {{sling:alias}} can be both single 
> or multi-valued according to the node type definition:
> {code}
> / Mixin node type to enable setting an alias on a resource
> [sling:ResourceAlias]
> mixin
>   
> // alias name(s) for the node (single or multi-value)
>   - sling:alias (string)
>   - sling:alias (string) multiple
> {code}
> when setting multiple values for the {{sling:alias}} property, i found that 
> {{ResourceMapper.getAllMappings}} only returns the first alias.
> looking at the implementation in 
> {{ResourceMapperImpl.loadAliasIfApplicable}}, it seems that line 216 
> ({{String alias = ResourceResolverControl.getProperty(current, 
> ResourceResolverImpl.PROP_ALIAS);}}), is the culprit as call will in any case 
> just return a single string (it calls {{getProperty(res, propName, 
> String.class)}}).
> as a consequence consumers of the {{ResourceMapper.getAllMappings}} method 
> will not get a complete list of all aliases available.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9594) Move Sling builds to ci-builds.apache.org

2020-08-07 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173073#comment-17173073
 ] 

Robert Munteanu commented on SLING-9594:


I am not too worried about overwhelming the new Jenkins master as the vast 
majority of our builds are short-lived. But let's see how things play out.

> Move Sling builds to ci-builds.apache.org
> -
>
> Key: SLING-9594
> URL: https://issues.apache.org/jira/browse/SLING-9594
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Critical
>
> The ASF Jenkins infrastructure is moving to to a new
> Cloudbees based Client Master called https://ci-builds.apache.org, see 
> https://lists.apache.org/thread.html/re974eed417a1bc294694701d5c91b4bf92689fcf32a4c91f169be87d%40%3Cbuilds.apache.org%3E
>  .  The migrations of all jobs needs to be done before the switch off date of 
> 15th August 2020, so we have a maximum about three weeks from now to make the 
> move.
> There is no automatic way of migrating the jobs, but thankfully our current 
> set up is very much automated and reasonably well documented at 
> https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup .
> It very well may be that we can simply set up another GitHub org on the new 
> Jenkins master, provide the secrets and be done with it. But it needs 
> investigation though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9594) Move Sling builds to ci-builds.apache.org

2020-08-07 Thread Konrad Windszus (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173067#comment-17173067
 ] 

Konrad Windszus commented on SLING-9594:


There is a hint in 
https://lists.apache.org/x/thread.html/r6e122331d6639e8a19855f19221afcd0e0dad82dc90b15a3d42e765a@%3Cbuilds.apache.org%3E
 about restricting how often a build is retriggered.

> Move Sling builds to ci-builds.apache.org
> -
>
> Key: SLING-9594
> URL: https://issues.apache.org/jira/browse/SLING-9594
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Critical
>
> The ASF Jenkins infrastructure is moving to to a new
> Cloudbees based Client Master called https://ci-builds.apache.org, see 
> https://lists.apache.org/thread.html/re974eed417a1bc294694701d5c91b4bf92689fcf32a4c91f169be87d%40%3Cbuilds.apache.org%3E
>  .  The migrations of all jobs needs to be done before the switch off date of 
> 15th August 2020, so we have a maximum about three weeks from now to make the 
> move.
> There is no automatic way of migrating the jobs, but thankfully our current 
> set up is very much automated and reasonably well documented at 
> https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup .
> It very well may be that we can simply set up another GitHub org on the new 
> Jenkins master, provide the secrets and be done with it. But it needs 
> investigation though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Sling GraphQL

2020-08-07 Thread Andreea Miruna Moise
Hi Bertrand,

I'm mostly referring to server-side queries. Here are my thoughts:
1. In case we provide hooks for SlingDataFetchers we will end up with 
fine-grained cache hints (for eg 
https://github.com/graphql-java/graphql-java/blob/c40fc1d50e91f5584cd8995b46c464d3692f20b3/src/main/java/graphql/cachecontrol/CacheControl.java
 could be used). After getting these hints into the ExecutionResult we would 
need a mechanism that combines them into an overall cache policy for the 
response. But the major limitation is that this can be used only in case of GET 
requests. Now the downside in this is that many CDNs and caching proxies only 
cache GET requests (not POST requests) and may have a limit on the size of a 
GET URL. So if we hit the limit it won't work and unfortunately GraphQL queries 
can be very long. Also I think that building such a mechanism is complicated.

2. Now if we think of using POST requests that are not cached by CDN the only 
option is application level caching. And the extension point that can be added 
to sling graphql is a KeyValueCache interface that will work as a service and 
will be implemented by the client so that the client has control on the cache 
implementation as you said. If the key is an Object it's even better because it 
helps setting the scope of the cache to PRIVATE or PUBLIC. One client can use a 
combination of UserId + locale + query or sessionId + query or sessionId + 
excutionInput for the key. And for using the cache we could update 
https://github.com/apache/sling-org-apache-sling-graphql-core/blob/master/src/main/java/org/apache/sling/graphql/core/engine/GraphQLResourceQuery.java#L101
 to check the cache first and if not execute the query. But anyway in case of 
POST requests I don't see the need for caching hints.

Andreea

[0] https://www.apollographql.com/docs/apollo-server/performance/caching/

On 06/08/2020, 18:04, "Bertrand Delacretaz"  wrote:

[Hi Andreea,

On Thu, Aug 6, 2020 at 12:02 PM Andreea Miruna Moise
 wrote:
> What would be the recommended way of approaching caching in case of 
GraphQL?...

I haven't given much thought to that so far, and reading [1] [2] and
[3] it looks like the best way to cache GraphQL query responses is to
run those queries server-side, driven by GET requests and use
traditional HTTP caching.

The GraphQL core module does support server-side queries, without
caching HTTP headers so far but that could be added.

But I suppose you are more looking at client-driven GraphQL queries.
[3] mentions an interesting (if a bit hacky) way of moving queries to
the server-side to make them easier to cache. I suppose that only
works if you control the client and that's probably not a standard.

> ...would it make sense to have an application caching layer at Sling 
level that would support private
> caching of the ExecutionResult?..

What we might do is provide hooks in the GraphQL Core for
SlingDataFetchers to supply caching hints, along with an extension
point where that caching can happen - would that work for your use
cases?

If the answer is yes, suggestions on how those hooks can look are very 
welcome!

Although we do have caching services in Sling [4] I'm not sure if they
are in active use at the moment, their code doesn't seem to have been
touched in a long time. But if we provide somewhat abstract hooks,
people can use whatever caching mechanism they want.

-Bertrand


[1] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.apollographql.com%2Fblog%2Fgraphql-caching-the-elephant-in-the-room-11a3df0c23ad%2Fdata=02%7C01%7Csandru%40adobe.com%7C10564da5b3a94cb5c2ac08d83a19ffa3%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323230626053305sdata=Eh%2Ba8ZBlOrJEv%2BGe4MfmT0JmE3AauMEjfGAe8fV4HhM%3Dreserved=0
[2] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.apollographql.com%2Fdocs%2Fapollo-server%2Fperformance%2Fcaching%2F%23adding-cache-hints-statically-in-your-schemadata=02%7C01%7Csandru%40adobe.com%7C10564da5b3a94cb5c2ac08d83a19ffa3%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323230626053305sdata=LKF9VSqnyXk3jcNqmvQYVd2u6rMWfgwvnrnxq3ZOXWw%3Dreserved=0
[3] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapollographql%2Fapollo-link-persisted-queriesdata=02%7C01%7Csandru%40adobe.com%7C10564da5b3a94cb5c2ac08d83a19ffa3%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323230626053305sdata=BDqMOoCm3MeaontiJVsCf9oSZRhQu7m17seFeaYc%2Fcw%3Dreserved=0
[4] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsling.apache.org%2Fdocumentation%2Fbundles%2Fcaching-services.htmldata=02%7C01%7Csandru%40adobe.com%7C10564da5b3a94cb5c2ac08d83a19ffa3%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323230626053305sdata=hq9GDy%2FYWFbidPxB%2FhD1UIBsGJ1Ya1AY969jc1KkFQ4%3Dreserved=0




[jira] [Commented] (SLING-9594) Move Sling builds to ci-builds.apache.org

2020-08-07 Thread Bertrand Delacretaz (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173052#comment-17173052
 ] 

Bertrand Delacretaz commented on SLING-9594:


If we take this 
https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-api/
 as an example, 7 branches have been built although I think we only need to 
build the master branch, at least initially.

If there's an easy way to say "just build the master branch" that could be 
useful for now? To avoid overloading the build service.

We should probably cleanup those stale (I suppose) branches but with our large 
number of repositories that's a lot of work.

> Move Sling builds to ci-builds.apache.org
> -
>
> Key: SLING-9594
> URL: https://issues.apache.org/jira/browse/SLING-9594
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Critical
>
> The ASF Jenkins infrastructure is moving to to a new
> Cloudbees based Client Master called https://ci-builds.apache.org, see 
> https://lists.apache.org/thread.html/re974eed417a1bc294694701d5c91b4bf92689fcf32a4c91f169be87d%40%3Cbuilds.apache.org%3E
>  .  The migrations of all jobs needs to be done before the switch off date of 
> 15th August 2020, so we have a maximum about three weeks from now to make the 
> move.
> There is no automatic way of migrating the jobs, but thankfully our current 
> set up is very much automated and reasonably well documented at 
> https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup .
> It very well may be that we can simply set up another GitHub org on the new 
> Jenkins master, provide the secrets and be done with it. But it needs 
> investigation though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: [VOTE] Release Apache Sling JCR Base 3.1.4

2020-08-07 Thread Nicolas Peltier
+1

Le mer. 5 août 2020 à 12:20, Stefan Seifert  a
écrit :

> +1
>
> (sorry for the wrong mail von JCR base 3.1.2 - i validated 3.1.4)
>
> stefan
>
>
>


[jira] [Commented] (SLING-9594) Move Sling builds to ci-builds.apache.org

2020-08-07 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173015#comment-17173015
 ] 

Robert Munteanu commented on SLING-9594:


The build was successful, including SNAPSHOT deployment and SonarCloud run.

I guess we could technically move, but I'm seeing a queue of 900+ jobs, so it 
does not look like it's going to be productive to switch now.

I asked about expected capacity at 
https://lists.apache.org/thread.html/r34873ad74b8fde3b30fdbaa51be5fb49beea00faa78bec096ac088cb%40%3Cbuilds.apache.org%3E

> Move Sling builds to ci-builds.apache.org
> -
>
> Key: SLING-9594
> URL: https://issues.apache.org/jira/browse/SLING-9594
> Project: Sling
>  Issue Type: Task
>  Components: Build and Source Control
>Reporter: Robert Munteanu
>Priority: Critical
>
> The ASF Jenkins infrastructure is moving to to a new
> Cloudbees based Client Master called https://ci-builds.apache.org, see 
> https://lists.apache.org/thread.html/re974eed417a1bc294694701d5c91b4bf92689fcf32a4c91f169be87d%40%3Cbuilds.apache.org%3E
>  .  The migrations of all jobs needs to be done before the switch off date of 
> 15th August 2020, so we have a maximum about three weeks from now to make the 
> move.
> There is no automatic way of migrating the jobs, but thankfully our current 
> set up is very much automated and reasonably well documented at 
> https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup .
> It very well may be that we can simply set up another GitHub org on the new 
> Jenkins master, provide the secrets and be done with it. But it needs 
> investigation though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9556) add pipes execution through a simple text POST

2020-08-07 Thread Nicolas Peltier (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173001#comment-17173001
 ] 

Nicolas Peltier commented on SLING-9556:


[~enorman] well yeah, this suppose that you authorize random POST request from 
the outside world, that is generally not permitted, but again, i don't want to 
play it smart here :)

> add pipes execution through a simple text POST
> --
>
> Key: SLING-9556
> URL: https://issues.apache.org/jira/browse/SLING-9556
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Pipes 4.0.0
>Reporter: Nicolas Peltier
>Assignee: Nicolas Peltier
>Priority: Major
> Fix For: Pipes 4.0.0
>
>
> problem with configuration of most pipes is JCR serialization is difficult to 
> read/maintain (basic XML maintenance issue).
> Since it can be executed through gogo commands, the pipe could also simply be 
> some piped command in a text file that would be posted to the plumber, using 
> same pipebuilder functionality (see 
> https://github.com/apache/sling-org-apache-sling-pipes/blob/master/src/main/java/org/apache/sling/pipes/internal/GogoCommands.java#L81)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Comment Edited] (SLING-9556) add pipes execution through a simple text POST

2020-08-07 Thread Nicolas Peltier (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173001#comment-17173001
 ] 

Nicolas Peltier edited comment on SLING-9556 at 8/7/20, 8:56 AM:
-

[~enorman] well yeah, this supposes that you authorize random POST request from 
the outside world, that is generally not permitted, but again, i don't want to 
play it smart here :)


was (Author: npeltier):
[~enorman] well yeah, this suppose that you authorize random POST request from 
the outside world, that is generally not permitted, but again, i don't want to 
play it smart here :)

> add pipes execution through a simple text POST
> --
>
> Key: SLING-9556
> URL: https://issues.apache.org/jira/browse/SLING-9556
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Pipes 4.0.0
>Reporter: Nicolas Peltier
>Assignee: Nicolas Peltier
>Priority: Major
> Fix For: Pipes 4.0.0
>
>
> problem with configuration of most pipes is JCR serialization is difficult to 
> read/maintain (basic XML maintenance issue).
> Since it can be executed through gogo commands, the pipe could also simply be 
> some piped command in a text file that would be posted to the plumber, using 
> same pipebuilder functionality (see 
> https://github.com/apache/sling-org-apache-sling-pipes/blob/master/src/main/java/org/apache/sling/pipes/internal/GogoCommands.java#L81)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: [security] new use case for a checkPermission API

2020-08-07 Thread Nicolas Peltier
i was planning to make the API internal for 4.0, and use the outside one
later, so no change to the API surface.

Le ven. 7 août 2020 à 10:41, Oliver Lietz  a écrit :

> On Friday, August 7, 2020 9:15:10 AM CEST Bertrand Delacretaz wrote:
> > On Fri, Aug 7, 2020 at 9:14 AM Nicolas Peltier
> >
> >  wrote:
> > > ...Assuming we are good to go, should I use an internal API for now in
> > > pipes, and we discuss around moving it to a bundle later?...
> >
> > I think that's a good starting point.
>
> Nicolas, are you in hurry to get Pipes 4.0 out soon? I guess adding and
> switching the check requires (again) a major version.
>
> Regards,
> O.
>
>
> > -Bertrand
>
>
>
>
>


Re: [security] new use case for a checkPermission API

2020-08-07 Thread Oliver Lietz
On Friday, August 7, 2020 9:15:10 AM CEST Bertrand Delacretaz wrote:
> On Fri, Aug 7, 2020 at 9:14 AM Nicolas Peltier
> 
>  wrote:
> > ...Assuming we are good to go, should I use an internal API for now in
> > pipes, and we discuss around moving it to a bundle later?...
> 
> I think that's a good starting point.

Nicolas, are you in hurry to get Pipes 4.0 out soon? I guess adding and 
switching the check requires (again) a major version.

Regards,
O.


> -Bertrand






Re: [security] new use case for a checkPermission API

2020-08-07 Thread Bertrand Delacretaz
On Fri, Aug 7, 2020 at 9:14 AM Nicolas Peltier
 wrote:
>
> ...Assuming we are good to go, should I use an internal API for now in pipes,
> and we discuss around moving it to a bundle later?...

I think that's a good starting point.

-Bertrand


Re: [security] new use case for a checkPermission API

2020-08-07 Thread Nicolas Peltier
Assuming we are good to go, should I use an internal API for now in pipes, and 
we discuss around moving it to a bundle later?

Nicolas

On 06/08/2020 16:48, "Bertrand Delacretaz"  wrote:

Hi,

On Thu, Aug 6, 2020 at 4:00 PM Nicolas Peltier  wrote:
> ...we have
> if i count correctly at least 2 legit usages of this (clam & pipes), which
> is enough for legitimizing an API, right?...

I think so, and there's been several cases already where permissions
on arbitrary-named operations (like "execute Sling Pipes via HTTP" in
your case) can help.

-Bertrand

> [0] 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.apache.org%2Fjira%2Fbrowse%2FSLING-9556data=02%7C01%7Cnpeltier%40adobe.com%7Cc143de6b45d0412dcc4008d83a17d753%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323221356938169sdata=E2lDv0O8Eu6kttRvm2JzIwuLgFsOTcqnlqmRQL7zQsE%3Dreserved=0
> [1]
> 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.apache.org%2Fthread.html%2Fe949e6328729e493ec0028642173228933ebf6d9b322da5aa0dd64d3%2540%253Cdev.sling.apache.org%253Edata=02%7C01%7Cnpeltier%40adobe.com%7Cc143de6b45d0412dcc4008d83a17d753%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323221356938169sdata=TvhmI0anfsb%2FmaN8EInCNHDNLDgWLHdCAuiDgGQnSEE%3Dreserved=0
> [2]
> 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.apache.org%2Fthread.html%2F72475f31d9dda5128528d67f491468b081c958e9c3b93924de633c3e%2540%253Cdev.sling.apache.org%253Edata=02%7C01%7Cnpeltier%40adobe.com%7Cc143de6b45d0412dcc4008d83a17d753%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637323221356938169sdata=ly%2B6r%2Bry60bxEZRcoX2VLJWqnuVRDm5Zjha6yUKcTbM%3Dreserved=0