| 1 |
package org.astrogrid.samp.web; |
| 2 |
|
| 3 |
import java.util.Map; |
| 4 |
import org.astrogrid.samp.client.SampException; |
| 5 |
import org.astrogrid.samp.httpd.HttpServer; |
| 6 |
|
| 7 |
/** |
| 8 |
* Defines authorization functionality which is used to determine whether |
| 9 |
* a client is permitted to register with the hub. |
| 10 |
* |
| 11 |
* @author Mark Taylor |
| 12 |
* @since 2 Feb 2011 |
| 13 |
*/ |
| 14 |
public interface ClientAuthorizer { |
| 15 |
|
| 16 |
/** |
| 17 |
* Indicates whether an HTTP request representing an otherwise |
| 18 |
* unauthorized connection attempt will be permitted access to |
| 19 |
* sensitive system resources. If so, the method exits normally. |
| 20 |
* If authorization is denied, a SampException is thrown, |
| 21 |
* with a message that indicates the reason for denial. |
| 22 |
* |
| 23 |
* @param request incoming HTTP request |
| 24 |
* @param securityMap credential items supplied explicitly by |
| 25 |
* aspiring client to support its registration |
| 26 |
* request |
| 27 |
* @throws SampException with reason if authorization is denied |
| 28 |
*/ |
| 29 |
void authorize( HttpServer.Request request, Map securityMap ) |
| 30 |
throws SampException; |
| 31 |
} |