1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/sync/net/AuthHeaderProvider.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +package org.mozilla.gecko.sync.net; 1.9 + 1.10 +import java.security.GeneralSecurityException; 1.11 + 1.12 +import ch.boye.httpclientandroidlib.Header; 1.13 +import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase; 1.14 +import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient; 1.15 +import ch.boye.httpclientandroidlib.protocol.BasicHttpContext; 1.16 + 1.17 +/** 1.18 + * An <code>AuthHeaderProvider</code> generates HTTP Authorization headers for 1.19 + * HTTP requests. 1.20 + */ 1.21 +public interface AuthHeaderProvider { 1.22 + /** 1.23 + * Generate an HTTP Authorization header. 1.24 + * 1.25 + * @param request HTTP request. 1.26 + * @param context HTTP context. 1.27 + * @param client HTTP client. 1.28 + * @return HTTP Authorization header. 1.29 + * @throws GeneralSecurityException usually wrapping a more specific exception. 1.30 + */ 1.31 + Header getAuthHeader(HttpRequestBase request, BasicHttpContext context, DefaultHttpClient client) 1.32 + throws GeneralSecurityException; 1.33 +}