[jboss-cvs] JBossAS SVN: r70124 - in projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity: extensions and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 26 14:00:55 EST 2008
Author: anil.saldhana at jboss.com
Date: 2008-02-26 14:00:55 -0500 (Tue, 26 Feb 2008)
New Revision: 70124
Added:
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentity.java
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentityFactory.java
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/OpenIdIdentity.java
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/SAMLIdentity.java
projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/WSTrustIdentity.java
Log:
SECURITY-123: Identity interface extensions
Added: projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentity.java
===================================================================
--- projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentity.java (rev 0)
+++ projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentity.java 2008-02-26 19:00:55 UTC (rev 70124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.identity.extensions;
+
+import org.jboss.security.identity.Identity;
+
+/**
+ * An identity with credential
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 25, 2008
+ * @version $Revision$
+ */
+public interface CredentialIdentity extends Identity
+{
+ /**
+ * Return a credential
+ * @return
+ */
+ Object getCredential();
+
+ /**
+ * Set a credential
+ * @param credential
+ */
+ void setCredential(Object credential);
+}
Added: projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentityFactory.java
===================================================================
--- projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentityFactory.java (rev 0)
+++ projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/extensions/CredentialIdentityFactory.java 2008-02-26 19:00:55 UTC (rev 70124)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.identity.extensions;
+
+import java.security.Principal;
+import java.security.acl.Group;
+
+import org.jboss.security.identity.Role;
+
+/**
+ * Factory to create Credential Identity
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 25, 2008
+ * @version $Revision$
+ */
+public class CredentialIdentityFactory
+{
+ public static CredentialIdentity createIdentity(final Principal principal,
+ final Object cred)
+ {
+ return createIdentity(principal,cred, null);
+ }
+
+ public static CredentialIdentity createIdentity(final Principal principal,
+ final Object cred, final Role roles)
+ {
+ return new CredentialIdentity()
+ {
+ public Object getCredential()
+ {
+ return cred;
+ }
+
+ public void setCredential(Object credential)
+ {
+ }
+
+ public Group asGroup()
+ {
+ return null;
+ }
+
+ public Principal asPrincipal()
+ {
+ return principal;
+ }
+
+ public String getName()
+ {
+ return principal.getName();
+ }
+
+ public Role getRole()
+ {
+ return roles;
+ }
+ };
+ }
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/OpenIdIdentity.java
===================================================================
--- projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/OpenIdIdentity.java (rev 0)
+++ projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/OpenIdIdentity.java 2008-02-26 19:00:55 UTC (rev 70124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.identity.fed;
+
+import org.jboss.security.identity.Identity;
+
+/**
+ * Interface for a OpenID Identity
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 25, 2008
+ * @version $Revision$
+ */
+public interface OpenIdIdentity<T> extends Identity
+{
+ /**
+ * Return the underlying SAML Object
+ * @return
+ */
+ T getOpenIdObject();
+
+ /**
+ * Set the underlying SAML Object
+ * @param t
+ */
+ void setOpenIdObject(T t);
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/SAMLIdentity.java
===================================================================
--- projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/SAMLIdentity.java (rev 0)
+++ projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/SAMLIdentity.java 2008-02-26 19:00:55 UTC (rev 70124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.identity.fed;
+
+import org.jboss.security.identity.Identity;
+
+/**
+ * Interface for a SAML Identity
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 25, 2008
+ * @version $Revision$
+ */
+public interface SAMLIdentity<T> extends Identity
+{
+ /**
+ * Return the underlying SAML Object
+ * @return
+ */
+ T getSAMLObject();
+
+ /**
+ * Set the underlying SAML Object
+ * @param t
+ */
+ void setSAMLObject(T t);
+}
\ No newline at end of file
Added: projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/WSTrustIdentity.java
===================================================================
--- projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/WSTrustIdentity.java (rev 0)
+++ projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/WSTrustIdentity.java 2008-02-26 19:00:55 UTC (rev 70124)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.identity.fed;
+
+import org.jboss.security.identity.Identity;
+
+/**
+ * Interface for a WS-Trust based Identity
+ * @author Anil.Saldhana at redhat.com
+ * @since Feb 25, 2008
+ * @version $Revision$
+ */
+public interface WSTrustIdentity<T> extends Identity
+{
+ /**
+ * Return the underlying SAML Object
+ * @return
+ */
+ T getWSTrustToken();
+
+ /**
+ * Set the underlying SAML Object
+ * @param t
+ */
+ void setWSTrustToken(T t);
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list