You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Jan Grant <Ja...@bristol.ac.uk> on 2002/08/05 15:49:23 UTC
Security 1.4: more implement[eo]r feedback on provider APIs
I recently raised the issue that the security provider APIs don't supply
all of the context explicitly as part of their method signatures (eg,
logout() should be logout(User) )
This is proving to be a bit more than an aesthetic issue.
[background]
The project I'm involved in is using Jetspeed as a framework for a bunch
of services for UK HE. One of our requirements is that we support a
number of different authentication mechanisms; these may potentially be
selected dynamically.
The approach we're taking is to write each mechanism as a plugin
provider. The plan is to use an overarching multiplexer that can
delegate to other, simpler providers based on runtime criteria.
However, the current interface is full of implicit points where the
security provider API is circumvented by direct calls to the underlying
rundata, for instance:
[this is from UserManagement.java]
/**
* Retrieves a <code>JetspeedUser</code> given the primary principle.
* The principal can be any valid Jetspeed Security Principal:
* <code>org.apache.jetspeed.om.security.UserNamePrincipal</code>
* <code>org.apache.jetspeed.om.security.UserIdPrincipal</code>
*
* The security service may optionally check the current user context
* to determine if the requestor has permission to perform this action.
*
* @param principal a principal identity to be retrieved.
* @return a <code>JetspeedUser</code> associated to the principal identity.
* @exception UserException when the security provider has a general failure retrieving a user.
* @exception UnknownUserException when the security provider cannot match
* the principal identity to a user.
* @exception InsufficientPrivilegeException when the requestor is denied due to insufficient privilege
*/
JetspeedUser getUser(Principal principal)
throws JetspeedSecurityException;
The problem is with the second paragraph. I'd like to see these
interfaces modified to pass context explicitly, that is:
JetspeedUser getUser(Principal principal, JetspeedUser userContext)
throws ...etc;
The motivation for this is to permit providers to be written as plugins
that may be called from other plugins (ie, using a simple multiplexing
security provider supported by a MultiplexingJetspeedUser class), which
I hope is a more concrete motivation for this modification than the -
primarily aesthetic - arguments I provided earlier.
We're currently working around this by using a bridge to a very similar
set of security provider plugins; however, this currently prevents
"black-box" reuse of the existing turbine provider, which is a shame.
Cheers,
jan
--
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Semantic rules, OK?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Security 1.4: more implement[eo]r feedback on provider APIs
Posted by David Sean Taylor <da...@bluesunrise.com>.
Jan,
I don't have a problem with adding a 'context' (current user) parameter to
the interfaces.
Could you send your proposed changes to the interfaces to this list?
That way we can have the other developers comment on your proposal.
Thanks,
David
> -----Original Message-----
> From: Jan Grant [mailto:Jan.Grant@bristol.ac.uk]
> Sent: Tuesday, August 06, 2002 5:52 AM
> To: Jetspeed Developers List
> Subject: RE: Security 1.4: more implement[eo]r feedback on provider APIs
>
>
> On Mon, 5 Aug 2002, David Sean Taylor wrote:
>
> > I believe at first you only wanted to change the logout method.
> Am I correct
> > to say that now you want to change all the security calls to
> explicity pass
> > in the current user?
>
> Basically, my first pass was with authentication only, because logout
> stood out from the crowd. I took a closer look at the other interfaces;
> in the light of that, I think that wherever the current user has a
> (potential) bearing on security provider decisions (ie, where the
> javadoc says "provider may use current user from context to determine
> whether to do this" or words to that effect), then the user should be
> passed as part of the interface.
>
> This principally came to light when I was trying to create a
> multiplexing security provider (basically a "Composite" that was
> supported by a composite JetspeedUser) and ran into trouble using the
> supplied turbine provider with it.
>
>
>
> --
> jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
> Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
> Scrabble gematria: "BIBLE" = "DOGMA"
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Security 1.4: more implement[eo]r feedback on provider APIs
Posted by Jan Grant <Ja...@bristol.ac.uk>.
On Mon, 5 Aug 2002, David Sean Taylor wrote:
> I believe at first you only wanted to change the logout method. Am I correct
> to say that now you want to change all the security calls to explicity pass
> in the current user?
Basically, my first pass was with authentication only, because logout
stood out from the crowd. I took a closer look at the other interfaces;
in the light of that, I think that wherever the current user has a
(potential) bearing on security provider decisions (ie, where the
javadoc says "provider may use current user from context to determine
whether to do this" or words to that effect), then the user should be
passed as part of the interface.
This principally came to light when I was trying to create a
multiplexing security provider (basically a "Composite" that was
supported by a composite JetspeedUser) and ran into trouble using the
supplied turbine provider with it.
--
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Scrabble gematria: "BIBLE" = "DOGMA"
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Security 1.4: more implement[eo]r feedback on provider APIs
Posted by David Sean Taylor <da...@bluesunrise.com>.
I believe at first you only wanted to change the logout method. Am I correct
to say that now you want to change all the security calls to explicity pass
in the current user?
> -----Original Message-----
> From: Jan Grant [mailto:Jan.Grant@bristol.ac.uk]
> Sent: Monday, August 05, 2002 6:49 AM
> To: Jetspeed Developers List
> Subject: Security 1.4: more implement[eo]r feedback on provider APIs
>
>
> I recently raised the issue that the security provider APIs don't supply
> all of the context explicitly as part of their method signatures (eg,
> logout() should be logout(User) )
>
> This is proving to be a bit more than an aesthetic issue.
>
> [background]
> The project I'm involved in is using Jetspeed as a framework for a bunch
> of services for UK HE. One of our requirements is that we support a
> number of different authentication mechanisms; these may potentially be
> selected dynamically.
>
> The approach we're taking is to write each mechanism as a plugin
> provider. The plan is to use an overarching multiplexer that can
> delegate to other, simpler providers based on runtime criteria.
>
> However, the current interface is full of implicit points where the
> security provider API is circumvented by direct calls to the underlying
> rundata, for instance:
>
> [this is from UserManagement.java]
>
> /**
> * Retrieves a <code>JetspeedUser</code> given the primary principle.
> * The principal can be any valid Jetspeed Security Principal:
> * <code>org.apache.jetspeed.om.security.UserNamePrincipal</code>
> * <code>org.apache.jetspeed.om.security.UserIdPrincipal</code>
> *
> * The security service may optionally check the current user context
> * to determine if the requestor has permission to perform
> this action.
> *
> * @param principal a principal identity to be retrieved.
> * @return a <code>JetspeedUser</code> associated to the
> principal identity.
> * @exception UserException when the security provider has a
> general failure retrieving a user.
> * @exception UnknownUserException when the security provider
> cannot match
> * the principal identity to a user.
> * @exception InsufficientPrivilegeException when the
> requestor is denied due to insufficient privilege
> */
> JetspeedUser getUser(Principal principal)
> throws JetspeedSecurityException;
>
>
> The problem is with the second paragraph. I'd like to see these
> interfaces modified to pass context explicitly, that is:
>
> JetspeedUser getUser(Principal principal, JetspeedUser userContext)
> throws ...etc;
>
>
> The motivation for this is to permit providers to be written as plugins
> that may be called from other plugins (ie, using a simple multiplexing
> security provider supported by a MultiplexingJetspeedUser class), which
> I hope is a more concrete motivation for this modification than the -
> primarily aesthetic - arguments I provided earlier.
>
>
> We're currently working around this by using a bridge to a very similar
> set of security provider plugins; however, this currently prevents
> "black-box" reuse of the existing turbine provider, which is a shame.
>
> Cheers,
> jan
>
>
> --
> jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
> Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
> Semantic rules, OK?
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>