Picon
Favicon

[Created] (JCR-3164) Add minimal maintenance API to TokenBasedAuthentication

Add minimal maintenance API to TokenBasedAuthentication
-------------------------------------------------------

                 Key: JCR-3164
                 URL: https://issues.apache.org/jira/browse/JCR-3164
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-core
    Affects Versions: 2.3.4
            Reporter: Felix Meschberger

Currently the TokenBasedAuthentication class creates token nodes on demand and will only remove a
token's node if the token is used after it has expired. To be able to do some token maintenance in down stream
code (for example in a Sling Authentication Handler), some maintenance API would be helpful:

  String createToken(String username, long initialExpiry, Session session) throws RepositoryException;
  void removeToken(String token, Session session) throws RepositoryException;

Will attach a proposed patch.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

Alexander Klimetschek | 1 Dec 2011 10:27
Picon
Favicon
Gravatar

Re: [jr3 microkernel] Write skew

On 30.11.11 18:47, "Michael Dürig" <mduerig <at> apache.org> wrote:
>We should clarify that quickly then. AFAIU it form that list of
>goals/non-goals which is floating around on of the goals is "mvcc, only
>update sessions on refresh()" which is in direct violation of the spec.

If you can make the snapshot isolation feature configurable, that would be
cool. At least for the JCR 1.0 spec the repository implementation could
make the choice, hence this might still be considered in line with the 2.0
spec as well (but just my guess). I expect the spec authors must have
discussed this topic, so maybe they can give a clear answer.

Cheers,
Alex

--

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel

angela (Assigned) (JIRA | 1 Dec 2011 10:43
Picon
Favicon

[Assigned] (JCR-3164) Add minimal maintenance API to TokenBasedAuthentication


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

angela reassigned JCR-3164:
---------------------------

    Assignee: angela

hi felix

i have a major refactoring of the internal token handing in
progress... unfortunately it's not realistic any more for 2.4 (for reasons you are perfectly aware of,
aren't you?).

i would therefore not spent too much effort in such an API at this moment.

what i would propose you to use for the time being is:
TokenBasedAuthentication.getTokenNode(TokenCredentials, Session) and take care of the node removal youself.

> Add minimal maintenance API to TokenBasedAuthentication
> -------------------------------------------------------
>
>                 Key: JCR-3164
>                 URL: https://issues.apache.org/jira/browse/JCR-3164
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: 2.3.4
>            Reporter: Felix Meschberger
(Continue reading)

Michael Dürig | 1 Dec 2011 11:07
Picon
Favicon

Re: [jr3 microkernel] Write skew


On 30.11.11 20:53, Jukka Zitting wrote:
>> 1) Does visible mean immediately visible on next access or visible after
>> refresh? The second case would work with snapshot isolation.
>
> That's up the implementation.
>
> Section 10.11.1 of JSR 283 [1] explicitly allows changes to become
> visible only after a refresh: "[...] items that do not have changes
> pending have their state refreshed to reflect the current persisted
> state, thus revealing changes made by other sessions."
>
> More generally about the write skew -issue; I don't think that's a
> common problem in practice. There aren't too many clients that
> explicitly interleave operations of multiple sessions within a single
> thread. And in a multithreaded setup a client would even with
> Jackrabbit 2.x need to use explicit synchronization to enforce more
> complex content constraints.

Ok, sounds reasonable to me as far as application constraints are 
involved. Note however, that for the same reason we are currently not 
able to guarantee node type consistency:

session1 = login()
session2 = login()

n1 = session1.getNode("n")
n1.setPrimaryType(nt:file)
n1.save()

(Continue reading)

Picon
Favicon

[Commented] (JCR-2906) Multivalued property sorted by last/random value


    [
https://issues.apache.org/jira/browse/JCR-2906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160799#comment-13160799
] 

Michael Dürig commented on JCR-2906:
------------------------------------

Looks good now and all tests pass.

> Multivalued property sorted by last/random value
> ------------------------------------------------
>
>                 Key: JCR-2906
>                 URL: https://issues.apache.org/jira/browse/JCR-2906
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: indexing
>    Affects Versions: 2.2
>         Environment: Windows 7, Sun JDK 1.6.0_23
>            Reporter: Paul Lysak
>              Labels: multivalued, sort
>         Attachments: JCR-2906-SharedFieldCache.patch, JCR-2906-v2.patch, JCR-2906-v3.patch,
JCR-2906-v4.patch, JCR-2906-v5.patch, JCR-2906.patch
>
>
> Sorting on multivalued property may produce incorrect result because sorting is performed only by last
value of multivalued property.
> Steps to reproduce:
> 1. Create multivalued field in repository. Example from nodetypes file:
(Continue reading)

Picon
Favicon

[Commented] (JCR-2906) Multivalued property sorted by last/random value


    [
https://issues.apache.org/jira/browse/JCR-2906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160801#comment-13160801
] 

Alex Parvulescu commented on JCR-2906:
--------------------------------------

fantastic! I'll apply the patch shortly.

> Multivalued property sorted by last/random value
> ------------------------------------------------
>
>                 Key: JCR-2906
>                 URL: https://issues.apache.org/jira/browse/JCR-2906
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: indexing
>    Affects Versions: 2.2
>         Environment: Windows 7, Sun JDK 1.6.0_23
>            Reporter: Paul Lysak
>              Labels: multivalued, sort
>         Attachments: JCR-2906-SharedFieldCache.patch, JCR-2906-v2.patch, JCR-2906-v3.patch,
JCR-2906-v4.patch, JCR-2906-v5.patch, JCR-2906.patch
>
>
> Sorting on multivalued property may produce incorrect result because sorting is performed only by last
value of multivalued property.
> Steps to reproduce:
> 1. Create multivalued field in repository. Example from nodetypes file:
(Continue reading)

Felix Meschberger | 1 Dec 2011 11:59
Picon
Favicon
Gravatar

Re: [jr3 microkernel] Write skew

Hi,

Am 30.11.2011 um 21:53 schrieb Jukka Zitting:

> Hi,
> 
> On Wed, Nov 30, 2011 at 3:21 PM, Michael Dürig <mduerig <at> apache.org> wrote:
>> 1) Does visible mean immediately visible on next access or visible after
>> refresh? The second case would work with snapshot isolation.
> 
> That's up the implementation.
> 
> Section 10.11.1 of JSR 283 [1] explicitly allows changes to become
> visible only after a refresh: "[...] items that do not have changes
> pending have their state refreshed to reflect the current persisted
> state, thus revealing changes made by other sessions."

Ok. Thanks for the clarification.

I always thought, what Jackrabbit currently does is required ... So we (thinking of Sling amongst other
things) might have to adapt our event listeners to do a Session.refresh at the beginning of the onEvent
method (in case long lived sessions are used).

> 
> More generally about the write skew -issue; I don't think that's a
> common problem in practice. There aren't too many clients that
> explicitly interleave operations of multiple sessions within a single
> thread. And in a multithreaded setup a client would even with
> Jackrabbit 2.x need to use explicit synchronization to enforce more
> complex content constraints.
(Continue reading)

Picon
Favicon

[Resolved] (JCR-3164) Add minimal maintenance API to TokenBasedAuthentication


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

Felix Meschberger resolved JCR-3164.
------------------------------------

    Resolution: Won't Fix

Thanks for the quick reply.

Reconsidering this idea, I think the minimal API would not make much sense. For real management you might
also want to query existing tokens etc.

So lets drop this for now and pick it up on a real "Token Administration API" level after the refactoring.

> Add minimal maintenance API to TokenBasedAuthentication
> -------------------------------------------------------
>
>                 Key: JCR-3164
>                 URL: https://issues.apache.org/jira/browse/JCR-3164
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: 2.3.4
>            Reporter: Felix Meschberger
>            Assignee: angela
>
> Currently the TokenBasedAuthentication class creates token nodes on demand and will only remove a
token's node if the token is used after it has expired. To be able to do some token maintenance in down stream
(Continue reading)

Picon
Favicon

[Assigned] (JCR-3163) NPE in RepositoryServiceImpl.getPropertyInfo()


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

Tobias Bocanegra reassigned JCR-3163:
-------------------------------------

    Assignee: Tobias Bocanegra  (was: angela)

> NPE in RepositoryServiceImpl.getPropertyInfo()
> ----------------------------------------------
>
>                 Key: JCR-3163
>                 URL: https://issues.apache.org/jira/browse/JCR-3163
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi2dav
>    Affects Versions: 2.3.3, 2.3.4
>            Reporter: Tobias Bocanegra
>            Assignee: Tobias Bocanegra
>             Fix For: 2.4
>
>
> under unknown conditions, i get a NPE in get property info, such as the 'getValue()' of the getstring dav
property is null:
>             } else if (props.contains(JCR_GET_STRING)) {
>                 // single valued non-binary property
>                 String str = props.get(JCR_GET_STRING).getValue().toString();
>                 QValue qValue = ValueFormat.getQValue(str, propertyType, getNamePathResolver(sessionInfo), getQValueFactory(sessionInfo));
>                 return new PropertyInfoImpl(propertyId, p, propertyType, qValue);
(Continue reading)

Picon
Favicon

[Resolved] (JCR-3163) NPE in RepositoryServiceImpl.getPropertyInfo()


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

Tobias Bocanegra resolved JCR-3163.
-----------------------------------

    Resolution: Fixed

fixed for good and added test-case (thanks angela).

> NPE in RepositoryServiceImpl.getPropertyInfo()
> ----------------------------------------------
>
>                 Key: JCR-3163
>                 URL: https://issues.apache.org/jira/browse/JCR-3163
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi2dav
>    Affects Versions: 2.3.3, 2.3.4
>            Reporter: Tobias Bocanegra
>            Assignee: Tobias Bocanegra
>             Fix For: 2.4
>
>
> under unknown conditions, i get a NPE in get property info, such as the 'getValue()' of the getstring dav
property is null:
>             } else if (props.contains(JCR_GET_STRING)) {
>                 // single valued non-binary property
>                 String str = props.get(JCR_GET_STRING).getValue().toString();
(Continue reading)


Gmane