無料のSSL証明書を発行するCAcertという団体があるので、試してみる。でも、無料と言っても、結局は、CAcertがブラウザに登録されていないので、自前で作った証明書とたいして変わらん気がするけど・・・。まぁ、そんな感じで、とりあえず、試す。まず、サーバ用の秘密キーを作る。ちなみに、CentOS4で試しました。
# cd /usr/share/ssl/certs/ # make server.key umask 77 ; \ /usr/bin/openssl genrsa -des3 1024 > server.key Generating RSA private key, 1024 bit long modulus ................++++++ ...................................++++++ e is 65537 (0x10001) Enter pass phrase: <=== パスワード Verifying - Enter pass phrase: <=== パスワード # openssl rsa -in server.key -out server.key Enter pass phrase for server.key: writing RSA key
まぁ、これはいつも通りかね。次に、サーバ証明書の要求(csr)ファイルを作る。
# make server.csr
umask 77 ; \
/usr/bin/openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
JSR-203 Early Draft Review
メモ。ファイルシステムAPIみたいな話があるのね。
UserManagerをみる
数万ユーザーの現実的な管理に向けて、調べ始める。Jetspeed API の UserManager から見ていく。見ていくと、いかような感じで呼ばれていく。
./components/security/src/java/org/apache/jetspeed/security/impl/UserManagerImpl.java:
public Iterator getUsers(String filter) throws SecurityException
{
List users = new LinkedList();
Iterator userPrincipals = atnProviderProxy.getUserPrincipals(filter)
.iterator();
while (userPrincipals.hasNext())
{
String username = ((Principal) userPrincipals.next()).getName();
User user = getUser(username);
users.add(user);
}
return users.iterator();
}
./components/security/src/java/org/apache/jetspeed/security/impl/AuthenticationProviderProxyImpl.java
public List getUserPrincipals(String filter)
{
List userPrincipals = new LinkedList();
for (int i = 0; i < authenticationProviders.size(); i++)
{
userPrincipals.addAll(((AuthenticationProvider)authenticationProviders.get(i)).getUserSecurityHandler().getUserPrincipals(filter));
}
return userPrincipals;
}
./components/security/src/java/org/apache/jetspeed/security/spi/impl/DefaultUserSecurityHandler.java:
public List getUserPrincipals(String filter)
{
List userPrincipals = new LinkedList();
Iterator result = securityAccess.getInternalUserPrincipals(filter);
while (result.hasNext())
{
InternalUserPrincipal internalUser = (InternalUserPrincipal) result.next();
String path = internalUser.getFullPath();
if (path == null)
{
continue;
}
userPrincipals.add(new UserPrincipalImpl(UserPrincipalImpl.getPrincipalNameFromFullPath(internalUser.getFullPath())));
}
return userPrincipals;
}
./components/security/src/java/org/apache/jetspeed/security/spi/impl/SecurityAccessImpl.java
public Iterator getInternalUserPrincipals(String filter)
{
Criteria queryCriteria = new Criteria();
queryCriteria.addEqualTo("isMappingOnly", new Boolean(false));
queryCriteria.addLike("fullPath", UserPrincipal.PREFS_USER_ROOT + filter + "%");
Query query = QueryFactory.newQuery(InternalUserPrincipalImpl.class, queryCriteria);
Iterator result = getPersistenceBrokerTemplate().getIteratorByQuery(query);
return result;
}
と言う感じで、OJBを呼んでいる(UserManager に渡すフィルタは、ユーザー名に含まれる文字列じゃなくて、フィルタの文字列で始まるユーザー名を引っ張ってくるのね)。で、OJBでページングができれば、問題解決なのだが、OJBのFAQを見ると、できんと言っている。IteratorかCollectionで取得して、自分で取り出せという感じみたい。うーん・・・、別な方法を考えよっと・・・。
http://db.apache.org/ojb/docu/faq.html
追記:Jetspeedで使っているOJBのバージョンは、1.0.3だけど、そのソースコードを見ると、QueryにsetStartAtIndexとsetEndAtIndexみたいのがあることに気がつく。その周辺のコードをみても、それらを使えば、良さそうな気がしてくる。というわけで、これで試してみよう。