package {{apiSpiPackage}};

/**
 * Provide authorization to API calls.
 */
public interface ApiAuthorizationProvider {

	/**
	 * Provide authorization for the given invoker.
	 */
	void authorize({{apiPackage}}.ApiInvoker api);

	/**
	 * Handle failed authorization for the given invoker, represented
	 * by the given failed response.
	 * @return {@code true} if reauthorization succeeded, or {@code false} if it didn't.
	 */
	boolean reauthorize({{apiPackage}}.ApiInvoker api, {{javax}}.ws.rs.core.Response response);

}
