Changeset 2471
- Timestamp:
- 09/22/08 11:46:36 (4 months ago)
- Location:
- trunk/otis/src/org/bandit/otis
- Files:
-
- 20 modified
-
api/ActivationException.java (modified) (3 diffs)
-
api/AuthSessionException.java (modified) (1 diff)
-
api/AuthenticationException.java (modified) (1 diff)
-
api/IConfigurable.java (modified) (2 diffs)
-
api/IObligation.java (modified) (1 diff)
-
api/IRole.java (modified) (4 diffs)
-
api/NotAuthenticatedException.java (modified) (3 diffs)
-
impl/CommonObligation.java (modified) (5 diffs)
-
impl/CommonRole.java (modified) (10 diffs)
-
impl/CommonRolesCache.java (modified) (9 diffs)
-
impl/CommonTTLCache.java (modified) (17 diffs)
-
impl/IEndPoint.java (modified) (3 diffs)
-
impl/IEndPointResponse.java (modified) (2 diffs)
-
impl/RemoteEndPointClient.java (modified) (10 diffs)
-
impl/RemoteEndPointClientHandler.java (modified) (3 diffs)
-
impl/SAML11AuthMethod.java (modified) (2 diffs)
-
impl/SAMLPolicyAuthMethod.java (modified) (9 diffs)
-
utils/SAMLTokenGenerator.java (modified) (8 diffs)
-
utils/SAMLTokenSigner.java (modified) (7 diffs)
-
utils/UriBuilder.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/otis/src/org/bandit/otis/api/ActivationException.java
r2227 r2471 19 19 { 20 20 public String remedialAction; 21 21 22 /** 22 23 * … … 34 35 super(e); 35 36 } 36 37 public ActivationException(String message) 37 38 public ActivationException( 39 String message) 38 40 { 39 41 super(message); 40 42 } 41 43 42 public ActivationException(String message, Throwable cause) 44 public ActivationException( 45 String message, 46 Throwable cause) 43 47 { 44 48 super(message, cause); 45 49 } 46 47 public ActivationException(Throwable cause) 50 51 public ActivationException( 52 Throwable cause) 48 53 { 49 54 super(cause); 50 55 } 51 52 53 public ActivationException(String message, String action) 56 57 public ActivationException( 58 String message, 59 String action) 54 60 { 55 61 super(message); … … 57 63 } 58 64 59 public ActivationException(String message, String action, Throwable cause) 65 public ActivationException( 66 String message, 67 String action, 68 Throwable cause) 60 69 { 61 70 super(message, cause); 62 71 remedialAction = action; 63 72 } 64 73 65 74 } -
trunk/otis/src/org/bandit/otis/api/AuthSessionException.java
r1944 r2471 33 33 super(e); 34 34 } 35 36 public AuthSessionException(String message) 35 36 public AuthSessionException( 37 String message) 37 38 { 38 39 super(message); 39 40 } 40 41 41 public AuthSessionException(String message, Throwable cause) 42 public AuthSessionException( 43 String message, 44 Throwable cause) 42 45 { 43 46 super(message, cause); 44 47 } 45 46 public AuthSessionException(Throwable cause) 48 49 public AuthSessionException( 50 Throwable cause) 47 51 { 48 52 super(cause); -
trunk/otis/src/org/bandit/otis/api/AuthenticationException.java
r1944 r2471 29 29 } 30 30 31 public AuthenticationException(String message) 31 public AuthenticationException( 32 String message) 32 33 { 33 34 super(message); 34 35 } 35 36 36 public AuthenticationException(String message, Throwable cause) 37 public AuthenticationException( 38 String message, 39 Throwable cause) 37 40 { 38 41 super(message, cause); 39 42 } 40 43 41 public AuthenticationException(Throwable cause) 44 public AuthenticationException( 45 Throwable cause) 42 46 { 43 47 super(cause); -
trunk/otis/src/org/bandit/otis/api/IConfigurable.java
r1946 r2471 13 13 See the License for the specific language governing permissions and 14 14 limitations under the License. 15 */15 */ 16 16 package org.bandit.otis.api; 17 17 … … 22 22 /** 23 23 * Allow this object to be configured, if called after the object has used 24 * settings from the configuration then calls from that point on should 25 * use the new configuration. 26 * @param mapSettings a map of potential settings 27 * @throws AuthSessionException on error 24 * settings from the configuration then calls from that point on should use 25 * the new configuration. 26 * 27 * @param mapSettings 28 * a map of potential settings 29 * @throws AuthSessionException 30 * on error 28 31 */ 29 public void configure( Map<String, ?> mapSettings) throws AuthSessionException; 32 public void configure( 33 Map<String, ?> mapSettings) throws AuthSessionException; 30 34 } -
trunk/otis/src/org/bandit/otis/api/IObligation.java
r2447 r2471 13 13 See the License for the specific language governing permissions and 14 14 limitations under the License. 15 */15 */ 16 16 package org.bandit.otis.api; 17 18 17 19 18 public abstract interface IObligation 20 19 { 21 /** 20 /** 22 21 * Obligation field names 23 22 */ 24 23 public static final String OBLIGATION_ID = "Id"; 24 25 25 public static final String OBLIGATION_OBLEGATEE = "Obligatee"; 26 26 27 public static final String OBLIGATION_OBLIGATION = "Obligation"; 27 28 28 29 /** 29 30 * Obligation ids 30 31 */ 31 32 public static final String OBLIGATION_MESSAGE_HTML = "Obligation User Message (HTML)"; 33 32 34 public static final String OBLIGATION_MESSAGE = "Obligation User Message"; 35 33 36 public static final String OBLIGATION_REDIRECT = "Obligation Redirect"; 34 37 35 38 /** 36 39 * Oblegatees 37 40 */ 38 public static final String OBLIGATEE_USER ="Obligatee User"; 39 public static final String OBLIGATEE_CONSUMER ="Obligatee Consumer"; 40 public static final String OBLIGATEE_OTIS ="Obligatee OTIS"; 41 41 public static final String OBLIGATEE_USER = "Obligatee User"; 42 43 public static final String OBLIGATEE_CONSUMER = "Obligatee Consumer"; 44 45 public static final String OBLIGATEE_OTIS = "Obligatee OTIS"; 46 42 47 /** 43 48 * 44 * @return String 49 * @return String 45 50 * @throws AuthSessionException 46 51 */ 47 52 public String getId() throws AuthSessionException; 48 53 49 54 public String getObligatee() throws AuthSessionException; 50 55 51 56 public String getObligationData() throws AuthSessionException; 52 57 53 58 } -
trunk/otis/src/org/bandit/otis/api/IRole.java
r2461 r2471 13 13 See the License for the specific language governing permissions and 14 14 limitations under the License. 15 */15 */ 16 16 package org.bandit.otis.api; 17 17 … … 21 21 /** 22 22 * The IRole interface provides abstraction of resources representing roles. 23 * Roles are associated with an {@link org.bandit.otis.api.IAuthSession IAuthSession} 24 * object and may be enumerated by calling the {@link org.bandit.otis.api.IAuthSession#getAssumableRoles() 25 * getAssumeableRoles} or {@link org.bandit.otis.api.IAuthSession#getActiveRoles() getActiveRoles} 23 * Roles are associated with an 24 * {@link org.bandit.otis.api.IAuthSession IAuthSession} object and may be 25 * enumerated by calling the 26 * {@link org.bandit.otis.api.IAuthSession#getAssumableRoles() 27 * getAssumeableRoles} or 28 * {@link org.bandit.otis.api.IAuthSession#getActiveRoles() getActiveRoles} 26 29 * methods. 27 30 */ … … 29 32 { 30 33 /** 31 * Identifier for list of roles which are active on the session. 32 * This is asubset of {@link #ASSUMABLE_ROLES}34 * Identifier for list of roles which are active on the session. This is a 35 * subset of {@link #ASSUMABLE_ROLES} 33 36 */ 34 public static final String ACTIVE_ROLES = "Active Roles";35 37 public static final String ACTIVE_ROLES = "Active Roles"; 38 36 39 /** 37 * Identifier for a common list of roles which may be activatable on the session.38 * This is a superset of {@link #ACTIVE_ROLES}40 * Identifier for a common list of roles which may be activatable on the 41 * session. This is a superset of {@link #ACTIVE_ROLES} 39 42 */ 40 43 public static final String ASSUMABLE_ROLES = "Assumable Roles"; 41 44 42 45 public static final String PROVISION_ROLES = "Provision Roles"; 46 43 47 public static final String DEPROVISION_ROLES = "Deprovision Roles"; 44 45 48 46 49 /** 47 * Property name for a role's identifier. 48 * This Identifier must be in a formatwhich can be placed in a URI50 * Property name for a role's identifier. This Identifier must be in a format 51 * which can be placed in a URI 49 52 */ 50 public static final String roleId = "RoleIdentifier";51 53 public static final String roleId = "RoleIdentifier"; 54 52 55 /** 53 * Property name for a role's name. 56 * Property name for a role's name. 54 57 */ 55 public static final String roleName = "RoleName";56 58 public static final String roleName = "RoleName"; 59 57 60 /** 58 * Property name for a role's description. 61 * Property name for a role's description. 59 62 */ 60 public static final String roleDescription = "RoleDescription";61 63 public static final String roleDescription = "RoleDescription"; 64 62 65 /** 63 * Property name for a role's types. 66 * Property name for a role's types. 64 67 */ 65 public static final String roleTypes = "RoleTypes";66 68 public static final String roleTypes = "RoleTypes"; 69 67 70 /** 68 * Property name for a role's activation method. 71 * Property name for a role's activation method. 69 72 */ 70 public static final String roleActivationMethod = "RoleActivationMethod";71 73 public static final String roleActivationMethod = "RoleActivationMethod"; 74 72 75 /** 73 * Was this role activated because of a token? If we release that token74 * the n therole should no longer be active.76 * Was this role activated because of a token? If we release that token then 77 * the role should no longer be active. 75 78 */ 76 public static final String roleTokenAssociations = "TokenAssociations";77 79 public static final String roleTokenAssociations = "TokenAssociations"; 80 78 81 /** 79 * List of role property names 82 * List of role property names 80 83 */ 81 public static final String[] rolePropertyNames = {IRole.roleId, IRole.roleName, IRole.roleDescription, 82 IRole.roleTypes, IRole.roleActivationMethod, IRole.roleTokenAssociations}; 83 84 public static final String[] rolePropertyNames = 85 {IRole.roleId, IRole.roleName, IRole.roleDescription, IRole.roleTypes, 86 IRole.roleActivationMethod, IRole.roleTokenAssociations}; 87 84 88 /** 85 * Return the role's identifier. The identifier returned may not be the same 86 * identifier as used in the base role system. It may have been mapped to make it 87 * unique across the various role systems configured in OTIS. Thus, because of configuration differences, 88 * two instances of OTIS might return different role identifiers for the same role as found in the 89 * base system. The identifier may not be easily human readable. A human readable or display 90 * name may be obtained by calling the {@link #getRoleName() getRoleName} method. 91 * The identifier may be a URI, URN, or URL, however the system makes no promises about the 92 * ability of that identifier to be resolvable or reachable. 89 * Return the role's identifier. The identifier returned may not be the same 90 * identifier as used in the base role system. It may have been mapped to 91 * make it unique across the various role systems configured in OTIS. Thus, 92 * because of configuration differences, two instances of OTIS might return 93 * different role identifiers for the same role as found in the base system. 94 * The identifier may not be easily human readable. A human readable or 95 * display name may be obtained by calling the 96 * {@link #getRoleName() getRoleName} method. The identifier may be a URI, 97 * URN, or URL, however the system makes no promises about the ability of 98 * that identifier to be resolvable or reachable. 93 99 * 94 100 * @return identifier, will never be null 95 101 */ 96 102 public String getRoleId() throws AuthSessionException; 97 103 98 104 /** 99 * Return's a display name for the role. Will return null if no display name is available.100 * 101 * @return display string if present102 * TODO what should we do about language?105 * Return's a display name for the role. Will return null if no display name 106 * is available. 107 * 108 * @return display string if present TODO what should we do about language? 103 109 */ 104 110 public String getRoleName() throws AuthSessionException; 105 106 /**107 * Return a longer description of the role. Will return null if no description is available.108 * @return null or a human readable description.109 * TODO what should we do about language?110 */111 public String getRoleDescription() throws AuthSessionException;112 111 113 112 /** 114 * Returns an iterator to get the role's types. Roles may be of may different types for different purposes. 115 * This may be system dependent. 116 * @return Iterator which iterators over a list of strings that represent the role's types. 113 * Return a longer description of the role. Will return null if no 114 * description is available. 115 * 116 * @return null or a human readable description. TODO what should we do about 117 * language? 118 */ 119 public String getRoleDescription() throws AuthSessionException; 120 121 /** 122 * Returns an iterator to get the role's types. Roles may be of may different 123 * types for different purposes. This may be system dependent. 124 * 125 * @return Iterator which iterators over a list of strings that represent the 126 * role's types. 117 127 */ 118 128 public Iterable<String> getRoleTypes() throws AuthSessionException; 119 129 120 130 /** 121 * If a role has has been been activated in the current session, this will identify how the 122 * role was activated. Examples include, system activation, manual activation, and activation based 123 * on hierarchy. 124 * @return null if not an active role or if no role activation information is tracked. 131 * If a role has has been been activated in the current session, this will 132 * identify how the role was activated. Examples include, system activation, 133 * manual activation, and activation based on hierarchy. 134 * 135 * @return null if not an active role or if no role activation information is 136 * tracked. 125 137 */ 126 public String getRoleActivationMethod() throws AuthSessionException;127 138 public String getRoleActivationMethod() throws AuthSessionException; 139 128 140 /** 129 * Get one of the properties of the role. 130 * @param propertyName name of the property to be returned. 141 * Get one of the properties of the role. 142 * 143 * @param propertyName 144 * name of the property to be returned. 131 145 * @return Object which is the value of the property. 132 146 */ 133 public Object getProperty( String propertyName) throws AuthSessionException; 134 147 public Object getProperty( 148 String propertyName) throws AuthSessionException; 149 135 150 /** 136 * Get a list of role properties, which are essentially name/value pairs. The iterator 137 * iterates over a set of Map.Entry objects. The property's name may be obtained by calling 138 * the entry's getKey() method, and the property's value may be obtained by calling the 139 * entry's getValue() method. Values may be of one of the following Java Object types: 151 * Get a list of role properties, which are essentially name/value pairs. The 152 * iterator iterates over a set of Map.Entry objects. The property's name may 153 * be obtained by calling the entry's getKey() method, and the property's 154 * value may be obtained by calling the entry's getValue() method. Values may 155 * be of one of the following Java Object types: 140 156 * <ul> 141 157 * <li>String</li> … … 151 167 * <li>Date</li> 152 168 * <li>Map<String, Object>.</li> 153 * <li>List<Object>. A List is returned when the property is multi-valued. The list should be154 * a list of one of the types shown above.</li>169 * <li>List<Object>. A List is returned when the property is 170 * multi-valued. The list should be a list of one of the types shown above.</li> 155 171 * </ul> 172 * 156 173 * @return an iterator that enumerates the role's properties. 157 174 */ 158 public Iterator<Map.Entry<String, Object>> getRoleProperties() throws AuthSessionException; 159 175 public Iterator<Map.Entry<String, Object>> getRoleProperties() 176 throws AuthSessionException; 177 160 178 } 161 -
trunk/otis/src/org/bandit/otis/api/NotAuthenticatedException.java
r1944 r2471 18 18 * Thrown when the state of an object is not authenticated, yet methods are 19 19 * being called which require the state to be authenticated 20 * 20 21 * @author jimse 21 * 22 * 22 23 */ 23 24 public class NotAuthenticatedException extends AuthSessionException … … 28 29 */ 29 30 private static final long serialVersionUID = 5757580288308632772L; 30 31 31 32 public NotAuthenticatedException() 32 33 { … … 34 35 } 35 36 36 public NotAuthenticatedException(String message) 37 public NotAuthenticatedException( 38 String message) 37 39 { 38 40 super(message); 39 41 } 40 42 41 public NotAuthenticatedException(String message, Throwable cause) 43 public NotAuthenticatedException( 44 String message, 45 Throwable cause) 42 46 { 43 47 super(message, cause); 44 48 } 45 49 46 public NotAuthenticatedException(Throwable cause) 50 public NotAuthenticatedException( 51 Throwable cause) 47 52 { 48 53 super(cause); -
trunk/otis/src/org/bandit/otis/impl/CommonObligation.java
r2447 r2471 13 13 See the License for the specific language governing permissions and 14 14 limitations under the License. 15 */15 */ 16 16 package org.bandit.otis.impl; 17 18 17 19 18 import java.util.HashMap; … … 24 23 import org.bandit.otis.api.AuthSessionException; 25 24 26 27 25 /** 28 * Implementation of an IRole 26 * Implementation of an IObligation 27 * 29 28 * @exclude 30 29 */ 31 public class CommonObligation implements IObligation30 public class CommonObligation implements IObligation 32 31 { 33 private Map<String, String> m_members;34 32 private Map<String, String> m_members; 33 35 34 public CommonObligation( 36 35 String id, 37 String obligatee, 38 String obligation 39 ) throws AuthSessionException 36 String obligatee, 37 String obligation) throws AuthSessionException 40 38 { 41 39 m_members = new HashMap<String, String>(); … … 43 41 m_members.put(IObligation.OBLIGATION_OBLEGATEE, obligatee); 44 42 m_members.put(IObligation.OBLIGATION_OBLIGATION, obligation); 45 46 if ( id == null || obligatee == null || obligation == null) 47 throw new AuthSessionException("Null not allowed in constroctor to " + CommonObligation.class.getName()); 43 44 if (id == null || obligatee == null || obligation == null) 45 throw new AuthSessionException("Null not allowed in constroctor to " 46 + CommonObligation.class.getName()); 48 47 } 49 48 50 49 public CommonObligation( 51 Map<String, String> propertyMap 52 ) throws AuthSessionException 50 Map<String, String> propertyMap) throws AuthSessionException 53 51 { 54 52 m_members = propertyMap; 55 if ( m_members== null56 || m_members.get(IObligation.OBLIGATION_ ID) == null57 || m_members.get(IObligation.OBLIGATION_OBLEGATEE) == null58 || m_members.get(IObligation.OBLIGATION_OBLIGATION) == null)59 throw new AuthSessionException("Null not allowed in constroctor to " +CommonObligation.class.getName());53 if (m_members == null || m_members.get(IObligation.OBL