// Path: src/main/java/com/burgstaller/okhttp/digest/CachingAuthenticator.java
// public interface CachingAuthenticator extends Authenticator {
//     /**
//      * Authenticate the new request using cached information already established from an earlier
//      * authentication.
//      *
//      * @param route   the route to use
//      * @param request the new request to be authenticated.
//      * @return the modified request with updated auth headers.
//      * @throws IOException in case of a communication problem
//      */
//     Request authenticateWithState(Route route, Request request) throws IOException;
// }


import java.io.IOException;
import java.util.Map;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
import okhttp3.Authenticator;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.Route;
package com.burgstaller.okhttp;




/**
 * An authenticator decorator which saves the generated authentication headers for a specific host.
 * To be used in tandem with {@link AuthenticationCacheInterceptor}.
 * Depending on your use case you will probably need to use a {@link java.util.concurrent.ConcurrentHashMap}.
 */
public class CachingAuthenticatorDecorator implements Authenticator {
    private final Authenticator innerAuthenticator;
// Path: src/main/java/com/burgstaller/okhttp/digest/CachingAuthenticator.java
// public interface CachingAuthenticator extends Authenticator {
//     /**
//      * Authenticate the new request using cached information already established from an earlier
//      * authentication.
//      *
//      * @param route   the route to use
//      * @param request the new request to be authenticated.
//      * @return the modified request with updated auth headers.
//      * @throws IOException in case of a communication problem
//      */
//     Request authenticateWithState(Route route, Request request) throws IOException;
// }


// Path: src/main/java/com/burgstaller/okhttp/CachingAuthenticatorDecorator.java
import java.io.IOException;
import java.util.Map;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
import okhttp3.Authenticator;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.Route;

package com.burgstaller.okhttp;




/**
 * An authenticator decorator which saves the generated authentication headers for a specific host.
 * To be used in tandem with {@link AuthenticationCacheInterceptor}.
 * Depending on your use case you will probably need to use a {@link java.util.concurrent.ConcurrentHashMap}.
 */
public class CachingAuthenticatorDecorator implements Authenticator {
    private final Authenticator innerAuthenticator;
    private final Map<String, CachingAuthenticator> authCache;