tomaswolf commented on a change in pull request #151: URL: https://github.com/apache/mina-sshd/pull/151#discussion_r461132590
########## File path: sshd-sftp/src/main/java/org/apache/sshd/sftp/server/SftpEventListener.java ########## @@ -35,6 +36,32 @@ * @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a> */ public interface SftpEventListener extends SshdEventListener { + + /** + * Called when a SFTP request has been received before it is processed. + * + * @param session The {@link ServerSession} through which the request was received + * @param type The request type; one of the {@code SSH_FXP_*} constants from {@link SftpConstants} + * @param id The id received with the request + * @throws IOException If the request shall generate an error response. Throwing an exception for + * {@code type = }{@link SftpConstants#SSH_FXP_INIT} closes the session. + */ + default void received(ServerSession session, int type, int id) throws IOException { + // empty + } + + /** + * Called when a SFTP extension request {@link SftpConstants#SSH_FXP_EXTENDED} has been received before it is processed. + * + * @param session The {@link ServerSession} through which the request was received + * @param extension The extension request received; one of the {@code SSH_EXT_*} constants from {@link SftpConstants} + * @param id The id received with the request + * @throws IOException If the request shall generate an error response. + */ + default void receivedExtension(ServerSession session, String extension, int id) throws IOException { + // empty + } + Review comment: These callbacks would enable the SB2Bi team to implement their "Command Limiting Policy" via an SftpEventListener. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org