mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-09 07:24:41 +00:00
Discard 'CredentialAvatar' -- no longer needed with Spring settings -- use Credential instances directly
This commit is contained in:
1 parent
e6c0f71175
commit
f12e940edd
12 files changed
+76
-381
No files matched your search
@@ -1155,7 +1155,7 @@ public abstract class AbstractFrontier
|
||||
// rfc2617 credential present and if there, assume it got
|
||||
// loaded in FetchHTTP on expectation that we're to go around
|
||||
// again. If no rfc2617 loaded, we should not be here.
|
||||
boolean loaded = curi.hasRfc2617CredentialAvatar();
|
||||
boolean loaded = curi.hasRfc2617Credential();
|
||||
if (!loaded && logger.isLoggable(Level.FINE)) {
|
||||
logger.fine("Have 401 but no creds loaded " + curi);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.archive.modules.CrawlURI;
|
||||
import org.archive.modules.ProcessResult;
|
||||
import org.archive.modules.Processor;
|
||||
import org.archive.modules.credential.Credential;
|
||||
import org.archive.modules.credential.CredentialAvatar;
|
||||
import org.archive.modules.credential.CredentialStore;
|
||||
import org.archive.modules.extractor.Hop;
|
||||
import org.archive.modules.extractor.Link;
|
||||
@@ -447,22 +446,19 @@ public class PreconditionEnforcer extends Processor {
|
||||
* @param curi CrawlURI.
|
||||
* @return True if already run.
|
||||
*/
|
||||
private boolean authenticated(final Credential credential,
|
||||
final CrawlURI curi) {
|
||||
boolean result = false;
|
||||
private boolean authenticated(final Credential credential, final CrawlURI curi) {
|
||||
CrawlServer server = serverCache.getServerFor(curi.getUURI());
|
||||
if (!server.hasCredentialAvatars()) {
|
||||
return result;
|
||||
if (!server.hasCredentials()) {
|
||||
return false;
|
||||
}
|
||||
Set<CredentialAvatar> avatars = server.getCredentialAvatars();
|
||||
for (CredentialAvatar ca: avatars) {
|
||||
String key = null;
|
||||
key = credential.getKey();
|
||||
if (ca.match(credential.getClass(), key)) {
|
||||
result = true;
|
||||
Set<Credential> credentials = server.getCredentials();
|
||||
for (Credential cred: credentials) {
|
||||
if (cred.getKey().equals(credential.getKey())
|
||||
&& cred.getClass().isInstance(credential)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user