Class StaticDecisionForwardingFilter
- All Implemented Interfaces:
AgentForwardingFilter,ForwardingFilter,TcpForwardingFilter,X11ForwardingFilter
- Direct Known Subclasses:
AcceptAllForwardingFilter,RejectAllForwardingFilter
ForwardingFilter implementation that returns the same "static" result for all the queries.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.server.forward.TcpForwardingFilter
TcpForwardingFilter.Type -
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.server.forward.AgentForwardingFilter
DEFAULTFields inherited from interface org.apache.sshd.server.forward.TcpForwardingFilter
DEFAULTFields inherited from interface org.apache.sshd.server.forward.X11ForwardingFilter
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConnect(TcpForwardingFilter.Type type, SshdSocketAddress address, Session session) Determine if the session may create an outbound connection.booleancanForwardAgent(Session session, String requestType) Determine if the session may arrange for agent forwarding.booleancanForwardX11(Session session, String requestType) Determine if the session may arrange for X11 forwarding.booleancanListen(SshdSocketAddress address, Session session) Determine if the session may listen for inbound connections.protected booleancheckAcceptance(String request, Session session, SshdSocketAddress target) final boolean
-
Field Details
-
acceptance
private final boolean acceptance
-
-
Constructor Details
-
StaticDecisionForwardingFilter
public StaticDecisionForwardingFilter(boolean acceptance) - Parameters:
acceptance- The acceptance status for all the queries
-
-
Method Details
-
isAccepted
public final boolean isAccepted() -
canForwardAgent
Description copied from interface:AgentForwardingFilterDetermine if the session may arrange for agent forwarding.
This server process will open a new listen socket locally and export the address in the
SshAgent.SSH_AUTHSOCKET_ENV_NAMEenvironment variable.- Specified by:
canForwardAgentin interfaceAgentForwardingFilter- Parameters:
session- TheSessionrequesting permission to forward the agent.requestType- The request type string that triggered this call- Returns:
- true if the agent forwarding is permitted, false if denied.
-
canForwardX11
Description copied from interface:X11ForwardingFilterDetermine if the session may arrange for X11 forwarding.
This server process will open a new listen socket locally and export the address in the environment so X11 clients can be tunneled to the user's X11 display server.
- Specified by:
canForwardX11in interfaceX11ForwardingFilter- Parameters:
session- TheSessionrequesting permission to forward X11 connections.requestType- The request type string that triggered this call- Returns:
- true if the X11 forwarding is permitted, false if denied.
-
canListen
Description copied from interface:TcpForwardingFilterDetermine if the session may listen for inbound connections.
This server process will open a new listen socket on the address given by the client (usually 127.0.0.1 but may be any address). Any inbound connections to this socket will be tunneled over the session to the client, which the client will then forward the connection to another host on the client's side of the network.
- Specified by:
canListenin interfaceTcpForwardingFilter- Parameters:
address- address the client has requested this server listen for inbound connections on, and relay them through the client.session- TheSessionrequesting permission to listen for connections.- Returns:
- true if the socket is permitted; false if it must be denied.
-
canConnect
public boolean canConnect(TcpForwardingFilter.Type type, SshdSocketAddress address, Session session) Description copied from interface:TcpForwardingFilterDetermine if the session may create an outbound connection.
This server process will connect to another server listening on the address specified by the client. Usually this is to another port on the same host (127.0.0.1) but may be to any other system this server can reach on the server's side of the network.
- Specified by:
canConnectin interfaceTcpForwardingFilter- Parameters:
type- TheTcpForwardingFilter.Typeof requested connection forwardingaddress- address the client has requested this server listen for inbound connections on, and relay them through the client.session- session requesting permission to listen for connections.- Returns:
- true if the socket is permitted; false if it must be denied.
-
checkAcceptance
- Parameters:
request- The SSH request that ultimately led to this filter being consultedsession- The requestingSessiontarget- The request target - may beSshdSocketAddress.LOCALHOST_ADDRESSif no real target- Returns:
- The (static)
isAccepted()flag
-