class com.mongodb.internal.connection.DefaultAuthenticator extends com.mongodb.internal.connection.Authenticator
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: com.mongodb.internal.connection.DefaultAuthenticator
super_class: com.mongodb.internal.connection.Authenticator
{
static final int USER_NOT_FOUND_CODE;
descriptor: I
flags: (0x0018) ACC_STATIC, ACC_FINAL
ConstantValue: 11
private static final com.mongodb.connection.ServerVersion FOUR_ZERO;
descriptor: Lcom/mongodb/connection/ServerVersion;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final com.mongodb.connection.ServerVersion THREE_ZERO;
descriptor: Lcom/mongodb/connection/ServerVersion;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final org.bson.BsonString DEFAULT_MECHANISM_NAME;
descriptor: Lorg/bson/BsonString;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=0, args_size=0
0: new com.mongodb.connection.ServerVersion
dup
iconst_4
iconst_0
invokespecial com.mongodb.connection.ServerVersion.<init>:(II)V
putstatic com.mongodb.internal.connection.DefaultAuthenticator.FOUR_ZERO:Lcom/mongodb/connection/ServerVersion;
1: new com.mongodb.connection.ServerVersion
dup
iconst_3
iconst_0
invokespecial com.mongodb.connection.ServerVersion.<init>:(II)V
putstatic com.mongodb.internal.connection.DefaultAuthenticator.THREE_ZERO:Lcom/mongodb/connection/ServerVersion;
2: new org.bson.BsonString
dup
getstatic com.mongodb.AuthenticationMechanism.SCRAM_SHA_256:Lcom/mongodb/AuthenticationMechanism;
invokevirtual com.mongodb.AuthenticationMechanism.getMechanismName:()Ljava/lang/String;
invokespecial org.bson.BsonString.<init>:(Ljava/lang/String;)V
putstatic com.mongodb.internal.connection.DefaultAuthenticator.DEFAULT_MECHANISM_NAME:Lorg/bson/BsonString;
return
LocalVariableTable:
Start End Slot Name Signature
void <init>(com.mongodb.internal.connection.MongoCredentialWithCache);
descriptor: (Lcom/mongodb/internal/connection/MongoCredentialWithCache;)V
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
aload 1
invokespecial com.mongodb.internal.connection.Authenticator.<init>:(Lcom/mongodb/internal/connection/MongoCredentialWithCache;)V
1: ldc "unspecified authentication mechanism"
aload 1
invokevirtual com.mongodb.internal.connection.MongoCredentialWithCache.getAuthenticationMechanism:()Lcom/mongodb/AuthenticationMechanism;
ifnonnull 2
iconst_1
goto 3
StackMap locals: com.mongodb.internal.connection.DefaultAuthenticator com.mongodb.internal.connection.MongoCredentialWithCache
StackMap stack: java.lang.String
2: iconst_0
StackMap locals: com.mongodb.internal.connection.DefaultAuthenticator com.mongodb.internal.connection.MongoCredentialWithCache
StackMap stack: java.lang.String int
3: invokestatic com.mongodb.assertions.Assertions.isTrueArgument:(Ljava/lang/String;Z)V
4: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 5 1 credential Lcom/mongodb/internal/connection/MongoCredentialWithCache;
MethodParameters:
Name Flags
credential final
void authenticate(com.mongodb.internal.connection.InternalConnection, com.mongodb.connection.ConnectionDescription);
descriptor: (Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;)V
flags: (0x0000)
Code:
stack=3, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 2
invokestatic com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotZero:(Lcom/mongodb/connection/ConnectionDescription;)Z
ifeq 4
1: aload 0
aload 2
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getLegacyDefaultAuthenticator:(Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
2: aload 1
aload 2
invokevirtual com.mongodb.internal.connection.Authenticator.authenticate:(Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;)V
3: goto 10
4: StackMap locals:
StackMap stack:
ldc "admin"
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.createIsMasterCommand:()Lorg/bson/BsonDocument;
aload 1
invokestatic com.mongodb.internal.connection.CommandHelper.executeCommand:(Ljava/lang/String;Lorg/bson/BsonDocument;Lcom/mongodb/internal/connection/InternalConnection;)Lorg/bson/BsonDocument;
astore 3
start local 3 5: aload 0
aload 3
aload 2
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getAuthenticatorFromIsMasterResult:(Lorg/bson/BsonDocument;Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
6: aload 1
aload 2
invokevirtual com.mongodb.internal.connection.Authenticator.authenticate:(Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;)V
end local 3 7: goto 10
StackMap locals:
StackMap stack: java.lang.Exception
8: astore 3
start local 3 9: aload 0
aload 3
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.wrapException:(Ljava/lang/Throwable;)Lcom/mongodb/MongoException;
athrow
end local 3 10: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 11 1 connection Lcom/mongodb/internal/connection/InternalConnection;
0 11 2 connectionDescription Lcom/mongodb/connection/ConnectionDescription;
5 7 3 isMasterResult Lorg/bson/BsonDocument;
9 10 3 e Ljava/lang/Exception;
Exception table:
from to target type
4 7 8 Class java.lang.Exception
MethodParameters:
Name Flags
connection final
connectionDescription final
void authenticateAsync(com.mongodb.internal.connection.InternalConnection, com.mongodb.connection.ConnectionDescription, com.mongodb.async.SingleResultCallback<java.lang.Void>);
descriptor: (Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;Lcom/mongodb/async/SingleResultCallback;)V
flags: (0x0000)
Code:
stack=9, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 2
invokestatic com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotZero:(Lcom/mongodb/connection/ConnectionDescription;)Z
ifeq 4
1: aload 0
aload 2
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getLegacyDefaultAuthenticator:(Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
2: aload 1
aload 2
aload 3
invokevirtual com.mongodb.internal.connection.Authenticator.authenticateAsync:(Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;Lcom/mongodb/async/SingleResultCallback;)V
3: goto 5
4: StackMap locals:
StackMap stack:
ldc "admin"
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.createIsMasterCommand:()Lorg/bson/BsonDocument;
aload 1
new com.mongodb.internal.connection.DefaultAuthenticator$1
dup
aload 0
aload 3
aload 2
aload 1
invokespecial com.mongodb.internal.connection.DefaultAuthenticator$1.<init>:(Lcom/mongodb/internal/connection/DefaultAuthenticator;Lcom/mongodb/async/SingleResultCallback;Lcom/mongodb/connection/ConnectionDescription;Lcom/mongodb/internal/connection/InternalConnection;)V
invokestatic com.mongodb.internal.connection.CommandHelper.executeCommandAsync:(Ljava/lang/String;Lorg/bson/BsonDocument;Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/async/SingleResultCallback;)V
5: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 6 1 connection Lcom/mongodb/internal/connection/InternalConnection;
0 6 2 connectionDescription Lcom/mongodb/connection/ConnectionDescription;
0 6 3 callback Lcom/mongodb/async/SingleResultCallback<Ljava/lang/Void;>;
Signature: (Lcom/mongodb/internal/connection/InternalConnection;Lcom/mongodb/connection/ConnectionDescription;Lcom/mongodb/async/SingleResultCallback<Ljava/lang/Void;>;)V
MethodParameters:
Name Flags
connection final
connectionDescription final
callback final
com.mongodb.internal.connection.Authenticator getAuthenticatorFromIsMasterResult(org.bson.BsonDocument, com.mongodb.connection.ConnectionDescription);
descriptor: (Lorg/bson/BsonDocument;Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
flags: (0x0000)
Code:
stack=4, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 1
ldc "saslSupportedMechs"
invokevirtual org.bson.BsonDocument.containsKey:(Ljava/lang/Object;)Z
ifeq 6
1: aload 1
ldc "saslSupportedMechs"
invokevirtual org.bson.BsonDocument.getArray:(Ljava/lang/Object;)Lorg/bson/BsonArray;
astore 3
start local 3 2: aload 3
getstatic com.mongodb.internal.connection.DefaultAuthenticator.DEFAULT_MECHANISM_NAME:Lorg/bson/BsonString;
invokevirtual org.bson.BsonArray.contains:(Ljava/lang/Object;)Z
ifeq 3
getstatic com.mongodb.AuthenticationMechanism.SCRAM_SHA_256:Lcom/mongodb/AuthenticationMechanism;
goto 4
StackMap locals: org.bson.BsonArray
StackMap stack:
3: getstatic com.mongodb.AuthenticationMechanism.SCRAM_SHA_1:Lcom/mongodb/AuthenticationMechanism;
StackMap locals:
StackMap stack: com.mongodb.AuthenticationMechanism
4: astore 4
start local 4 5: new com.mongodb.internal.connection.ScramShaAuthenticator
dup
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredentialWithCache:()Lcom/mongodb/internal/connection/MongoCredentialWithCache;
aload 4
invokevirtual com.mongodb.internal.connection.MongoCredentialWithCache.withMechanism:(Lcom/mongodb/AuthenticationMechanism;)Lcom/mongodb/internal/connection/MongoCredentialWithCache;
invokespecial com.mongodb.internal.connection.ScramShaAuthenticator.<init>:(Lcom/mongodb/internal/connection/MongoCredentialWithCache;)V
areturn
end local 4 end local 3 6: StackMap locals:
StackMap stack:
aload 0
aload 2
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getLegacyDefaultAuthenticator:(Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 7 1 isMasterResult Lorg/bson/BsonDocument;
0 7 2 connectionDescription Lcom/mongodb/connection/ConnectionDescription;
2 6 3 saslSupportedMechs Lorg/bson/BsonArray;
5 6 4 mechanism Lcom/mongodb/AuthenticationMechanism;
MethodParameters:
Name Flags
isMasterResult final
connectionDescription final
private com.mongodb.internal.connection.Authenticator getLegacyDefaultAuthenticator(com.mongodb.connection.ConnectionDescription);
descriptor: (Lcom/mongodb/connection/ConnectionDescription;)Lcom/mongodb/internal/connection/Authenticator;
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic com.mongodb.internal.operation.ServerVersionHelper.serverIsAtLeastVersionThreeDotZero:(Lcom/mongodb/connection/ConnectionDescription;)Z
ifeq 2
1: new com.mongodb.internal.connection.ScramShaAuthenticator
dup
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredentialWithCache:()Lcom/mongodb/internal/connection/MongoCredentialWithCache;
getstatic com.mongodb.AuthenticationMechanism.SCRAM_SHA_1:Lcom/mongodb/AuthenticationMechanism;
invokevirtual com.mongodb.internal.connection.MongoCredentialWithCache.withMechanism:(Lcom/mongodb/AuthenticationMechanism;)Lcom/mongodb/internal/connection/MongoCredentialWithCache;
invokespecial com.mongodb.internal.connection.ScramShaAuthenticator.<init>:(Lcom/mongodb/internal/connection/MongoCredentialWithCache;)V
areturn
2: StackMap locals:
StackMap stack:
new com.mongodb.internal.connection.NativeAuthenticator
dup
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredentialWithCache:()Lcom/mongodb/internal/connection/MongoCredentialWithCache;
invokespecial com.mongodb.internal.connection.NativeAuthenticator.<init>:(Lcom/mongodb/internal/connection/MongoCredentialWithCache;)V
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 3 1 connectionDescription Lcom/mongodb/connection/ConnectionDescription;
MethodParameters:
Name Flags
connectionDescription final
private org.bson.BsonDocument createIsMasterCommand();
descriptor: ()Lorg/bson/BsonDocument;
flags: (0x0002) ACC_PRIVATE
Code:
stack=9, locals=2, args_size=1
start local 0 0: new org.bson.BsonDocument
dup
ldc "ismaster"
new org.bson.BsonInt32
dup
iconst_1
invokespecial org.bson.BsonInt32.<init>:(I)V
invokespecial org.bson.BsonDocument.<init>:(Ljava/lang/String;Lorg/bson/BsonValue;)V
astore 1
start local 1 1: aload 1
ldc "saslSupportedMechs"
2: new org.bson.BsonString
dup
ldc "%s.%s"
iconst_2
anewarray java.lang.Object
dup
iconst_0
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredential:()Lcom/mongodb/MongoCredential;
invokevirtual com.mongodb.MongoCredential.getSource:()Ljava/lang/String;
aastore
dup
iconst_1
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredential:()Lcom/mongodb/MongoCredential;
invokevirtual com.mongodb.MongoCredential.getUserName:()Ljava/lang/String;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial org.bson.BsonString.<init>:(Ljava/lang/String;)V
3: invokevirtual org.bson.BsonDocument.append:(Ljava/lang/String;Lorg/bson/BsonValue;)Lorg/bson/BsonDocument;
pop
4: aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
1 5 1 isMasterCommandDocument Lorg/bson/BsonDocument;
private com.mongodb.MongoException wrapException(java.lang.Throwable);
descriptor: (Ljava/lang/Throwable;)Lcom/mongodb/MongoException;
flags: (0x0002) ACC_PRIVATE
Code:
stack=8, locals=2, args_size=2
start local 0 start local 1 0: aload 1
instanceof com.mongodb.MongoSecurityException
ifeq 2
1: aload 1
checkcast com.mongodb.MongoSecurityException
areturn
2: StackMap locals:
StackMap stack:
aload 1
instanceof com.mongodb.MongoException
ifeq 4
aload 1
checkcast com.mongodb.MongoException
invokevirtual com.mongodb.MongoException.getCode:()I
bipush 11
if_icmpne 4
3: new com.mongodb.MongoSecurityException
dup
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredential:()Lcom/mongodb/MongoCredential;
ldc "Exception authenticating %s"
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload 0
invokevirtual com.mongodb.internal.connection.DefaultAuthenticator.getMongoCredential:()Lcom/mongodb/MongoCredential;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
aload 1
invokespecial com.mongodb.MongoSecurityException.<init>:(Lcom/mongodb/MongoCredential;Ljava/lang/String;Ljava/lang/Throwable;)V
areturn
4: StackMap locals:
StackMap stack:
aload 1
invokestatic com.mongodb.MongoException.fromThrowable:(Ljava/lang/Throwable;)Lcom/mongodb/MongoException;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/DefaultAuthenticator;
0 5 1 t Ljava/lang/Throwable;
MethodParameters:
Name Flags
t final
}
SourceFile: "DefaultAuthenticator.java"
NestMembers:
com.mongodb.internal.connection.DefaultAuthenticator$1
InnerClasses:
com.mongodb.internal.connection.DefaultAuthenticator$1