michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.sync.net; michael@0: michael@0: import java.security.GeneralSecurityException; michael@0: michael@0: import ch.boye.httpclientandroidlib.Header; michael@0: import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase; michael@0: import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient; michael@0: import ch.boye.httpclientandroidlib.protocol.BasicHttpContext; michael@0: michael@0: /** michael@0: * An AuthHeaderProvider generates HTTP Authorization headers for michael@0: * HTTP requests. michael@0: */ michael@0: public interface AuthHeaderProvider { michael@0: /** michael@0: * Generate an HTTP Authorization header. michael@0: * michael@0: * @param request HTTP request. michael@0: * @param context HTTP context. michael@0: * @param client HTTP client. michael@0: * @return HTTP Authorization header. michael@0: * @throws GeneralSecurityException usually wrapping a more specific exception. michael@0: */ michael@0: Header getAuthHeader(HttpRequestBase request, BasicHttpContext context, DefaultHttpClient client) michael@0: throws GeneralSecurityException; michael@0: }