You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2012/10/23 20:36:03 UTC

New UserAdmin impl: roles not loaded after restart

Hi,
I've been playing with the new UserAdmin implementation to see if I can
use it. I wrote a few shell commands to play with adding users, roles
and groups, to set credential, to list roles etc. At first that worked
well. But when I restarted the server, the users I added were gone. I
went looking into the data directory but the users seem to have been
saved correctly. So I went into the source code, and I'm now wondering
if there isn't a little problem with the way the RoleRepositoryStore is
attached. I found that it has the life-cycle methods initialize() and
close() which are called by RoleRepositoryStoreHelper if a
RoleRepositoryStore is available.

    public void initialize() throws IOException {
        RoleRepositoryStore store = getStore();
        if (store != null) {
            store.initialize();
        }
    }

If the store service is started after the UserAdmin service, the
initialize() method is, I think, never called. It seems to me that
having life-cycle methods in the store interface is in conflict with
OSGi's own service life-cycle. I'd expect the service to initialize
itself when it's started. And maybe the UserAdmin service should only
expose itself when it has a store service availble. Am I missing
something?

Thanks,
Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: New UserAdmin impl: roles not loaded after restart

Posted by Jan Willem Janssen <ja...@luminis.eu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/25/12 5:18 PM, Jeremias Maerki wrote:
> Thanks for the quick changes, Jan! I've restarted my server a
> number of times and so far, no anomalies.

You're welcome. Thanks (again) for testing and reporting this!

- -- 
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

/My world is:/

Luminis Technologies B.V.
IJsselburcht 3
6825 BS  Arnhem
+31 88 586 46 30

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQiViiAAoJEKF/mP2eHDc4Q74P/iBIpvLP23XWDFCYWXNTsOMk
wlHeaB7l89n6BFHiRu9WZiW1d8CdDMiz8zmK7djQmMmXl7+O0ZaurWiXNdBiOOVF
QofWAwP943AV2h4ntwxFN24++L8ksW8Ms0edC14vUBchbKNKpFtBXXvl6PDrGU2A
8a+XcDFtOw0S6CQE80cpGTlh46r3ltAivvyaDZT15KU3IsG+Fogp1QwNxZORpLfF
+/wEYNYEspW41L+f3PCaAIVjVngWOEr8mbv4iYTFEmAGU0Vs6ue7W9Aojut0jPtg
Q7YFww4kUdV6VrPd4keWmVK1W5LAUmMlsSufQv45qU9kG1ep7pOYW1NBUfQvp3kR
gdDA+oKupBWhJw6dxzQWzxjaI6UbmRhlb4UoiF5fXO227GiMgeVWc0T30nsZk4jp
1hE3t1IBsN/enyXdGlSrGk017I0V5Of84ffLXAz+cE7L145ZkWPXxtJ4c7VY+qGO
sIpHkOIv6a2kReh6hdUoSibeywTCkQa08sdxUbL3asxsaSF1jH+sv3ONrzSwIkKW
hw2Mw9RqTEoH21rLm99Z5BQDliXDPgyws35uWFzswBpsfS4Uc8SL9VlmECOcsNzX
aJpwZQIYWokGFbt6bZbNKrk4VPEDHhqo/gwiiwGTTL+I3yAVmDxcZzgZsy96GldM
0/aS8piX+Pibp/Tzweej
=ROWs
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: New UserAdmin impl: roles not loaded after restart

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Thanks for the quick changes, Jan! I've restarted my server a number of
times and so far, no anomalies.


Jeremias Maerki


On 25.10.2012 11:47:49 Jan Willem Janssen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Jeremias,
> 
> > ... If the store service is started after the UserAdmin service,
> > the initialize() method is, I think, never called. It seems to me
> > that having life-cycle methods in the store interface is in
> > conflict with OSGi's own service life-cycle. I'd expect the service
> > to initialize itself when it's started. And maybe the UserAdmin
> > service should only expose itself when it has a store service
> > availble. Am I missing something?
> 
> You're not missing anything; your observations are correct. I've
> missed this in my local test cases. I've created a JIRA issue to fix this:
> <https://issues.apache.org/jira/browse/FELIX-3735>
> 
> Thanks for mentioning this,
> 
> - -- 
> Met vriendelijke groeten | Kind regards
> 
> Jan Willem Janssen | Software Architect
> +31 631 765 814
> 
> /My world is:/
> 
> Luminis Technologies B.V.
> IJsselburcht 3
> 6825 BS  Arnhem
> +31 88 586 46 30
> 
> http://www.luminis-technologies.com
> http://www.luminis.eu
> 
> KvK (CoC) 09 16 28 93
> BTW (VAT) NL8169.78.566.B.01
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> 
> iQIcBAEBAgAGBQJQiQrEAAoJEKF/mP2eHDc4ZnMQAJ+kmsBkA5jGhrsHSyh9B0L3
> g5RhjTmV58MeIAJmkBGm9PPa5t9hj+JMh4hoMiEZ9YxBvCAGTyBO0C22x0NMg/j7
> GWizlTXimFQz+aS/Vx7ynCwCKLfwKpiHTjT2ACWy3xtMrow0Cm6ALToO8upppDSU
> k7Jbe6H9S+DgezBs2s4Sj9NVlz/mkdwxH7XgUpwuJFs1HUTceCGBxm36k9VbswDC
> +irZijtv9rvivVVW//Lx9X4mSYRo6s2RHMqW4jtzgrlWAMOZx2QZmX3qOBxuLiGV
> M2VHSvtbFPYt2Gcj8HCfr297K3sdEGAe4R43FIj2owUTOW6YzTv+hqvde4akznlY
> SvRPL8oQJ3JuE9pzOnfVadsoBWga3Vy20S3PJjoyCWTVk+rr6H3gL6y5pSPrvxHF
> t+B9z0lGD0PYSx/pVov1GJUkBGc/60ANg697PBxIoCtYrzSoAjZM/ZBqSTTk6wYw
> gfI3U43UkdaejsNSeQVJT1Q6Uq69l0xaOyJi+MX2XFKnSHushieKsj13kTtFKJpW
> SYtFdz5PJB3k627PvrIjPRL+op+iwbBkQkU4+6PMLhx9DM/AYaiFpGpBrJLzAvWz
> RWM5g/36mjoFsxMFUU/nCHqk9GernNs9ipw4yC+2shNR12ycMyrMREw22DKLgTMt
> ez8Wl4mHB2E35rUube4O
> =94LY
> -----END PGP SIGNATURE-----
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: New UserAdmin impl: roles not loaded after restart

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Thanks, Jan! I'll watch the ticket and help test once you get to this.

BTW, just in case there's interest: I wrote a little bundle that
populates the UserAdmin from a configuration similar to the way
PaxLogging is configured via ConfigAdmin. It only adds users and groups
that don't exist, yet, and sets properties and credentials that have not
been set, yet. It never overwrites anything.

The config looks like this:

group.admin=
group.admin.users=jeremias
group.admin.credential.token=123

group.user.users=jeremias,jane

user.jeremias=
user.jeremias.realname=Jeremias Märki
user.jeremias.credential.password=$2a$10$2uO7mkkpRrp0LKLAIvj2xuha7vEEgUN/3lsop5fWtQ9b7B8EGZ6z.

user.jane.realname=Jane Doe

(empty entries like "group.admin=" above are optional. The user is
automatically added when it's used.)

I've also got some shell commands but they'd need some polishing.

Jeremias Maerki


On 25.10.2012 11:47:49 Jan Willem Janssen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Jeremias,
> 
> > ... If the store service is started after the UserAdmin service,
> > the initialize() method is, I think, never called. It seems to me
> > that having life-cycle methods in the store interface is in
> > conflict with OSGi's own service life-cycle. I'd expect the service
> > to initialize itself when it's started. And maybe the UserAdmin
> > service should only expose itself when it has a store service
> > availble. Am I missing something?
> 
> You're not missing anything; your observations are correct. I've
> missed this in my local test cases. I've created a JIRA issue to fix this:
> <https://issues.apache.org/jira/browse/FELIX-3735>
> 
> Thanks for mentioning this,
> 
> - -- 
> Met vriendelijke groeten | Kind regards
> 
> Jan Willem Janssen | Software Architect
> +31 631 765 814
> 
> /My world is:/
> 
> Luminis Technologies B.V.
> IJsselburcht 3
> 6825 BS  Arnhem
> +31 88 586 46 30
> 
> http://www.luminis-technologies.com
> http://www.luminis.eu
> 
> KvK (CoC) 09 16 28 93
> BTW (VAT) NL8169.78.566.B.01
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
> 
> iQIcBAEBAgAGBQJQiQrEAAoJEKF/mP2eHDc4ZnMQAJ+kmsBkA5jGhrsHSyh9B0L3
> g5RhjTmV58MeIAJmkBGm9PPa5t9hj+JMh4hoMiEZ9YxBvCAGTyBO0C22x0NMg/j7
> GWizlTXimFQz+aS/Vx7ynCwCKLfwKpiHTjT2ACWy3xtMrow0Cm6ALToO8upppDSU
> k7Jbe6H9S+DgezBs2s4Sj9NVlz/mkdwxH7XgUpwuJFs1HUTceCGBxm36k9VbswDC
> +irZijtv9rvivVVW//Lx9X4mSYRo6s2RHMqW4jtzgrlWAMOZx2QZmX3qOBxuLiGV
> M2VHSvtbFPYt2Gcj8HCfr297K3sdEGAe4R43FIj2owUTOW6YzTv+hqvde4akznlY
> SvRPL8oQJ3JuE9pzOnfVadsoBWga3Vy20S3PJjoyCWTVk+rr6H3gL6y5pSPrvxHF
> t+B9z0lGD0PYSx/pVov1GJUkBGc/60ANg697PBxIoCtYrzSoAjZM/ZBqSTTk6wYw
> gfI3U43UkdaejsNSeQVJT1Q6Uq69l0xaOyJi+MX2XFKnSHushieKsj13kTtFKJpW
> SYtFdz5PJB3k627PvrIjPRL+op+iwbBkQkU4+6PMLhx9DM/AYaiFpGpBrJLzAvWz
> RWM5g/36mjoFsxMFUU/nCHqk9GernNs9ipw4yC+2shNR12ycMyrMREw22DKLgTMt
> ez8Wl4mHB2E35rUube4O
> =94LY
> -----END PGP SIGNATURE-----
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org