Package thredds.servlet.restrict
Interface Authorizer
-
- All Known Implementing Classes:
AuthorizerNoop,CAMSAuthorizer,TomcatAuthorizer
public interface AuthorizerAn implementation must have a no-arg constructor, so it can be created through reflection. This design allows for third party plug-ins.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanauthorize(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String role)Decide is this request is authorized in the named role.voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Process this request.voidsetRoleSource(RoleSource roleSource)Set the role source, if there is one.
-
-
-
Method Detail
-
setRoleSource
void setRoleSource(RoleSource roleSource)
Set the role source, if there is one. If not, assume no role authentication is needed. use RoleSource.hasRole() to test for role.- Parameters:
roleSource- tells whether a user has the named role.
-
authorize
boolean authorize(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String role) throws IOException, javax.servlet.ServletExceptionDecide is this request is authorized in the named role. This method must be thread-safe.- Parameters:
req- the requestres- the responserole- need this role- Returns:
- true if user is authenticated. if false, must set res.setStatus().
- Throws:
IOException- I/O error, eg networkjavax.servlet.ServletException- other errors
-
doGet
void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOExceptionProcess this request. May be a no-op.- Parameters:
req- the requestres- the response- Throws:
IOException- I/O error, eg networkjavax.servlet.ServletException- other errors
-
-