|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.ucsb.adl.middleware.BasicPasswordGatekeeper
A simple gatekeeper that implements all gatekeeper interfaces and that bases authorization on the HTTP "basic" authentication scheme, i.e., on openly-transmitted usernames and passwords.
Non-HTTP requests and HTTP requests lacking a "basic" authorization header are denied.
Allowed usernames and passwords 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 username and password, separated by a colon
(':'), per line.
$Log: BasicPasswordGatekeeper.java,v $
Revision 1.8 2006/06/22 18:49:45 gjanee
Added support for the identifiers service.
Revision 1.7 2004/09/21 22:37:14 gjanee
Rewrite to use class ExtendedProperties.
Revision 1.6 2003/05/09 22:29:25 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.5 2002/09/28 20:33:19 gjanee
Configuration file renames. Renamed the main middleware
configuration file to middleware.conf.
Revision 1.4 2001/10/06 14:51:02 gjanee
Added support for relative filenames using the
middleware_configuration_file property.
Revision 1.3 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.2 2001/09/04 18:39:07 gjanee
Added support for UnloadServiceGatekeeper,
ReferenceServiceGatekeeper, and
UnreferenceServiceGatekeeper.
Revision 1.1 2000/05/20 21:29:58 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.BasicPasswordGatekeeper |
createGatekeeper(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
java.lang.String filename)
Creates a BasicPasswordGatekeeper. |
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 access is allowed. |
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.BasicPasswordGatekeeper createGatekeeper(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
java.lang.String filename)
throws InternalErrorException
BasicPasswordGatekeeper. 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.
BasicPasswordGatekeeper.
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 request 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 request is not valid.
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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request 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 request is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionUnreferenceService
public boolean identifiersServiceAllowed(javax.servlet.ServletRequest request)
throws MiddlewareException
true if access is allowed.
identifiersServiceAllowed in interface IdentifiersServiceGatekeeperrequest - The full request.
true if access is allowed.
BadRequestException - If request 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 request is invalid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareExceptionIdentifiersServicepublic void destroy()
destroy in interface MetadataServiceGatekeeper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||