New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add PrincipalInterface and cleanup docs #31
Conversation
what does this mean for jackalope? will we have a problem updating phpcr? |
we don't implement the security chapter at all atm, so no changes in jackalope. the only difference is that now it would be theoretically implementable, because the php interfaces do not contain references to java classes anymore. i would love to get some feedback on our take on the Principal interface. management summary is that the repo implementation needs to persist permissions and serializing user objects to do that is not a good approach, so it needs something else to persist that can be compared later. hence the hashCode method. |
to better understand about the hashcode, this helped us: http://www.javapractices.com/topic/TopicAction.do?Id=28 |
ok .. then i of course have no issue with seeing this added. now the big task for us in general is to finally ensure that jackrabbit exposes everything we need via davex. maybe we need to post to the JSR-333 list that we need this to complete the reference implementation of PHPCR. |
* However it should be unique inside your application for different | ||
* principals. | ||
* | ||
* @return string a hashcode for this principal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i start to worry if it is a good idea to return string here. the problem is that for the integration with jackrabbit, we will need an integer, and it will be impossible to have the same user in java and php if we convert the string hash to some int hash.
so maybe we should say int here and when we implement the interfaces provide a helper in phpcr-utils similar to this java helper http://www.javapractices.com/topic/TopicAction.do?Id=28
its a bit more painful to use (and also to debug in storage) but would better integrate with jackrabbit/jcr. what do you think?
any inputs on my comment whether hashcode should be string or int? |
for cross compatibility e.g. with jackrabbit, int seems the better choice to me, so we should change this. |
like i said .. i don't know the spec in this part very well .. but if the spec leaves it open, but it looks like using integers will make jackrabbit compat easier, then lets use integer. maybe also double check with Jukka in regards to Oak. |
the principal is a port from the java.security.Principal - it is not even part of JCR. i guess we have no choice here but to go with int. i will update the pull request. |
…java, add methods to principal and document a bit
Conflicts: doc/JCR_TO_PHPCR.txt
add PrincipalInterface and cleanup docs
@sixty-nine and i reviewed this section and we added a "principal" interface because there seems to be nothing fitting in php.
does it make sense like this?
note that for jackalope-jackrabbit, we can't really implement it right now, it first needs to be supported by the jackrabbit davex component. but we need to clean things up so that jsr-333 can ship with valid interfaces.
/cc @bergie, @lsmith77, @chregu