package org.kohsuke.github;

/**
 * Provides a functional interface that returns a valid encodedAuthorization. This strategy allows for a provider that
 * dynamically changes the credentials. Each request will request the credentials from the provider.
 */
public interface CredentialProvider {
    /**
     * Returns the credentials to be used with a given request. As an example, a credential provider for a bearer token
     * will return something like:
     * 
     * <pre>
     * {@code
     *  &#64;Override
     *  public String getEncodedAuthorization() {
     *  return "Bearer myBearerToken";
     *  }
     * }
     * </pre>
     *
     * @return encoded authorization string, can be null
     */
    String getEncodedAuthorization();
}

@@ -22,16 +22,45 @@
 ithub;%0A%0A
+import java.io.IOException;%0A%0A
 /**%0A * P
@@ -317,16 +317,166 @@
 vider %7B%0A
+    /**%0A     * An static instance for an ANONYMOUS credential provider%0A     */%0A    CredentialProvider ANONYMOUS = new AnonymousCredentialProvider();%0A%0A
     /**%0A
@@ -917,12 +917,328 @@
 zation()
-;
+ throws IOException;%0A%0A    /**%0A     * A %7B@link CredentialProvider%7D that ensures that no credentials are returned%0A     */%0A    class AnonymousCredentialProvider implements CredentialProvider %7B%0A        @Override%0A        public String getEncodedAuthorization() throws IOException %7B%0A            return null;%0A        %7D%0A    %7D
 %0A%7D%0A

add CredentialProvider#ANONYMOUS class and field