Class ClientUserAuthService
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ClientSessionHolder
,Closeable
,PropertyResolver
,Service
,SessionContextHolder
,SessionHolder<Session>
ssh-auth
service.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<UserAuthFactory>
protected final AtomicReference<AuthFuture>
The AuthFuture that is being used by the current auth request.protected final ClientSessionImpl
private int
private String
private UserAuth
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthFuture
createAuthFuture
(ClientSession session, String service) A map of properties that can be used to configure the SSH server or client.protected void
preClose()
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.void
Service the request.protected void
processUserAuth
(Buffer buffer) Execute one step in user authentication.protected IoWriteFuture
sendInitialAuthRequest
(ClientSession session, String service) void
start()
protected void
tryNext
(int cmd) protected AuthFuture
updateCurrentAuthFuture
(ClientSession session, String service) Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, doCloseGracefully, doCloseImmediately, getFutureLock, isClosed, isClosing, removeCloseFutureListener
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty
Methods inherited from interface org.apache.sshd.common.Service
getParentPropertyResolver
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Field Details
-
authFutureHolder
The AuthFuture that is being used by the current auth request. This encodes the state. isSuccess -> authenticated, else if isDone -> server waiting for user auth, else authenticating. -
clientSession
-
authFactories
-
clientMethods
-
serverMethods
-
properties
-
service
-
userAuth
-
currentMethod
private int currentMethod
-
-
Constructor Details
-
ClientUserAuthService
-
-
Method Details
-
getSession
- Specified by:
getSession
in interfaceSessionHolder<Session>
-
getClientSession
- Specified by:
getClientSession
in interfaceClientSessionHolder
- Returns:
- The underlying
ClientSession
used
-
getProperties
Description copied from interface:PropertyResolver
A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean, String
, etc.... If it doesn't, thetoString()
result of the mapped value is used to convert it to the required type. E.g., if the mapped value is the string "1234" and the expected value is along
then it will be parsed into one. Also, if the mapped value is anInteger
but along
is expected, then it will be converted into one.- Specified by:
getProperties
in interfacePropertyResolver
- Returns:
- a valid
Map
containing configuration values, nevernull
. Note: may be immutable.
-
start
public void start() -
getCurrentServiceName
-
auth
- Throws:
IOException
-
updateCurrentAuthFuture
protected AuthFuture updateCurrentAuthFuture(ClientSession session, String service) throws IOException - Throws:
IOException
-
createAuthFuture
- Throws:
IOException
-
sendInitialAuthRequest
protected IoWriteFuture sendInitialAuthRequest(ClientSession session, String service) throws IOException - Throws:
IOException
-
process
Description copied from interface:Service
Service the request. -
processUserAuth
Execute one step in user authentication. -
tryNext
- Throws:
Exception
-
preClose
protected void preClose()Description copied from class:AbstractCloseable
preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClose
in classAbstractCloseable
-