Class MyProxyDelegationServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- edu.uiuc.ncsa.security.servlet.AbstractServlet
-
- org.oa4mp.server.api.servlet.storage.EnvServlet
-
- org.oa4mp.server.api.servlet.storage.MyProxyDelegationServlet
-
- All Implemented Interfaces:
TransactionFilter
,edu.uiuc.ncsa.security.core.Logable
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AbstractAccessTokenServlet
,AbstractCertServlet
,AbstractInitServlet
,AbstractRegistrationServlet
,AuthorizationControllerServlet
,BearerTokenServlet
,CRServlet
,DiscoveryServlet
,ErrorServlet
,MultiAuthServlet
public abstract class MyProxyDelegationServlet extends EnvServlet implements TransactionFilter
Created by Jeff Gaynor
on May 17, 2011 at 3:46:53 PM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static AbstractCLIApprover.ClientApprovalThread
caThread
static edu.uiuc.ncsa.security.util.pkcs.KeyPairPopulationThread
kpt
static edu.uiuc.ncsa.security.storage.events.LastAccessedThread
lastAccessedThread
static edu.uiuc.ncsa.security.core.cache.Cache
myproxyConnectionCache
static edu.uiuc.ncsa.security.core.cache.Cleanup<edu.uiuc.ncsa.security.core.Identifier,edu.uiuc.ncsa.security.core.cache.CachedObject>
myproxyConnectionCleanup
static edu.uiuc.ncsa.security.core.cache.Cleanup<String,BasicTransaction>
transactionCleanup
-
Fields inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.EnvServlet
ERROR_NOTIFICATION_BODY_KEY, ERROR_NOTIFICATION_SUBJECT_KEY, notificationListeners, storeUpdatesDone
-
-
Constructor Summary
Constructors Constructor Description MyProxyDelegationServlet()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
checkClientApproval(BaseClient client)
Checks if the client is approved.static edu.uiuc.ncsa.security.core.util.MetaDebugUtil
createDebugger(BaseClient client)
void
destroy()
AGIssuer
getAGI()
protected ATIssuer
getATI()
protected Client
getClient(AuthorizationGrant authorizationGrant)
A utility to get the client from the authorization grant.Client
getClient(edu.uiuc.ncsa.security.core.Identifier identifier)
Client
getClient(javax.servlet.http.HttpServletRequest req)
Assumes that the client identifier is a parameter in the request.protected Map<String,String>
getFirstParameters(javax.servlet.http.HttpServletRequest req)
Utility to extract all of the parameters from a request.protected edu.uiuc.ncsa.security.core.Identifier
getGrantIDFromRequest(javax.servlet.http.HttpServletRequest req)
protected MyProxyConnectable
getMPConnection(ServiceTransaction transaction)
protected MyProxyConnectable
getMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier)
static edu.uiuc.ncsa.security.core.cache.Cache
getMyproxyConnectionCache()
static List<MyProxyServiceFacade>
getMyproxyServices()
static ServiceEnvironment
getServiceEnvironment()
protected ServiceTransaction
getTransaction(AuthorizationGrant grant)
protected ServiceTransaction
getTransactionByGrantID(javax.servlet.http.HttpServletRequest request)
TransactionStore
getTransactionStore()
protected boolean
hasMPConnection(ServiceTransaction transaction)
protected boolean
hasMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier)
protected boolean
isEmpty(String x)
ServiceEnvironmentImpl
loadProperties2()
ServiceTransaction
newTransaction()
void
postprocess(TransactionState state)
Invoked after the response has been written to theHttpServletResponse
stream.void
preprocess(TransactionState state)
Note that if you override this, you should call super, which sets some security-related headers, but touches nothing else.protected void
realStoreUpdates()
If you have store updates that need to get done, put them in this method, invoking super.void
say(String x)
Just for low-level debugging.protected void
shutdownCleanup(edu.uiuc.ncsa.security.core.cache.Cleanup c)
void
storeUpdates()
This will be invoked at init before anything else and should include code to seamlessly upgrade stores from earlier versions.abstract ServiceTransaction
verifyAndGet(IssuerResponse iResponse)
This is called after the response is received so that the system can get the approproate transaction.-
Methods inherited from class edu.uiuc.ncsa.myproxy.oa4mp.server.servlet.EnvServlet
addNotificationListener, loadEnvironment, processStoreCheck, removeNotificationListener
-
Methods inherited from class edu.uiuc.ncsa.security.servlet.AbstractServlet
checkContentType, CONST, debug, doGet, doIt, doPing, doPost, error, error, getConfigurationLoader, getEnvironment, getExceptionHandler, getFirstParameterValue, getInitialization, getMyLogger, handleException, info, init, isDebugOn, printAllParameters, printAllParameters, resetState, setConfigurationLoader, setDebugOn, setEnvironment, setExceptionHandler, setInitialization, warn
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
transactionCleanup
public static edu.uiuc.ncsa.security.core.cache.Cleanup<String,BasicTransaction> transactionCleanup
-
myproxyConnectionCleanup
public static edu.uiuc.ncsa.security.core.cache.Cleanup<edu.uiuc.ncsa.security.core.Identifier,edu.uiuc.ncsa.security.core.cache.CachedObject> myproxyConnectionCleanup
-
lastAccessedThread
public static edu.uiuc.ncsa.security.storage.events.LastAccessedThread lastAccessedThread
-
myproxyConnectionCache
public static edu.uiuc.ncsa.security.core.cache.Cache myproxyConnectionCache
-
kpt
public static edu.uiuc.ncsa.security.util.pkcs.KeyPairPopulationThread kpt
-
caThread
public static AbstractCLIApprover.ClientApprovalThread caThread
-
-
Method Detail
-
createDebugger
public static edu.uiuc.ncsa.security.core.util.MetaDebugUtil createDebugger(BaseClient client)
-
verifyAndGet
public abstract ServiceTransaction verifyAndGet(IssuerResponse iResponse) throws IOException
This is called after the response is received so that the system can get the approproate transaction. Checks for the validity of the transaction should be done here too.- Parameters:
iResponse
-- Returns:
- Throws:
IOException
-
loadProperties2
public ServiceEnvironmentImpl loadProperties2() throws IOException
- Overrides:
loadProperties2
in classEnvServlet
- Throws:
IOException
-
getMyproxyConnectionCache
public static edu.uiuc.ncsa.security.core.cache.Cache getMyproxyConnectionCache()
-
getAGI
public AGIssuer getAGI() throws IOException
- Throws:
IOException
-
getATI
protected ATIssuer getATI() throws IOException
- Throws:
IOException
-
getServiceEnvironment
public static ServiceEnvironment getServiceEnvironment()
-
getMyproxyServices
public static List<MyProxyServiceFacade> getMyproxyServices()
-
storeUpdates
public void storeUpdates() throws IOException, SQLException
Description copied from class:EnvServlet
This will be invoked at init before anything else and should include code to seamlessly upgrade stores from earlier versions. For instance, if a new column needs to be added to a table. This pre-supposes that the current user has the correct permissions to alter the table, btw. This also updates the internal flagEnvServlet.storeUpdatesDone
which should be checks in overrides. If you override this method and call super, let super manage this flag. If it is true, do not execute your method.- Specified by:
storeUpdates
in classEnvServlet
- Throws:
IOException
SQLException
-
realStoreUpdates
protected void realStoreUpdates() throws IOException, SQLException
If you have store updates that need to get done, put them in this method, invoking super. Calls to this are managed by the servlet to make sure nothing get called more than once.- Throws:
IOException
SQLException
-
shutdownCleanup
protected void shutdownCleanup(edu.uiuc.ncsa.security.core.cache.Cleanup c)
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classjavax.servlet.GenericServlet
-
getTransactionStore
public TransactionStore getTransactionStore() throws IOException
- Throws:
IOException
-
getClient
public Client getClient(javax.servlet.http.HttpServletRequest req)
Assumes that the client identifier is a parameter in the request.- Parameters:
req
-- Returns:
-
getTransactionByGrantID
protected ServiceTransaction getTransactionByGrantID(javax.servlet.http.HttpServletRequest request) throws IOException
- Throws:
IOException
-
getGrantIDFromRequest
protected edu.uiuc.ncsa.security.core.Identifier getGrantIDFromRequest(javax.servlet.http.HttpServletRequest req)
-
getClient
public Client getClient(edu.uiuc.ncsa.security.core.Identifier identifier)
-
newTransaction
public ServiceTransaction newTransaction() throws IOException
- Throws:
IOException
-
getTransaction
protected ServiceTransaction getTransaction(AuthorizationGrant grant) throws IOException
- Throws:
IOException
-
getClient
protected Client getClient(AuthorizationGrant authorizationGrant) throws IOException
A utility to get the client from the authorization grant. This looks up the transaction- Parameters:
authorizationGrant
-- Returns:
- Throws:
IOException
-
checkClientApproval
public void checkClientApproval(BaseClient client)
Checks if the client is approved. This should be done before each leg of the process- Parameters:
client
-
-
isEmpty
protected boolean isEmpty(String x)
-
preprocess
public void preprocess(TransactionState state) throws Throwable
Note that if you override this, you should call super, which sets some security-related headers, but touches nothing else.- Specified by:
preprocess
in interfaceTransactionFilter
- Parameters:
state
-- Throws:
Throwable
-
postprocess
public void postprocess(TransactionState state) throws Throwable
Description copied from interface:TransactionFilter
Invoked after the response has been written to theHttpServletResponse
stream. This is the very last call made by the servlet before returning.- Specified by:
postprocess
in interfaceTransactionFilter
- Throws:
Throwable
-
hasMPConnection
protected boolean hasMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier)
-
hasMPConnection
protected boolean hasMPConnection(ServiceTransaction transaction)
-
getMPConnection
protected MyProxyConnectable getMPConnection(ServiceTransaction transaction)
-
getMPConnection
protected MyProxyConnectable getMPConnection(edu.uiuc.ncsa.security.core.Identifier identifier)
-
getFirstParameters
protected Map<String,String> getFirstParameters(javax.servlet.http.HttpServletRequest req)
Utility to extract all of the parameters from a request. Since the parameters are all string arrays, this takes a little finagling. Generally we do not support multiple values for parameters, so taking the first is reasonable.- Parameters:
req
-- Returns:
-
say
public void say(String x)
Just for low-level debugging.- Parameters:
x
-
-
-