Enum Class SaslCommandName
- All Implemented Interfaces:
Serializable
,Comparable<SaslCommandName>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheAGREE_UNIX_FD
command is sent by the server to the client.TheAUTH
command is sent by the client to the server.TheBEGIN
command is sent by the client to the server.TheCANCEL
command is sent by the client to the server.TheDATA
command may come from either client or server, and simply contains a hex-encoded block of data to be interpreted according to the SASL mechanism in use.TheERROR
command can be sent in either direction.TheNEGOTIATE_UNIX_FD
command is sent by the client to the server.TheOK
command is sent by the server to the client.TheREJECTED
command is sent by the server to the client. -
Method Summary
Modifier and TypeMethodDescriptionstatic SaslCommandName
Returns the enum constant of this class with the specified name.static SaslCommandName[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AGREE_UNIX_FD
TheAGREE_UNIX_FD
command is sent by the server to the client.The
AGREE_UNIX_FD
command indicates that the server supports Unix file descriptor passing. This command may only be sent after the connection is authenticated, and the client sentNEGOTIATE_UNIX_FD
to enable Unix file descriptor passing. This command may only be sent on transports that support Unix file descriptor passing.On receiving
AGREE_UNIX_FD
the client must respond withBEGIN
, followed by its stream of messages, or by disconnecting. The server must not accept additional commands using this protocol after theBEGIN
command has been received. Further communication will be a stream of D-Bus messages (optionally encrypted, as negotiated) rather than this protocol. -
AUTH
TheAUTH
command is sent by the client to the server. The server replies withDATA
,OK
orREJECTED
.If an
AUTH
command has no arguments, it is a request to list available mechanisms. The server must respond with aREJECTED
command listing the mechanisms it understands, or with an error.If an
AUTH
command specifies a mechanism, and the server supports said mechanism, the server should begin exchanging SASL challenge-response data with the client usingDATA
commands.If the server does not support the mechanism given in the
AUTH
command, it must send either aREJECTED
command listing the mechanisms it does support, or an error.If the [initial-response] argument is provided, it is intended for use with mechanisms that have no initial challenge (or an empty initial challenge), as if it were the argument to an initial
DATA
command. If the selected mechanism has an initial challenge and [initial-response] was provided, the server should reject authentication by sendingREJECTED
.If authentication succeeds after exchanging
DATA
commands, anOK
command must be sent to the client. -
BEGIN
TheBEGIN
command is sent by the client to the server. The server does not reply.The
BEGIN
command acknowledges that the client has received anOK
command from the server and completed any feature negotiation that it wishes to do, and declares that the stream of messages is about to begin.The first octet received by the server after the \r\n of the
BEGIN
command from the client must be the first octet of the authenticated/encrypted stream of D-Bus messages.Unlike all other commands, the server does not reply to the
BEGIN
command with an authentication command of its own. After the \r\n of the reply to the command beforeBEGIN
, the next octet received by the client must be the first octet of the authenticated/encrypted stream of D-Bus messages. -
CANCEL
TheCANCEL
command is sent by the client to the server. The server replies withREJECTED
.At any time up to sending the
BEGIN
command, the client may send aCANCEL
command. On receiving theCANCEL
command, the server must send aREJECTED
command and abort the current authentication exchange. -
DATA
TheDATA
command may come from either client or server, and simply contains a hex-encoded block of data to be interpreted according to the SASL mechanism in use. If sent by the client, the server replies withDATA
,OK
orREJECTED
. -
ERROR
TheERROR
command can be sent in either direction. If sent by the client, the server replies withREJECTED
.The
ERROR
command indicates that either server or client did not know a command, does not accept the given command in the current context, or did not understand the arguments to the command. This allows the protocol to be extended; a client or server can send a command present or permitted only in new protocol versions, and if anERROR
is received instead of an appropriate response, fall back to using some other technique.If an
ERROR
is sent, the server or client that sent the error must continue as if the command causing theERROR
had never been received. However, the server or client receiving the error should try something other than whatever caused the error; if only canceling/rejecting the authentication.If the D-Bus protocol changes incompatibly at some future time, applications implementing the new protocol would probably be able to check for support of the new protocol by sending a new command and receiving an
ERROR
from applications that don't understand it. Thus theERROR
feature of the auth protocol is an escape hatch that lets us negotiate extensions or changes to the D-Bus protocol in the future. -
NEGOTIATE_UNIX_FD
TheNEGOTIATE_UNIX_FD
command is sent by the client to the server. The server replies withAGREE_UNIX_FD
orERROR
.The
NEGOTIATE_UNIX_FD
command indicates that the client supports Unix file descriptor passing. This command may only be sent after the connection is authenticated, i.e. afterOK
was received by the client. This command may only be sent on transports that support Unix file descriptor passing.On receiving
NEGOTIATE_UNIX_FD
the server must respond with eitherAGREE_UNIX_FD
orERROR
. It shall respond the former if the transport chosen supports Unix file descriptor passing and the server supports this feature. It shall respond the latter if the transport does not support Unix file descriptor passing, the server does not support this feature, or the server decides not to enable file descriptor passing due to security or other reasons. -
OK
TheOK
command is sent by the server to the client.The
OK
command indicates that the client has been authenticated. The client may now proceed with negotiating Unix file descriptor passing. To do that it shall sendNEGOTIATE_UNIX_FD
to the server.Otherwise, the client must respond to the
OK
command by sending aBEGIN
command, followed by its stream of messages, or by disconnecting. The server must not accept additional commands using this protocol after theBEGIN
command has been received. Further communication will be a stream of D-Bus messages (optionally encrypted, as negotiated) rather than this protocol.If there is no negotiation, the first octet received by the client after the \r\n of the
OK
command must be the first octet of the authenticated/encrypted stream of D-Bus messages. If the client negotiates Unix file descriptor passing, the first octet received by the client after the \r\n of theAGREE_UNIX_FD
orERROR
reply must be the first octet of the authenticated/encrypted stream.The
OK
command has one argument, which is the GUID of the server. See the section called “Server Addresses” for more on server GUIDs. -
REJECTED
TheREJECTED
command is sent by the server to the client.The
REJECTED
command indicates that the current authentication exchange has failed, and further exchange ofDATA
is inappropriate. The client would normally try another mechanism, or try providing different responses to challenges.Optionally, the
REJECTED
command has a space-separated list of available auth mechanisms as arguments. If a server ever provides a list of supported mechanisms, it must provide the same list each time it sends aREJECTED
message. Clients are free to ignore all lists received after the first.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-