Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Cristiano Gavião
Shiro dev guys,

I'm sent this mail to ask about the deprecation of
org.apache.shiro.web.servlet.IniShiroFilter.

As I try to explain in the user list, the OSGi Spec for HTTP does not
provide a way to register Filter neither Listeners.

But the HTTP API provided by both of the most used osgi containers (Equinox
and Felix) provides a way to register Filters, but lacks a way to register
Listeners.

Don't know when this can happen, actually. People from IBM told me that
maaaaybe it could happen in next version of the OSGi Spec.

So, I would like to ask to the Shiro team to review such deprecation for
now.

regards,

Cristiano
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Les Hazlewood-2
The same effect can be achieved using the now-default ShiroFilter and
register it as you would any other filter.  Is this not possible?

On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião <[hidden email]> wrote:

> Shiro dev guys,
>
> I'm sent this mail to ask about the deprecation of
> org.apache.shiro.web.servlet.IniShiroFilter.
>
> As I try to explain in the user list, the OSGi Spec for HTTP does not
> provide a way to register Filter neither Listeners.
>
> But the HTTP API provided by both of the most used osgi containers (Equinox
> and Felix) provides a way to register Filters, but lacks a way to register
> Listeners.
>
> Don't know when this can happen, actually. People from IBM told me that
> maaaaybe it could happen in next version of the OSGi Spec.
>
> So, I would like to ask to the Shiro team to review such deprecation for
> now.
>
> regards,
>
> Cristiano
--
Les Hazlewood
CTO, Katasoft | http://www.katasoft.com | 888.391.5282
twitter: @lhazlewood | http://twitter.com/lhazlewood
katasoft blog: http://www.katasoft.com/blogs/lhazlewood
personal blog: http://leshazlewood.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Cristiano Gavião
Hi,

Unfortunately not, without have to create some bridged code. Just
because we are stuck in some old servlet api that do not supply a way to
register a listener that is mandatory in the now-default ShiroFilter.

regards

Cristiano

On 19/01/12 19:01, Les Hazlewood wrote:

> The same effect can be achieved using the now-default ShiroFilter and
> register it as you would any other filter.  Is this not possible?
>
> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>  wrote:
>> Shiro dev guys,
>>
>> I'm sent this mail to ask about the deprecation of
>> org.apache.shiro.web.servlet.IniShiroFilter.
>>
>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>> provide a way to register Filter neither Listeners.
>>
>> But the HTTP API provided by both of the most used osgi containers (Equinox
>> and Felix) provides a way to register Filters, but lacks a way to register
>> Listeners.
>>
>> Don't know when this can happen, actually. People from IBM told me that
>> maaaaybe it could happen in next version of the OSGi Spec.
>>
>> So, I would like to ask to the Shiro team to review such deprecation for
>> now.
>>
>> regards,
>>
>> Cristiano

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Les Hazlewood
Administrator
If it is any consolation, the IniShiroFilter, while deprecated, won't
be actually deleted until Shiro 2.x, which I'm sure is a long way
away.  You can continue using the IniShiroFilter until you have the
opportunity to create the bridge code.

Or, if you like, feel free to create a Jira issue for an improvement -
it would be extremely easy to create a subclass of ShiroFilter that
initializes the necessary WebEnvironment at filter startup.  If you
can't use a servlet context listener, this would be the next best
thing and would work as expected.  The EnvironmentLoaderListener is
extremely minimal on purpose - the real work is done in the parent
class, which can be used from a Filter easily.

The only downside of this approach is that other components that might
need to access Shiro objects couldn't do so until the filter was
initialized.  This is why the listener approach is better.  But it
would still be the best available solution for non-listener
environments.

Feel free to open an issue and we can see about getting it in to 1.3.

HTH,

Les

On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião <[hidden email]> wrote:

> Hi,
>
> Unfortunately not, without have to create some bridged code. Just because we
> are stuck in some old servlet api that do not supply a way to register a
> listener that is mandatory in the now-default ShiroFilter.
>
> regards
>
> Cristiano
>
>
> On 19/01/12 19:01, Les Hazlewood wrote:
>>
>> The same effect can be achieved using the now-default ShiroFilter and
>> register it as you would any other filter.  Is this not possible?
>>
>> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>
>>  wrote:
>>>
>>> Shiro dev guys,
>>>
>>> I'm sent this mail to ask about the deprecation of
>>> org.apache.shiro.web.servlet.IniShiroFilter.
>>>
>>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>>> provide a way to register Filter neither Listeners.
>>>
>>> But the HTTP API provided by both of the most used osgi containers
>>> (Equinox
>>> and Felix) provides a way to register Filters, but lacks a way to
>>> register
>>> Listeners.
>>>
>>> Don't know when this can happen, actually. People from IBM told me that
>>> maaaaybe it could happen in next version of the OSGi Spec.
>>>
>>> So, I would like to ask to the Shiro team to review such deprecation for
>>> now.
>>>
>>> regards,
>>>
>>> Cristiano
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Jared Bunting-2
I'd also be interested in if there is a more osgi-ish way to do this.  
My unfamiliarity with OSGI is limiting me here, but I'm curious if
something like a "bundle activator" (mentioned in the parallel thread
by atomicknight) would be a more appropriate way to go.  If it is, I
don't see any reason that we can't add this sort of integration to
Shiro.

-Jared

On Fri 20 Jan 2012 01:44:02 PM CST, Les Hazlewood wrote:

> If it is any consolation, the IniShiroFilter, while deprecated, won't
> be actually deleted until Shiro 2.x, which I'm sure is a long way
> away.  You can continue using the IniShiroFilter until you have the
> opportunity to create the bridge code.
>
> Or, if you like, feel free to create a Jira issue for an improvement -
> it would be extremely easy to create a subclass of ShiroFilter that
> initializes the necessary WebEnvironment at filter startup.  If you
> can't use a servlet context listener, this would be the next best
> thing and would work as expected.  The EnvironmentLoaderListener is
> extremely minimal on purpose - the real work is done in the parent
> class, which can be used from a Filter easily.
>
> The only downside of this approach is that other components that might
> need to access Shiro objects couldn't do so until the filter was
> initialized.  This is why the listener approach is better.  But it
> would still be the best available solution for non-listener
> environments.
>
> Feel free to open an issue and we can see about getting it in to 1.3.
>
> HTH,
>
> Les
>
> On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião <[hidden email]> wrote:
>> Hi,
>>
>> Unfortunately not, without have to create some bridged code. Just because we
>> are stuck in some old servlet api that do not supply a way to register a
>> listener that is mandatory in the now-default ShiroFilter.
>>
>> regards
>>
>> Cristiano
>>
>>
>> On 19/01/12 19:01, Les Hazlewood wrote:
>>>
>>> The same effect can be achieved using the now-default ShiroFilter and
>>> register it as you would any other filter.  Is this not possible?
>>>
>>> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>
>>>  wrote:
>>>>
>>>> Shiro dev guys,
>>>>
>>>> I'm sent this mail to ask about the deprecation of
>>>> org.apache.shiro.web.servlet.IniShiroFilter.
>>>>
>>>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>>>> provide a way to register Filter neither Listeners.
>>>>
>>>> But the HTTP API provided by both of the most used osgi containers
>>>> (Equinox
>>>> and Felix) provides a way to register Filters, but lacks a way to
>>>> register
>>>> Listeners.
>>>>
>>>> Don't know when this can happen, actually. People from IBM told me that
>>>> maaaaybe it could happen in next version of the OSGi Spec.
>>>>
>>>> So, I would like to ask to the Shiro team to review such deprecation for
>>>> now.
>>>>
>>>> regards,
>>>>
>>>> Cristiano


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Les Hazlewood
Administrator
This would make sense to me in OSGi-land:  a (Web)Environment is
started up first and made accessible somewhere in the OSGi container.
Then the ShiroFilter can start up and look up the environment from the
container and use it from that point on.

On Fri, Jan 20, 2012 at 12:01 PM, Jared Bunting
<[hidden email]> wrote:

> I'd also be interested in if there is a more osgi-ish way to do this.
> My unfamiliarity with OSGI is limiting me here, but I'm curious if
> something like a "bundle activator" (mentioned in the parallel thread
> by atomicknight) would be a more appropriate way to go.  If it is, I
> don't see any reason that we can't add this sort of integration to
> Shiro.
>
> -Jared
>
> On Fri 20 Jan 2012 01:44:02 PM CST, Les Hazlewood wrote:
>> If it is any consolation, the IniShiroFilter, while deprecated, won't
>> be actually deleted until Shiro 2.x, which I'm sure is a long way
>> away.  You can continue using the IniShiroFilter until you have the
>> opportunity to create the bridge code.
>>
>> Or, if you like, feel free to create a Jira issue for an improvement -
>> it would be extremely easy to create a subclass of ShiroFilter that
>> initializes the necessary WebEnvironment at filter startup.  If you
>> can't use a servlet context listener, this would be the next best
>> thing and would work as expected.  The EnvironmentLoaderListener is
>> extremely minimal on purpose - the real work is done in the parent
>> class, which can be used from a Filter easily.
>>
>> The only downside of this approach is that other components that might
>> need to access Shiro objects couldn't do so until the filter was
>> initialized.  This is why the listener approach is better.  But it
>> would still be the best available solution for non-listener
>> environments.
>>
>> Feel free to open an issue and we can see about getting it in to 1.3.
>>
>> HTH,
>>
>> Les
>>
>> On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião <[hidden email]> wrote:
>>> Hi,
>>>
>>> Unfortunately not, without have to create some bridged code. Just because we
>>> are stuck in some old servlet api that do not supply a way to register a
>>> listener that is mandatory in the now-default ShiroFilter.
>>>
>>> regards
>>>
>>> Cristiano
>>>
>>>
>>> On 19/01/12 19:01, Les Hazlewood wrote:
>>>>
>>>> The same effect can be achieved using the now-default ShiroFilter and
>>>> register it as you would any other filter.  Is this not possible?
>>>>
>>>> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>
>>>>  wrote:
>>>>>
>>>>> Shiro dev guys,
>>>>>
>>>>> I'm sent this mail to ask about the deprecation of
>>>>> org.apache.shiro.web.servlet.IniShiroFilter.
>>>>>
>>>>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>>>>> provide a way to register Filter neither Listeners.
>>>>>
>>>>> But the HTTP API provided by both of the most used osgi containers
>>>>> (Equinox
>>>>> and Felix) provides a way to register Filters, but lacks a way to
>>>>> register
>>>>> Listeners.
>>>>>
>>>>> Don't know when this can happen, actually. People from IBM told me that
>>>>> maaaaybe it could happen in next version of the OSGi Spec.
>>>>>
>>>>> So, I would like to ask to the Shiro team to review such deprecation for
>>>>> now.
>>>>>
>>>>> regards,
>>>>>
>>>>> Cristiano
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Cristiano Gavião
In reply to this post by Les Hazlewood
On 20/01/12 16:44, Les Hazlewood wrote:
> If it is any consolation, the IniShiroFilter, while deprecated, won't
> be actually deleted until Shiro 2.x, which I'm sure is a long way
> away.  You can continue using the IniShiroFilter until you have the
> opportunity to create the bridge code.
:)   Yes, this is a good consolation, so I can figure out a more
appropriated solution with no hurry.

>
> Or, if you like, feel free to create a Jira issue for an improvement -
> it would be extremely easy to create a subclass of ShiroFilter that
> initializes the necessary WebEnvironment at filter startup.  If you
> can't use a servlet context listener, this would be the next best
> thing and would work as expected.  The EnvironmentLoaderListener is
> extremely minimal on purpose - the real work is done in the parent
> class, which can be used from a Filter easily.
A friend of mine that is a OSGi specialist gives me some ideas how could
I do a servlet that could be used to register Shiros's ServletListener
and bridge with my application using OSGi Events... it seems to be a
good solution too and probably won't need to do anything on Shiro's side.

I will investigate this better, make some hard tests and I will return
with the solution as soon I got it ready...

>
> The only downside of this approach is that other components that might
> need to access Shiro objects couldn't do so until the filter was
> initialized.  This is why the listener approach is better.  But it
> would still be the best available solution for non-listener
> environments.
>
> Feel free to open an issue and we can see about getting it in to 1.3.
Thanks Les... and thanks to all Shiro team for this really nice tool !

>
> HTH,
>
> Les
>
> On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião<[hidden email]>  wrote:
>> Hi,
>>
>> Unfortunately not, without have to create some bridged code. Just because we
>> are stuck in some old servlet api that do not supply a way to register a
>> listener that is mandatory in the now-default ShiroFilter.
>>
>> regards
>>
>> Cristiano
>>
>>
>> On 19/01/12 19:01, Les Hazlewood wrote:
>>> The same effect can be achieved using the now-default ShiroFilter and
>>> register it as you would any other filter.  Is this not possible?
>>>
>>> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>
>>>   wrote:
>>>> Shiro dev guys,
>>>>
>>>> I'm sent this mail to ask about the deprecation of
>>>> org.apache.shiro.web.servlet.IniShiroFilter.
>>>>
>>>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>>>> provide a way to register Filter neither Listeners.
>>>>
>>>> But the HTTP API provided by both of the most used osgi containers
>>>> (Equinox
>>>> and Felix) provides a way to register Filters, but lacks a way to
>>>> register
>>>> Listeners.
>>>>
>>>> Don't know when this can happen, actually. People from IBM told me that
>>>> maaaaybe it could happen in next version of the OSGi Spec.
>>>>
>>>> So, I would like to ask to the Shiro team to review such deprecation for
>>>> now.
>>>>
>>>> regards,
>>>>
>>>> Cristiano

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Deprecation of org.apache.shiro.web.servlet.IniShiroFilter

Cristiano Gavião
In reply to this post by Jared Bunting-2
Hi Jared,
Well, Shiro must be initialized at a bundle activator method or at any
service initialization one, if you are using DS or Blueprint for example.
So, If you are using a OSGi without web Layer, there are any problem. It
is like any other Shiro initialization for common java programs.

The problem here is that my application is a hybrid one, it was born as
a OSGi headless application and the WEB layer was added after that...
and this is why we use the shiro-web.

regards

On 20/01/12 17:01, Jared Bunting wrote:

> I'd also be interested in if there is a more osgi-ish way to do this.
> My unfamiliarity with OSGI is limiting me here, but I'm curious if
> something like a "bundle activator" (mentioned in the parallel thread
> by atomicknight) would be a more appropriate way to go.  If it is, I
> don't see any reason that we can't add this sort of integration to
> Shiro.
>
> -Jared
>
> On Fri 20 Jan 2012 01:44:02 PM CST, Les Hazlewood wrote:
>> If it is any consolation, the IniShiroFilter, while deprecated, won't
>> be actually deleted until Shiro 2.x, which I'm sure is a long way
>> away.  You can continue using the IniShiroFilter until you have the
>> opportunity to create the bridge code.
>>
>> Or, if you like, feel free to create a Jira issue for an improvement -
>> it would be extremely easy to create a subclass of ShiroFilter that
>> initializes the necessary WebEnvironment at filter startup.  If you
>> can't use a servlet context listener, this would be the next best
>> thing and would work as expected.  The EnvironmentLoaderListener is
>> extremely minimal on purpose - the real work is done in the parent
>> class, which can be used from a Filter easily.
>>
>> The only downside of this approach is that other components that might
>> need to access Shiro objects couldn't do so until the filter was
>> initialized.  This is why the listener approach is better.  But it
>> would still be the best available solution for non-listener
>> environments.
>>
>> Feel free to open an issue and we can see about getting it in to 1.3.
>>
>> HTH,
>>
>> Les
>>
>> On Fri, Jan 20, 2012 at 3:36 AM, Cristiano Gavião<[hidden email]>  wrote:
>>> Hi,
>>>
>>> Unfortunately not, without have to create some bridged code. Just because we
>>> are stuck in some old servlet api that do not supply a way to register a
>>> listener that is mandatory in the now-default ShiroFilter.
>>>
>>> regards
>>>
>>> Cristiano
>>>
>>>
>>> On 19/01/12 19:01, Les Hazlewood wrote:
>>>> The same effect can be achieved using the now-default ShiroFilter and
>>>> register it as you would any other filter.  Is this not possible?
>>>>
>>>> On Thu, Jan 19, 2012 at 12:41 PM, Cristiano Gavião<[hidden email]>
>>>>   wrote:
>>>>> Shiro dev guys,
>>>>>
>>>>> I'm sent this mail to ask about the deprecation of
>>>>> org.apache.shiro.web.servlet.IniShiroFilter.
>>>>>
>>>>> As I try to explain in the user list, the OSGi Spec for HTTP does not
>>>>> provide a way to register Filter neither Listeners.
>>>>>
>>>>> But the HTTP API provided by both of the most used osgi containers
>>>>> (Equinox
>>>>> and Felix) provides a way to register Filters, but lacks a way to
>>>>> register
>>>>> Listeners.
>>>>>
>>>>> Don't know when this can happen, actually. People from IBM told me that
>>>>> maaaaybe it could happen in next version of the OSGi Spec.
>>>>>
>>>>> So, I would like to ask to the Shiro team to review such deprecation for
>>>>> now.
>>>>>
>>>>> regards,
>>>>>
>>>>> Cristiano
>

Loading...