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_FDcommand is sent by the server to the client.TheAUTHcommand is sent by the client to the server.TheBEGINcommand is sent by the client to the server.TheCANCELcommand is sent by the client to the server.TheDATAcommand 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.TheERRORcommand can be sent in either direction.TheNEGOTIATE_UNIX_FDcommand is sent by the client to the server.TheOKcommand is sent by the server to the client.TheREJECTEDcommand is sent by the server to the client. -
Method Summary
Modifier and TypeMethodDescriptionstatic SaslCommandNameReturns 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_FDcommand is sent by the server to the client.The
AGREE_UNIX_FDcommand 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_FDto enable Unix file descriptor passing. This command may only be sent on transports that support Unix file descriptor passing.On receiving
AGREE_UNIX_FDthe client must respond withBEGIN, followed by its stream of messages, or by disconnecting. The server must not accept additional commands using this protocol after theBEGINcommand has been received. Further communication will be a stream of D-Bus messages (optionally encrypted, as negotiated) rather than this protocol. -
AUTH
TheAUTHcommand is sent by the client to the server. The server replies withDATA,OKorREJECTED.If an
AUTHcommand has no arguments, it is a request to list available mechanisms. The server must respond with aREJECTEDcommand listing the mechanisms it understands, or with an error.If an
AUTHcommand specifies a mechanism, and the server supports said mechanism, the server should begin exchanging SASL challenge-response data with the client usingDATAcommands.If the server does not support the mechanism given in the
AUTHcommand, it must send either aREJECTEDcommand 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
DATAcommand. 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
DATAcommands, anOKcommand must be sent to the client. -
BEGIN
TheBEGINcommand is sent by the client to the server. The server does not reply.The
BEGINcommand acknowledges that the client has received anOKcommand 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
BEGINcommand 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
BEGINcommand 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
TheCANCELcommand is sent by the client to the server. The server replies withREJECTED.At any time up to sending the
BEGINcommand, the client may send aCANCELcommand. On receiving theCANCELcommand, the server must send aREJECTEDcommand and abort the current authentication exchange. -
DATA
TheDATAcommand 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,OKorREJECTED. -
ERROR
TheERRORcommand can be sent in either direction. If sent by the client, the server replies withREJECTED.The
ERRORcommand 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 anERRORis received instead of an appropriate response, fall back to using some other technique.If an
ERRORis sent, the server or client that sent the error must continue as if the command causing theERRORhad 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
ERRORfrom applications that don't understand it. Thus theERRORfeature 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_FDcommand is sent by the client to the server. The server replies withAGREE_UNIX_FDorERROR.The
NEGOTIATE_UNIX_FDcommand indicates that the client supports Unix file descriptor passing. This command may only be sent after the connection is authenticated, i.e. afterOKwas received by the client. This command may only be sent on transports that support Unix file descriptor passing.On receiving
NEGOTIATE_UNIX_FDthe server must respond with eitherAGREE_UNIX_FDorERROR. 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
TheOKcommand is sent by the server to the client.The
OKcommand 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_FDto the server.Otherwise, the client must respond to the
OKcommand by sending aBEGINcommand, followed by its stream of messages, or by disconnecting. The server must not accept additional commands using this protocol after theBEGINcommand 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
OKcommand 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_FDorERRORreply must be the first octet of the authenticated/encrypted stream.The
OKcommand has one argument, which is the GUID of the server. See the section called “Server Addresses” for more on server GUIDs. -
REJECTED
TheREJECTEDcommand is sent by the server to the client.The
REJECTEDcommand indicates that the current authentication exchange has failed, and further exchange ofDATAis inappropriate. The client would normally try another mechanism, or try providing different responses to challenges.Optionally, the
REJECTEDcommand 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 aREJECTEDmessage. 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
-