This content has been marked as final.
Show 4 replies
-
1. Re: Identity Representation
anil.saldhana May 8, 2008 4:35 PM (in response to anil.saldhana)An earlier representation I generated 2-3 months back is represented here:
SPI: http://anonsvn.jboss.org/repos/jbossas/projects/security/security-spi/trunk/identity/
Impl:
http://anonsvn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/identity/ -
2. Re: Identity Representation
anil.saldhana May 8, 2008 4:44 PM (in response to anil.saldhana)Identity:
/** * Identity of an entity (user, process etc) */ public interface Identity extends Serializable { /** * Get the name of the identity */ public String getName(); /** * Get the Role (Role or RoleGroup) */ public Role getRole(); /** * Return a Group only if it has been set */ public Group asGroup(); /** * Returns a Principal only if it set */ public Principal asPrincipal(); }
Role: (We use RoleGroup to represent nested roles)/** * Represents a Role */ public interface Role extends Serializable { /** * Get Name of the Role */ public String getRoleName(); /** * Get type of role * @return simple,group */ public RoleType getType(); /** * Indicate whether the argument role is equal or contained * depending on the role-type */ public boolean containsAll(Role anotherRole); /** * Gets a reference to the parent role, if one is available.*/ public Role getParent(); }
RoleGroup:/** * Represents a group of roles */ public interface RoleGroup extends Role { /** * Get the roles contained */ public List<Role> getRoles(); /** * Add a role */ public void addRole(Role aRole); /** * Clear all the roles */ public void clearRoles(); /** * Remove a role */ public void removeRole(Role aRole); /** * Validates whether a simple role is available * @param aRole simple role */ public boolean containsRole(Role aRole); /** * Validates whether there is at least one matching * role in "anotherRoleGroup" */ public boolean containsAtleastOneRole(RoleGroup anotherRoleGroup); }
RoleType:/** * Type of Role */ public enum RoleType { simple,group; }
-
3. Some Examples of Identity
anil.saldhana May 8, 2008 4:48 PM (in response to anil.saldhana)/** * An identity with credential */ public interface CredentialIdentity<T> extends Identity { /** * Return a credential * @return */ T getCredential(); /** * Set a credential * @param credential */ void setCredential(T credential); }
public interface CertificateIdentity extends CredentialIdentity<X509Certificate[]> { }
Representation for Federated Identity is here:
http://anonsvn.jboss.org/repos/jbossas/projects/security/security-spi/trunk/identity/src/main/org/jboss/security/identity/fed/
^^^^^^^^^^ -
4. Identity Plugins and Test Cases
anil.saldhana May 8, 2008 4:57 PM (in response to anil.saldhana)Identity Plugins are located here:
http://anonsvn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/identity/src/main/org/jboss/security/identity/plugins/
Test cases are here:
http://anonsvn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/identity/src/tests/org/jboss/test/identity/impl/