Community
Participate
Working Groups
The SecureStorageCredentialsService implementation of an IOrionCredentialsService defines its own userId format. The admin user has the userId "admin" and all other users have userId generated using a Base64Counter. This conflicts with an IMetaStore implementation. An implementation cannot define it's own format for userId. For now, the simple metadata storage ( Bug 412995 ) has to assume that userInfo.getUniqueId() cannot be null and is already a valid value passed into a call to IMetaStore.createUser(UserInfo userInfo). I then create a hierarchy using the userInfo.getUserName (LoginName). Unfortunately this means when I get the call IMetaStore.readUser(String userId), I have to do a lookup based on userId equality that I do not want to do because I do not know the userId format. I save the userId in the MetaStore, but I cannot take advantage of it for a fast lookup. We need to update so that the IMetaStore can define the userId.
I have delivered a change for review to : http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?h=ah-Bug414592&id=c3304cd7572681a1b8828f67a23949665d863770 The current pattern is that we call IOrionCredentialsService.createUser() and then IMetaStore.createUser(). The userId generated by IOrionCredentialsService.createUser() is given to the IMetaStore.createUser(). As well, both the current implementations SecureStorageCredentialsService ( IOrionCredentialsService ) and CompatibilityMetaStore ( IMetaStore ) use the same Base64Counter counter to generate the userId. I have found that we can swap the order of the current implementation and everything continues to work correctly. IMetaStore.createUser() is called before IOrionCredentialsService.createUser() and IMetaStore generates the userId. The order change is needed in three places. By making this small change, I can define a different format for userId in my SimpleMetaStore ( IMetaStore ). I would like the change reviewed however just in case I missed something. All server JUnits continue to pass.
A second commit is at http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?h=ah-Bug414592&id=ea34d2eb5e44d0bfbcfcb173f4d0e54ca5e27162 which has the SimpleMetaStore and MetaStoreTests adoption of the changes. In both cases it was expected that the caller passed in the userId for IMetaStore.createUser(). Now IMetaStore generated the userId.
Merged both commits into master.