|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.ucsb.adl.middleware.IPAddressGatekeeper
A simple gatekeeper that implements all gatekeeper interfaces and bases authorization on the client's IP address (only).
A request is authorized if the client's IP address matches one of a
set of CIDR-like address patterns. For example, the pattern
128.111.96.0/24 matches all IP addresses whose 24 most
significant bits equal the 24 most significant bits in
128.111.96.0.
Address patterns are loaded from a database at gatekeeper startup, and then reloaded whenever it is noticed that the database file has been modified. The database is a text file containing one pattern in the above notation per line. Any additional text following a pattern is ignored.
$Log: IPAddressGatekeeper.java,v $
Revision 1.10 2006/06/22 18:49:45 gjanee
Added support for the identifiers service.
Revision 1.9 2004/09/21 22:37:14 gjanee
Rewrite to use class ExtendedProperties.
Revision 1.8 2003/05/09 22:32:59 gjanee
Added support for arbitrary, per-collection and per-holding
metadata views. Specifically, changed the view
argument data type from an enumeration to a string. Added methods
viewsServiceAllowed and
viewsDriverAllowed.
Revision 1.7 2002/09/28 20:33:09 gjanee
Configuration file renames. Renamed the main middleware
configuration file to middleware.conf.
Revision 1.6 2001/10/06 14:51:02 gjanee
Added support for relative filenames using the
middleware_configuration_file property.
Revision 1.5 2001/09/05 04:00:23 gjanee
Changed the type of the baseUrl argument of method
referenceServiceAllowed from URL to
String to support the rmi
pseudo-protocol.
Revision 1.4 2001/09/04 18:25:31 gjanee
Added support for UnloadServiceGatekeeper,
ReferenceServiceGatekeeper, and
UnreferenceServiceGatekeeper.
Revision 1.3 2000/05/19 20:51:54 gjanee
Added support for GenericGatekeeper.
Revision 1.2 2000/05/02 13:08:43 gjanee
Minor bug fix. We attempt to reload the database file if its
modification time cannot be retrieved.
Revision 1.1 2000/04/04 18:01:48 gjanee
Initial revision
| Method Summary | |
boolean |
cancelServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.ResultAccumulator accumulator)
Returns true if the request is authorized. |
boolean |
collectionDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
Returns true if the request is authorized. |
boolean |
collectionServiceAllowed(javax.servlet.ServletRequest request)
Returns true if the request is authorized. |
boolean |
configurationServiceAllowed(javax.servlet.ServletRequest request)
Returns true if the request is authorized. |
static edu.ucsb.adl.middleware.IPAddressGatekeeper |
createGatekeeper(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
java.lang.String filename)
Creates an IPAddressGatekeeper. |
void |
destroy()
Decrements the reference count. |
boolean |
genericAccessAllowed(javax.servlet.ServletRequest request)
Returns true if access is allowed. |
boolean |
identifiersDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
Returns true if the request is authorized. |
boolean |
identifiersServiceAllowed(javax.servlet.ServletRequest request)
Returns true if the request is authorized. |
static void |
main(java.lang.String[] args)
Test driver. |
boolean |
metadataDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String view,
java.lang.String collection,
java.lang.String holding)
Returns true if the request is authorized. |
boolean |
metadataServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String view)
Returns true if the request is authorized. |
boolean |
queryDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection,
edu.ucsb.adl.middleware.Query query)
Returns true if the request is authorized. |
boolean |
queryServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.Query query)
Returns true if the request is authorized. |
boolean |
referenceServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String baseUrl,
java.lang.String collection)
Returns true if access is allowed. |
boolean |
resultsServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.ResultSet set)
Returns true if the request is authorized. |
boolean |
statusServiceAllowed(javax.servlet.ServletRequest request)
Returns true if the request is authorized. |
boolean |
unloadServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
Returns true if access is allowed. |
boolean |
unreferenceServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
Returns true if access is allowed. |
boolean |
viewsDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection,
java.lang.String holding)
Returns true if the request is authorized. |
boolean |
viewsServiceAllowed(javax.servlet.ServletRequest request)
Returns true if the request is authorized. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static edu.ucsb.adl.middleware.IPAddressGatekeeper createGatekeeper(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
java.lang.String filename)
throws InternalErrorException
IPAddressGatekeeper. If a gatekeeper
already exists for the database, the extant gatekeeper's
reference count is incremented and it is returned instead.
propertyList - A property list.filename - The database filename. If the filename is not absolute, it is
interpreted relative to the directory containing the main
middleware configuration file.
IPAddressGatekeeper.
InternalErrorException - If any error is encountered.
public boolean metadataServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String view)
throws MiddlewareException
true if the request is authorized.
metadataServiceAllowed in interface MetadataServiceGatekeeperrequest - The full request.view - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionMetadataService
public boolean viewsServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if the request is authorized.
viewsServiceAllowed in interface MetadataServiceGatekeeperrequest - The full request.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionMetadataService
public boolean metadataDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String view,
java.lang.String collection,
java.lang.String holding)
throws MiddlewareException
true if the request is authorized.
metadataDriverAllowed in interface MetadataDriverGatekeeperrequest - The full request.view - Unused.collection - Unused.holding - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionMetadataService
public boolean viewsDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection,
java.lang.String holding)
throws MiddlewareException
true if the request is authorized.
viewsDriverAllowed in interface MetadataDriverGatekeeperrequest - The full request.collection - Unused.holding - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionMetadataService
public boolean queryServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.Query query)
throws MiddlewareException
true if the request is authorized.
queryServiceAllowed in interface QueryServiceGatekeeperrequest - The full request.query - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionQueryService
public boolean queryDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection,
edu.ucsb.adl.middleware.Query query)
throws MiddlewareException
true if the request is authorized.
queryDriverAllowed in interface QueryDriverGatekeeperrequest - The full request.collection - Unused.query - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionQueryService
public boolean resultsServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.ResultSet set)
throws MiddlewareException
true if the request is authorized.
resultsServiceAllowed in interface ResultsServiceGatekeeperrequest - The full request.set - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionResultsService
public boolean statusServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if the request is authorized.
statusServiceAllowed in interface StatusServiceGatekeeperrequest - The full request.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionStatusService
public boolean cancelServiceAllowed(javax.servlet.ServletRequest request,
edu.ucsb.adl.middleware.ResultAccumulator accumulator)
throws MiddlewareException
true if the request is authorized.
cancelServiceAllowed in interface CancelServiceGatekeeperrequest - The full request.accumulator - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionCancelService
public boolean configurationServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if the request is authorized.
configurationServiceAllowed in interface ConfigurationServiceGatekeeperrequest - The full request.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionConfigurationService
public boolean collectionServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if the request is authorized.
collectionServiceAllowed in interface CollectionServiceGatekeeperrequest - The full request.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionCollectionService
public boolean collectionDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
throws MiddlewareException
true if the request is authorized.
collectionDriverAllowed in interface CollectionDriverGatekeeperrequest - The full request.collection - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionCollectionService
public boolean genericAccessAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if access is allowed.
genericAccessAllowed in interface GenericGatekeeperrequest - The full request.
true if access is allowed.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareException
public boolean unloadServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
throws MiddlewareException
true if access is allowed.
unloadServiceAllowed in interface UnloadServiceGatekeeperrequest - The full request.collection - Unused.
true if access is allowed.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionUnloadService
public boolean referenceServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String baseUrl,
java.lang.String collection)
throws MiddlewareException
true if access is allowed.
referenceServiceAllowed in interface ReferenceServiceGatekeeperrequest - The full request.baseUrl - Unused.collection - Unused.
true if access is allowed.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionReferenceService
public boolean unreferenceServiceAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
throws MiddlewareException
true if access is allowed.
unreferenceServiceAllowed in interface UnreferenceServiceGatekeeperrequest - The full request.collection - Unused.
true if access is allowed.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionUnreferenceService
public boolean identifiersServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if the request is authorized.
identifiersServiceAllowed in interface IdentifiersServiceGatekeeperrequest - The full request.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionIdentifiersService
public boolean identifiersDriverAllowed(javax.servlet.ServletRequest request,
java.lang.String collection)
throws MiddlewareException
true if the request is authorized.
identifiersDriverAllowed in interface IdentifiersDriverGatekeeperrequest - The full request.collection - Unused.
true if the request is authorized.
BadRequestException - If the client IP address is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionIdentifiersServicepublic void destroy()
destroy in interface MetadataServiceGatekeeper
public static void main(java.lang.String[] args)
throws MiddlewareException
MiddlewareException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||