Class MoverProvider
java.lang.Object
ecmwf.common.ecaccess.NativeAuthenticationProvider
ecmwf.ecpds.mover.MoverProvider
The Class MoverProvider.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThe Class UserDataSpace. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longTTL for HTTPS portal session tokens (default: 1 hour).static final StringPrefix used in the password field to signal a cached session token. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void_forceCloseOfDataSpace(MoverProvider.UserDataSpace dataSpace, Closeable closeable) Force close of the data space.static voidClose all incoming connections.static booleanClose incoming connection.static String[]Gets the incoming connection ids.static List<IncomingConnection> Gets the incoming connections.getRoot()Gets the root.static StringgetUserForPortalSession(String token) Look up the cached user name for a portal session token.getUserSession(String host, String user, ECauthToken token, String profile, Closeable closeable) Gets the user session.getUserSession(String host, String ticket, String profile, Closeable closeable) Called if we have a ticket.Called if we have a password.static voidinvalidatePortalSession(String token) Invalidate a portal session token, removing it from the cache immediately.booleanisPassword(String user, String password) Allow differentiating tickets and passwords.booleanisRegistredUser(String user) Checks if it is a registred user.static StringregisterPortalSession(String user, IncomingProfile profile) Register a portal session token for a user whose credentials have already been validated (e.g.booleanIf tickets are supported then the isPassword method will be called to differentiate the passwords and the tickets.Methods inherited from class NativeAuthenticationProvider
connected, getECUser, getInstance, getNewCertificate, getNewToken, getNewToken, newActivity, newEvent, setProvider
-
Field Details
-
_portalSessionTtlMs
public static final long _portalSessionTtlMsTTL for HTTPS portal session tokens (default: 1 hour). -
PORTAL_SESSION_PREFIX
Prefix used in the password field to signal a cached session token.- See Also:
-
-
Constructor Details
-
MoverProvider
public MoverProvider()
-
-
Method Details
-
getUserForPortalSession
-
registerPortalSession
Register a portal session token for a user whose credentials have already been validated (e.g. SSH password auth that runs before the SFTP FileSystemProvider is initialised). Returns the token so the caller can pass it as the password in a subsequentgetUserSession(String, String, String, String, Closeable)call, avoiding a second TOTP round-trip.- Parameters:
user- the user nameprofile- the already-validated incoming profile (ignored — kept for API compatibility)- Returns:
- the new session token
-
invalidatePortalSession
Invalidate a portal session token, removing it from the cache immediately. A no-op if the token is unknown.- Parameters:
token- the session token to invalidate
-
closeAllIncomingConnections
public static void closeAllIncomingConnections()Close all incoming connections. -
closeIncomingConnection
Close incoming connection.- Parameters:
id- the id- Returns:
- true, if successful
-
_forceCloseOfDataSpace
public static void _forceCloseOfDataSpace(MoverProvider.UserDataSpace dataSpace, Closeable closeable) Force close of the data space.- Parameters:
dataSpace- the data spacecloseable- the closeable
-
getIncomingConnectionIds
Gets the incoming connection ids.- Returns:
- the incoming connection ids
-
getIncomingConnections
Gets the incoming connections.- Returns:
- the incoming connections
-
isRegistredUser
Checks if it is a registred user. Checks if is registred user.- Specified by:
isRegistredUserin classNativeAuthenticationProvider- Parameters:
user- the user- Returns:
- true, if is registred user
- Throws:
Exception- the exception
-
getUserSession
public UserSession getUserSession(String host, String user, String password, String profile, Closeable closeable) throws Exception Called if we have a password. Gets the user session.- Specified by:
getUserSessionin classNativeAuthenticationProvider- Parameters:
host- the hostuser- the userpassword- the passwordprofile- the profilecloseable- the closeable- Returns:
- the user session
- Throws:
Exception- the exception
-
getUserSession
public UserSession getUserSession(String host, String user, ECauthToken token, String profile, Closeable closeable) throws Exception Gets the user session. Gets the user session.- Specified by:
getUserSessionin classNativeAuthenticationProvider- Parameters:
host- the hostuser- the usertoken- the tokenprofile- the profilecloseable- the closeable- Returns:
- the user session
- Throws:
Exception- the exception
-
getUserSession
public UserSession getUserSession(String host, String ticket, String profile, Closeable closeable) throws Exception Called if we have a ticket. Gets the user session.- Specified by:
getUserSessionin classNativeAuthenticationProvider- Parameters:
host- the hostticket- the ticketprofile- the profilecloseable- the closeable- Returns:
- the user session
- Throws:
Exception- the exception
-
supportTickets
public boolean supportTickets()If tickets are supported then the isPassword method will be called to differentiate the passwords and the tickets. Support tickets.- Overrides:
supportTicketsin classNativeAuthenticationProvider- Returns:
- true, if it does support tickets.
-
isPassword
Allow differentiating tickets and passwords. Depending of the result the session will be created with one getUserSession or the other. Checks if is password.- Overrides:
isPasswordin classNativeAuthenticationProvider- Parameters:
user- the userpassword- the password or ticket- Returns:
- true, if it is a password
-
getRoot
Gets the root. Gets the root.- Specified by:
getRootin classNativeAuthenticationProvider- Returns:
- the root
- Throws:
RemoteException
-