You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Les Hazlewood <lh...@apache.org> on 2013/09/13 20:39:41 UTC

Re: Best practice for managing different shiro.ini files for different environment?

Hi Richard,

You're right, ini isn't too well suited for this use case.  It was always
meant to be a simple config format, without too many 'frills'.  That being
said, do you have any suggestions on how you would want this to work?

For example, Spring has the notion of a PropertiesPlaceholderConfigurer (a
mouthful) that allows you to configure one or more .properties files, and
those properties are 'merged' into one file 'view' at startup.  Other beans
then reference those properties, e.g.

<property name="foo" value="${my.property.here}"/>

Depending on which environment-specific .properties file might have been
loaded, my.property.here resolves to the environment-specific value.

Is this something along the lines of what you'd like to see?  If not, what
might that be?  I think we're open to suggestions here - it's just without
Jira issues/feature requests, this stuff won't be improved.

Cheers,

--
Les Hazlewood | @lhazlewood
CTO, Stormpath | http://stormpath.com | @goStormpath | 888.391.5282


On Fri, Aug 30, 2013 at 3:07 PM, richard@localmed.com
<ri...@localmed.com>wrote:

> I think JNDI is not really suitable as a general solution to the problem.
> Although I gave the example of the database connections because I thought
> that would be the most common example familiar to people, we have several
> other parameters that need to be controlled across environments.  Another
> example is a custom filter for a proxy server for some of the environments.
> A future example might be for supporting entirely different realms across
> different servers.  An additional complexity is our plan to isolate the
> different environments in separate networks (AWS VPCs), which would limit
> access to network resources.  So I think a more general approach to
> managing
> separate shiro.ini sections might be needed.
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Best-practice-for-managing-different-shiro-ini-files-for-different-environment-tp7579099p7579102.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Best practice for managing different shiro.ini files for different environment?

Posted by "richard@localmed.com" <ri...@localmed.com>.
I submitted a patch that takes care of this here:
https://issues.apache.org/jira/browse/SHIRO-445




--
View this message in context: http://shiro-user.582556.n2.nabble.com/Best-practice-for-managing-different-shiro-ini-files-for-different-environment-tp7579099p7579463.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Best practice for managing different shiro.ini files for different environment?

Posted by "richard@localmed.com" <ri...@localmed.com>.
That looks like a reasonable solution if you are using Spring, but I am not. 
A plain old Java solution would still be nice.



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Best-practice-for-managing-different-shiro-ini-files-for-different-environment-tp7579099p7579148.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Best practice for managing different shiro.ini files for different environment?

Posted by Subhrajyoti Moitra <su...@gmail.com>.
You can try this

http://cocoon.apache.org/subprojects/configuration/spring-configurator/

HTH.


On Tue, Sep 17, 2013 at 3:46 AM, richard@localmed.com
<ri...@localmed.com>wrote:

> Hi, Les.
>
> I am really not sure what the best approach is here, which is why I was
> asking for suggestions.  But it seems that some sort of "include" line
> would
> be the simplest approach.  That way, I might be able to include whatever
> configuration I need divided among various files (or even better, URLs).  I
> looked into extending some of the INI file handling to do this, but have
> not
> found a workable solution yet.
>
> + Richard
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Best-practice-for-managing-different-shiro-ini-files-for-different-environment-tp7579099p7579146.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: Best practice for managing different shiro.ini files for different environment?

Posted by "richard@localmed.com" <ri...@localmed.com>.
Hi, Les.

I am really not sure what the best approach is here, which is why I was
asking for suggestions.  But it seems that some sort of "include" line would
be the simplest approach.  That way, I might be able to include whatever
configuration I need divided among various files (or even better, URLs).  I
looked into extending some of the INI file handling to do this, but have not
found a workable solution yet.

+ Richard




--
View this message in context: http://shiro-user.582556.n2.nabble.com/Best-practice-for-managing-different-shiro-ini-files-for-different-environment-tp7579099p7579146.html
Sent from the Shiro User mailing list archive at Nabble.com.