Network Working Group J. G. Myers Internet Draft: ACAP Carnegie Mellon Document: internet-drafts/draft-myers-acap-spec-00.txt June 1996 Expire in six months ACAP -- Application Configuration Access Protocol Status of this Memo This document is an Internet Draft. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its Areas, and its Working Groups. Note that other groups may also distribute working documents as Internet Drafts. Internet Drafts are draft documents valid for a maximum of six months. Internet Drafts may be updated, replaced, or obsoleted by other documents at any time. It is not appropriate to use Internet Drafts as reference material or to cite them other than as a ``working draft'' or ``work in progress``. To learn the current status of any Internet-Draft, please check the 1id-abstracts.txt listing contained in the Internet-Drafts Shadow Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or munnari.oz.au. This document suggests a proposed protocol for the Internet community, and requests discussion and suggestions for improvements. Distribution of this draft is unlimited. The protocol discussed in this document is experimental and subject to change. Persons planning on either implementing or using this protocol are STRONGLY URGED to get in touch with the author before embarking on such a project. Abstract The Application Configuration Access Protocol (ACAP) is designed to support remote storage and access of program option, configuration and preference information. Myers [Page i] Internet DRAFT ACAP June 11, 1996 ACAP Protocol Specification 1. Conventions Used in this Document In examples, "C:" and "S:" indicate lines sent by the client and server respectively. The protocol syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [RFC-822] with one exception; the delimiter used with the "#" construct is a single space (SPACE) and not one or more commas. The "::+" extension to the ABNF notation is used to allow nonterminals to be defined as a set of alternatives, each alternative being defined in a separate lines. The sequence of productions: a ::+ b a ::+ c a ::+ d is equivalent to a ::= (b) / (c) / (d) 2. Protocol Overview 2.1. Link Level The ACAP protocol assumes a reliable data stream such as provided by TCP. When TCP is used, an ACAP server listens on port XXXX. 2.2. Commands and Responses An ACAP session consists of the establishment of a client/server connection, an initial greeting from the server, and client/server interactions. These client/server interactions consist of a client command, server data, and a server completion result response. All interactions transmitted by client and server are in the form of lines; that is, strings that end with a CRLF. The protocol receiver of an ACAP client or server is either reading a line, or is reading a sequence of octets with a known count followed by a line. Myers [Page 1] Internet DRAFT ACAP June 11, 1996 2.2.1. Client Protocol Sender and Server Protocol Receiver The client command begins an operation. Each client command is prefixed with a identifier (typically a short alphanumeric string, e.g. A0001, A0002, etc.) called a "tag". A different tag is generated by the client for each command. There are two cases in which a line from the client does not represent a complete command. In one case, a command argument is quoted with an octet count (see the description of literal in String under Data Formats); in the other case, the command arguments require server feedback (see the AUTHENTICATE command). In some of these cases, the server sends a command continuation request response if it is ready for the octets (if appropriate) and the remainder of the command. This response is prefixed with the token "+". Note: If, instead, the server detected an error in the command, it sends a BAD completion response with tag matching the command (as described below) to reject the command and prevent the client from sending any more of the command. It is also possible for the server to send a completion or intermediate response for some other command (if multiple commands are in progress), or untagged data. In either case, the command continuation request is still pending; the client takes the appropriate action for the response, and reads another response from the server. The protocol receiver of an ACAP server reads a command line from the client, parses the command and its arguments, and transmits server data and a server command completion result response. 2.2.2. Server Protocol Sender and Client Protocol Receiver Data transmitted by the server to the client come in four forms: command continuation requests, command completion results, intermediate responses, and untagged responses. A command completion request is prefixed with the token "+". A command completion result response indicates the success or failure of the operation. It is tagged with the same tag as the client command which began the operation. Thus, if more than one command is in progress, the tag in a server completion response identifies the command to which the response applies. There are three possible server completion responses: OK (indicating success), NO (indicating Myers [Page 2] Internet DRAFT ACAP June 11, 1996 failure), or BAD (indicating protocol error such as unrecognized command or command syntax error). An intermediate response returns data which can only be interpreted within the context of a command in progress. It is tagged with the same tag as the client command which began the operation. Thus, if more than one command is in progress, the tag in an intermediate response identifies the command to which the response applies. A tagged response other than "OK", "NO", or "BAD" is an intermediate response. An untagged response returns data or status messages which may be interpreted outside the context of a command in progress. It is prefixed with the token "*". Untagged data may be sent as a result of a client command, or may be sent unilaterally by the server. There is no syntactic difference between untagged data that resulted from a specific command and untagged data that were sent unilaterally. The protocol receiver of an ACAP client reads a response line from the server. It then takes action on the response based upon the first token of the response, which may be a tag, a "*", or a "+" as described above. A client MUST be prepared to accept any server response at all times. This includes untagged data that it may not have requested. This topic is discussed in greater detail in the Server Responses section. 2.3. State and Flow Diagram An ACAP server is in one of three states. Most commands are valid in only certain states. It is a protocol error for the client to attempt a command while the command is in an inappropriate state. In this case, a server will respond with a BAD or NO (depending upon server implementation) command completion result. 2.3.1. Non-Authenticated State In non-authenticated state, the user must supply authentication credentials before most commands will be permitted. This state is entered when a connection starts. Myers [Page 3] Internet DRAFT ACAP June 11, 1996 2.3.2. Authenticated State In authenticated state, the user is authenticated and most commands will be permitted. This state is entered when acceptable authentication credentials have been provided. 2.3.3. Logout State In logout state, the session is being terminated, and the server will close the connection. This state can be entered as a result of a client request or by unilateral server decision. +--------------------------------------+ |initial connection and server greeting| +--------------------------------------+ || (1) || (2) VV || +-----------------+ || |non-authenticated| || +-----------------+ || || (4) || (3) || || VV || || +----------------+ || || | authenticated | || || +----------------+ || || || (4) || VV VV VV +--------------------------------------+ | logout and close connection | +--------------------------------------+ (1) connection (ACAP greeting) (2) rejected connection (BYE greeting) (3) successful LOGIN or AUTHENTICATE command (4) LOGOUT command, server shutdown, or connection closed 2.4. Data Formats ACAP uses textual commands and responses. Data in ACAP can be in one of several forms: atom, number, string, parenthesized list, or NIL. 2.4.1. Atom An atom consists of one or more non-special characters. Myers [Page 4] Internet DRAFT ACAP June 11, 1996 2.4.2. Number A number consists of one or more digit characters, and represents a numeric value. 2.4.3. String A string is in one of two forms: literal and quoted string. The literal form is the general form of string. The quoted string form is an alternative that avoids the overhead of processing a literal at the cost of restrictions of what may be in a quoted string. A literal is a sequence of zero or more octets (including CR and LF), prefix-quoted with an octet count in the form of an open brace ("{"), the number of octets, close brace ("}"), and CRLF. In the case of literals transmitted from server to client, the CRLF is immediately followed by the octet data. In the case of literals transmitted from client to server, the client must wait to receive a command continuation request (described later in this document) before sending the octet data (and the remainder of the command). [TODO describe non-synchronizing literals.] A quoted string is a sequence of zero to 1024 7-bit characters, excluding CR and LF, with double quote (<">) characters at each end. The empty string is respresented as either "" (a quoted string with zero characters between double quotes), as {0} followed by CRLF (a synchronizing literal with an octet count of 0), or as {0+} followed by a CRLF (a non-synchronizing literal with an octet count of 0). Note: Even if the octet count is 0, a client transmitting a literal must wait to receive a command continuation request. 2.4.3.1. 8-bit and Binary Strings ACAP implementations MAY transmit 8-bit or multi-octet characters in literals, but should do so only when the character set is identified. NUL octets are only permitted in the values of attributes whose names end with ".bin". 2.5. Operational Considerations Myers [Page 5] Internet DRAFT ACAP June 11, 1996 2.5.1. Untagged Status Updates At any time, a server can send data that the client did not request. 2.5.2. Response when no Command in Progress Server implementations are permitted to send an untagged response while there is no command in progress. Server implementations that send such responses MUST deal with flow control considerations. Specifically, they must either (1) verify that the size of the data does not exceed the underlying transport's available window size, or (2) use non-blocking writes. 2.5.3. Autologout Timer If a server has an inactivity autologout timer, that timer MUST be of at least 30 minutes' duration. The receipt of ANY command from the client during that interval should suffice to reset the autologout timer. 2.5.4. Multiple Commands in Progress The client is not required to wait for the completion result response of a command before sending another command, subject to flow control constraints on the underlying data stream. Similarly, a server is not required to process a command to completion before beginning processing of the next command, unless an ambiguity would result because of a command that would affect the results of other commands. If there is such an ambiguity, the server executes commands to completion in the order given by the client. 2.6. Datasets The primary data structure in ACAP is the "dataset", which is a named set of entries. Datasets are named hierarchically, with each component of the name being preceeded by a slash ("/") and containing one or more characters (other than slash) in the currently selected charset. Each entry in a dataset is a set of attribute/value pairs. Each attribute is a hierarchical name in the currently selected charset, with each component of the name being separated with a period ("."). There must be exactly one "name" attribute, whose value is unique amongst all entries in the dataset. Myers [Page 6] Internet DRAFT ACAP June 11, 1996 Entries in a dataset are ordered in a server-determined manner. [OPEN ISSUE] With the exception of "name", the same attribute may be listed more than once. The order of values corresponding to the same attribute is significant, the order of values corresponding to different attriutes is not significant. The value is a string containing one or more octets. The semantics of a value are defined by the specification of its attribute. Values of attributes ending in ".bin" contain arbitrary data and are not affected by charset selection. Values of other attributes are textual and are in the currently selected charset. 2.6. Predefined Attributes The following attributes are defined by the ACAP protocol. name Contains the name of the entry. modtime Contains the date and time, in UTC, any value in the entry was last modified. This value is automatically updated by the server and may not be directly modified by the client. The value consists of 14 or more us-ascii digits. The first four indicate the year, the next two indicate the month, the next two indicate the day of month, the next two indicate the hour (0 - 23), the next two indicate the minute, and the next two indicate the second. Any further digits indicate fractional seconds. Myers [Page 7] Internet DRAFT ACAP June 11, 1996 3. Protocol Specification ACAP commands and responses are described in this section. Commands are organized first by the state in which the command is permitted, then by a general category of command type. Command arguments, identified by "Arguments:" in the command descriptions below, are described by function, not by syntax. The precise syntax of command arguments is described in the Formal Syntax section. Some commands cause specific server data to be returned; these are identified by "Data:" in the command descriptions below. See the response descriptions in the Responses section for information on these responses, and the Formal Syntax section for the precise syntax of these responses. It is possible for server data to be transmitted as a result of any command; thus, commands that do not specifically require server data specify "no specific data for this command" instead of "none". The "Result:" in the command description refers to the possible tagged status responses to a command, and any special interpretation of these status responses. 3.1. Initial Connection Upon session startup, the server sends one of two untagged responses: ACAP or BYE. The untagged BYE response is described in section XXX. 3.1.1. ACAP Response Data: capability list The untagged ACAP response indicates the session is ready to accept commands and contains a space-separated listing of capabilities that the server supports. Each capability is an atom name, possibly followed by a string argument in parenthesis. ACAP capability names MUST be registered with IANA. [OPEN ISSUE: ESTABLISH REGISTRY]. Client implementations SHOULD NOT require any capability name, and MUST ignore any unknown capability names. [TODO: initial capability list: IMPLEMENTATION, CHARSET, CONTEXTLIMIT, ORDERINGS] Myers [Page 8] Internet DRAFT ACAP June 11, 1996 Example: S: * ACAP IMPLEMENTATION("ACME v3.5") CHARSET(utf-8) 3.2. Any State The following commands and responses are valid in any state. 3.2.1. NOOP Command Arguments: none Data: no specific data for this command (but see below) Result: OK - noop completed BAD - command unknown or arguments invalid The NOOP command always succeeds. It does nothing. Since any command can return a status update as untagged data, the NOOP command can be used as a periodic poll for status updates during a period of inactivity. The NOOP command can also be used to reset any inactivity autologout timer on the server. Example: C: a002 NOOP S: a002 OK NOOP completed 3.2.2. LOGOUT Command Arguments: none Data: mandatory untagged response: BYE Result: OK - logout completed BAD - command unknown or arguments invalid The LOGOUT command informs the server that the client is done with the session. The server must send a BYE untagged response before the (tagged) OK response, and then close the network connection. Example: C: A023 LOGOUT S: * BYE ACAP Server logging out S: A023 OK LOGOUT completed (Server and client then close the connection) Myers [Page 9] Internet DRAFT ACAP June 11, 1996 3.2.3. OK Response Data: optional response code human-readable text The OK response indicates an information message from the server. When tagged, it indicates successful completion of the associated command. The human-readable text may be presented to the user as an information message. The untagged form indicates an information-only message; the nature of the information may be indicated by a response code. Example: S: * OK [ALERT] System shutdown in 10 minutes 3.2.4. NO Response Data: optional response code human-readable text The NO response indicates an operational error message from the server. When tagged, it indicates unsuccessful completion of the associated command. The untagged form indicates a warning; the command may still complete successfully. The human-readable text describes the condition. Example: C: A001 LOGIN fred secret S: * NO [ALERT] Dataet "/addressbook/fred" is at 98% of quota [TODO-FIX] S: A001 OK LOGIN ... C: A222 STORE /mailboxes "comp.mail.misc" mailbox.creation-time "19951206103412" S: A222 NO Permission denied 3.2.5. BAD Response Data: optional response code human-readable text The BAD response indicates an error message from the server. When tagged, it reports a protocol-level error in the client's command; the tag indicates the command that caused the error. The untagged form indicates a protocol-level error for which the associated command can not be determined; it may also indicate an internal Myers [Page 10] Internet DRAFT ACAP June 11, 1996 server failure. The human-readable text describes the condition. Example: C: ...empty line... S: * BAD Empty command line C: A443 BLURDYBLOOP S: A443 BAD Unknown command 3.2.6. BYE Response Data: optional response code human-readable text The untagged BYE response indicates that the server is about to close the connection. The human-readable text may be displayed to the user in a status report by the client. The BYE response may be sent as part of a normal logout sequence, or as a panic shutdown announcement by the server. It is also used by some server implementations as an announcement of an inactivity autologout. This response is also used as one of two possible greetings at session startup. It indicates that the server is not willing to accept a session from this client. Example: S: * BYE Autologout; idle for too long 3.3. Non-Authenticated State In non-authenticated state, the AUTHENTICATE or LOGIN command establishes authentication and enter authenticated state. The AUTHENTICATE command provides a general mechanism for a variety of authentication techniques, whereas the LOGIN command uses the traditional user name and plaintext password pair. Server implementations may allow non-authenticated access to certain information. The convention is to use a LOGIN command with the userid "anonymous". A password is required. It is implementation- dependent what requirements, if any, are placed on the password and what access restrictions are placed on anonymous users. Once authenticated (including as anonymous), it is not possible to re-enter non-authenticated state. In addition to the universal commands (NOOP and LOGOUT), the following commands are valid in non-authenticated state: AUTHENTICATE and LOGIN. Myers [Page 11] Internet DRAFT ACAP June 11, 1996 3.3.1. AUTHENTICATE Command Arguments: authentication mechanism name Data: continuation data may be requested Result: OK - authenticate completed, now in authenticated state NO - authenticate failure: unsupported authentication mechanism, credentials rejected BAD - command unknown or arguments invalid, authentication exchange cancelled The AUTHENTICATE command indicates an authentication mechanism, such as described in [IMAP-AUTH], to the server. If the server supports the requested authentication mechanism, it performs an authentication protocol exchange to authenticate and identify the user. Optionally, it also negotiates a protection mechanism for subsequent protocol interactions. If the requested authentication mechanism is not supported, the server should reject the AUTHENTICATE command by sending a tagged NO response. TODO update for SASL, specify service name of "acap". The authentication protocol exchange consists of a series of server challenges and client answers that are specific to the authentication mechanism. A server challenge consists of a command continuation request response with the "+" token followed by a BASE64 encoded string. The client answer consists of a line consisting of a BASE64 encoded string. If the client wishes to cancel an authentication exchange, it should issue a line with a single "*". If the server receives such an answer, it must reject the AUTHENTICATE command by sending a tagged BAD response. A protection mechanism provides integrity and privacy protection to the protocol session. If a protection mechanism is negotiated, it is applied to all subsequent data sent over the connection. The protection mechanism takes effect immediately following the CRLF that concludes the authentication exchange for the client, and the CRLF of the tagged OK response for the server. Once the protection mechanism is in effect, the stream of command and response octets is processed into buffers of ciphertext. Each buffer is transferred over the connection as a stream of octets prepended with a four octet field in network byte order that represents the length of the following data. The maximum ciphertext buffer length is defined by the protection mechanism. The server is not required to support any particular authentication mechanism, nor are authentication mechanisms required to support any protection mechanisms. If an AUTHENTICATE Myers [Page 12] Internet DRAFT ACAP June 11, 1996 command fails with a NO response, the client may try another authentication mechanism by issuing another AUTHENTICATE command, or may attempt to authenticate by using the LOGIN command. In other words, the client may request authentication types in decreasing order of preference, with the LOGIN command as a last resort. Example: S: * ACAP IMPLEMENTATION("Blorfysoft v3.5") AUTH(KERBEROS_V4) C: A001 AUTHENTICATE KERBEROS_V4 S: + AmFYig== C: BAcAQU5EUkVXLkNNVS5FRFUAOCAsho84kLN3/IJmrMG+25a4DT +nZImJjnTNHJUtxAA+o0KPKfHEcAFs9a3CL5Oebe/ydHJUwYFd WwuQ1MWiy6IesKvjL5rL9WjXUb9MwT9bpObYLGOKi1Qh S: + or//EoAADZI= C: DiAF5A4gA+oOIALuBkAAmw== S: A001 OK Kerberos V4 authentication successful Note: the line breaks in the first client answer are for editorial clarity and are not in real authenticators. 3.3.2. LOGIN Command Arguments: user name password Data: no specific data for this command Result: OK - login completed, now in authenticated state NO - login failure: user name or password rejected BAD - command unknown or arguments invalid The LOGIN command identifies the user to the server and carries the plaintext password authenticating this user. Example: C: a001 LOGIN SMITH SESAME S: a001 OK LOGIN completed 3.4. Searching This section describes the SEARCH command, for retrieving data from datasets. Myers [Page 13] Internet DRAFT ACAP June 11, 1996 3.4.1. SEARCH Command Arguments: dataset or context name optional list of modifiers search criteria Data: intermediate responses: ENTRY Result: OK - search completed NO - search failure: can't perform search BAD - command unknown or arguments invalid The SEARCH command identifies a subset of entries in a dataset and returns information on that subset to the client. The first argument to SEARCH identifies what is to be searched. If the string begins with a slash ("/"), it is the name of a dataset to be searched, otherwise it is a name of a context that was created by a SEARCH command given previously in the session. Following that are zero or more modifiers to the search. Each modifier may be specified at most once. The defined modifiers are: LIMIT number Limits the number of intermediate ENTRY responses that the search may generate. The numeric argument specifies the limit. If the search matches more entries than the limit, then no ENTRY intermediate responses are returned and the SEARCH command fails, returning the number of matches in a TOOMANY special information token in the tagged NO response. MAKECONTEXT nameInstead of returning ENTRY intermediate responses, the SEARCH command creates a context with the name given in the argument to refer to the matching entries. If the SEARCH is successful, the server returns the number of matching entries in a NEWCONTEXT special information token in the tagged OK response. The context name may then be given as an argument to subsequent SEARCH commands to search the set of matching entries. If a context with the specified name already exists, it is first freed. If a new context may not be created due to the server's limit on the Myers [Page 14] Internet DRAFT ACAP June 11, 1996 number of existing contexts, the command fails, returning a TOOMANYCONTEXTS special information token in the tagged NO response. Contexts are discussed in more detail in section XXX. RETURN (attribute...) Limits the set of attributes returned in intermediate ENTRY responses to the "name" attribute and those listed in parentheses. [OPEN ISSUE: wildcards?] If no RETURN modifier is specified,a all attributes are returned. SORT (attribute ordering...) Specifies the order in which any resulting ENTRY replies are to be returned to the client. The SORT modifier takes as an argument a parenthesized list of one or more attribute/ordering pairs. Attribute lists the attribute to sort on, ordering specifies the name of the collation rule to apply to the values of the attribute. [OPEN ISSUE: how to deal with multi-valued attributes] [TODO: list predefined orderings, establish registry]. Successive attribute/ordering pairs are used to apply ordering of two entries only when all preceeding pairs indicate two entries collate the same. If the SORT modifier is used in conjunction with the MAKECONTEXT modifier, the SORT modifier specifies the ordering of entries in the created context. If no SORT modifier is specified, or none of the attribute/ordering pairs indicates an order to two entries, the server uses the order of the entries that exists in the context or dataset being searched. Following the modifiers is the search criteria. Searching criteria consist of one or more search keys. When multiple keys are specified, the result is the intersection (AND function) of all the messages that match those keys. For example, the criteria COMPARE +octet modtime "19951206103400" COMPARE -octet modtime "19960112000000" refers to all entries modified between 10:34 December 6 1995 and midnight January 12, 1996. A search key may Myers [Page 15] Internet DRAFT ACAP June 11, 1996 also be a parenthesized list of one or more search keys (e.g. for use with the OR and NOT keys). The currently defined search keys are as follows. COMPARE attribute ordering value Entries for which the specified attribute collates using the specified ordering the same or later than the specified value. COMPARESTRICT attribute ordering value Entries for which the specified attribute collates using the specified ordering later than the specified value. EQUAL attribute ordering value Entries for which the specified attribute collates using the specified ordering the same as the specified value. GLOB attribute pattern Entries for which the [XXX multiple?] value of the specified attribute matches the specified pattern. [OPEN ISSUE: what about ordering?] GLOBREFERENCE reference pattern Entries whose name matches the specified reference and pattern, per the semantics of the IMAP4 LIST command [IMAP4]. This search key may only be used when searching IMAP4 mailbox list datasets. NOT search-key Entries that do not match the specified search key. OR search-key1 search-key2 Entries that match either search key. RANGE start endEntries which are within the specified range of the dataset or context's ordering. The lowest-ordered entry in the dataset or context is assigned number one, the next lowest entry is assigned number two, and so on. The numeric arguments specify the lowest and highest numbers to match. Example: C: [TODO - write examples] Myers [Page 16] Internet DRAFT ACAP June 11, 1996 3.4.2. ENTRY Response Data: entry name entry data The ENTRY intermediate response occurs as a result of a SEARCH or LOCK command. This is the means by which dataset entries are returned to the client. The entry with the given name matches the search. Following the entry name is a set of zero or more attribute/value pairs contained in the entry. If not all attribute/value pairs in the entry were returned (due to a RETURN directive), the last attribute/value pair is followed by "...". 3.5. Contexts A context is an ordered subset of entries in a dataset, created by a SEARCH command with a MAKECONTEXT modifier. Context names are client-generated strings and must not start with the slash ('/') character. Contexts only have scope within the ACAP session they were created. There is a server-imposed limit on the number of contexts that may exist at one time within a session. The minimum value for this limit is 5, if the server supports a larger limit it must advertise it in a CONTEXTLIMIT capability. 3.5.1. FREECONTEXT Command Arguments: context name Data: no specific data for this command Result: OK - freecontext completed NO - freecontext failure: no such context BAD - command unknown or arguments invalid The FREECONTEXT command causes the server to free all state associated with the named context. The context may no longer be searched and the server will no longer issue any untagged responses for the context. The context is no longer counted against the server's limit on the number of contexts. Example: C: A683 FREECONTEXT blurdybloop S: A683 OK Freecontext completed Myers [Page 17] Internet DRAFT ACAP June 11, 1996 3.5.2. NOTIFYCONTEXT Command Arguments: context name list of attributes Data: untagged responses: ADDTO REMOVEFROM CHANGE Result: OK - Notifycontext completed: notifications enabled for context NO - Notifycontext failed: no such context BAD - command unknown or arguments invalid The NOTIFYCONTEXT command requests the server send untagged ADDTO, REMOVEFROM, and CHANGE responses for the specified context, notifying the client of how the results of the SEARCH command that created the context would change due to modifications that have been made to the dataset. Following the context name is the list of attributes to be returned in ADDTO and CHANGE responses for the context. [OPEN ISSUE: NOTIFYCONTEXT on contexts created from contexts, when the parent context has been given to the FREECONTEXT or NOTIFYCONTEXT command.] The server may issue untagged ADDTO, REMOVEFROM, or CHANGE notifications for a context at any time between the issuing of the NOTIFYCONTEXT command for the context and the completion of a FREECONTEXT command for the context. The client may issue a subsequent NOTIFYCONTEXT command for the same context, this has the effect of changing the list of attributes included in ADDTO and CHANGE responses for the context. Example: C: Z4S9 NOTIFYCONTEXT blurdybloop S: Z4S9 OK notifications enabled for context 3.5.3. ADDTO Response Data: context name entry name position attribute/value list The untagged ADDTO response informs the client that an entry has been added to a context. The response includes the position number of the added entry (the first entry in the context is numbered 1) and those attribute/value pairs contained in the entry Myers [Page 18] Internet DRAFT ACAP June 11, 1996 which match attributes specified in the last NOTIFYCONTEXT command for the context. Example: S: * ADDTO blurdybloop fred 15 3.5.4. REMOVEFROM Response Data: context name entry name old position The untagged REMOVEFROM response informs the client that an entry has been removed from a context. The response includes the position number that the removed entry used to have (the first entry in the context is numbered 1). Example: S: * REMOVEFROM blurdybloop fred 15 3.5.5. CHANGE Response Data: context name entry name old position new position attribute/value list The untagged CHANGE response informs the client that an entry in a context has either changed position in the context or has changed the values of one or more of the attributes specified in the last NOTIFYCONTEXT command for the context. The response includes the previous and current position numbers of the entry (the first entry in the context is numbered 1) and those attribute/value pairs contained in the entry which match attributes specified in the last NOTIFYCONTEXT command for the context. Example: S: * CHANGE blurdybloop fred 15 10 3.6. Dataset modification The following commands and responses handle modification of datasets. Myers [Page 19] Internet DRAFT ACAP June 11, 1996 3.6.1. STORE Command Arguments: dataset name entry name attribute/value list Data: no specific data for this command Result: OK - store completed NO - store failure: can't store that name BAD - command unknown or arguments invalid Creates or modifies the named entry in the named dataset. The values of attributes not specified in the command are not changed. Setting the value of an attribute to the null string removes the attribute from the entry. The reserved attribute "name" may not be included in the attribute/value list. Example: C: A342 STORE Fred "Barney Rubble" addressbook.phone "555" addressbook.email "" S: A342 OK Store completed 3.6.2. DELETE Command Arguments: dataset name entry name Data: no specific data for this command Result: OK - delete completed NO - delete failure: can't delete that entry BAD - command unknown or arguments invalid Removes the named entry from the named dataset. Myers [Page 20] Internet DRAFT ACAP June 11, 1996 3.6.3. DELETEDSINCE Command Arguments: dataset name time Data: untagged response: DELETEDFROM Result: OK - Deletedfrom completed NO - Deletedfrom failure: can't read dataset date too far in the past BAD - command unknown or arguments invalid The DELETEDFROM command returns in untagged [OPEN ISSUE: intermediate?] DELETEDFROM replies the names of entries that have been deleted from the named dataset since the given time. Servers may impose a limit on the number or age of deleted entry names they keep track of. If the server does not have information going back to the specified time, the command fails, returning a TOOOLD special information token in the tagged NO response. Example: C: Z4S9 DELETEDSINCE /mailboxes 19951205103412 S: * DELETEDFROM /mailboxes shared.blurdybloop S: * DELETEDFROM /mailboxes shared.anteaters S: Z4S9 OK DELETEDSINCE completed 3.6.4. DELETEDFROM Response Data: dataset name entry name The untagged DELETEDFROM response occurs as a result of a DELETEDSINCE command. It returns the names of a dataset and an entry that has been deleted from the dataset. Example: S: * DELETEDFROM /mailboxes shared.blurdybloop 3.7. Dataset management [OPEN ISSUE: how to create/delete/rename a dataset] 3.8. Access Control Lists An access control list is a set of pairs. Identifier is a US-ASCII string. The identifier anyone is reserved to refer to the universal identity (all authentications, including Myers [Page 21] Internet DRAFT ACAP June 11, 1996 anonymous). All user name strings accepted by the LOGIN or AUTHENTICATE commands to authenticate to the ACAP server are reserved as identifiers to refer to the corresponding user. All other identifier strings have implementation-defined semantics. Possible variations of identifier interpretation include, but are not limited to: * Named groups of users, presumably managed by some authorization service. * A prefix to the identifier specifying an "authentication type". * Whether the union of rights for matching identifiers are granted to a user or whether the rights for the most specific matching identifier is granted. As an example, for a mailbox with the following ACL: user ra group-user-is-in rw One implementation may grant the user 'rwa' rights, another may only grant the user 'ra' rights. * A prefix to an identifier name specifying the listed rights are to be removed from users who match the prefixed identifier. As an example, for a mailbox with the following ACL: group-user-is-in rw -user w An implementation may grant the user 'r' rights. Rights is a string listing a (possibly empty) set of alphanumeric characters, each character listing a set of operations which is being controlled. Letters are reserved for ``standard'' rights, listed below. Digits are reserved for implementation or site defined rights. The standard rights are: r - read w - write a - administer (perform SETACL) An implementation may force rights to always or never be granted. [Mention that rights may not be tied, as they can be in IMAP?] Myers [Page 22] Internet DRAFT ACAP June 11, 1996 Each attribute of each entry of a dataset may potentially have an ACL. If an attribute in an entry does not have an ACL, then access is controlled by a default ACL for that attribute in the dataset, if it exists. If there is no default ACL for that attribute in the dataset, access is controlled by a default ACL for that dataset. The default ACL for a dataset must exist. In order to perform any manipulation on an entry on a dataset, the client must have 'r' rights on the "name" attribute of the entry. [OPEN ISSUE: l, i, c, and/or d rights which only apply at the dataset level? 'l' could be implemented by the 'r' right on the 'name' attribute of that dataset's entry in the dataset list.] Many of the ACL commands and responses include an ``acl object'' parameter, for specifying what the ACL applies to. This is a parenthesized list. The list contains just the dataset name when referring to the default ACL for a dataset. The list contains a dataset name and an attribute name when referring to the default ACL for an attribute in a dataset. The list contains a dataset name, an attribute name, and an entry name when referring to the ACL for an attribute of an entry of a dataset. 3.8.1. SETACL Command Arguments: acl object authentication identifier access rights Data: no specific data for this command Result: OK - setacl completed NO - setacl failure: can't set acl BAD - command unknown or arguments invalid The SETACL command changes the access control list on the specified object so that the specified identifier is granted the permissions enumerated in rights. If the object did not previously have an access control list, it does now. Myers [Page 23] Internet DRAFT ACAP June 11, 1996 3.8.2. DELETEACL Command Arguments: acl object optional authentication identifier Data: no specific data for this command Result: OK - deleteacl completed NO - deleteacl failure: can't delete acl BAD - command unknown or arguments invalid If given the optional identifier argument, the DELETEACL command removes any portion of the access control list on the specified object for the specified identifier. If not given the optional identifier argument, the DELETEACL command removes the ACL from the object entirely, causing access to be controlled by a higher-level default ACL. It is an error to use this form of the DELETEACL command on the default ACL for a dataset. 3.8.3. GETACL Command Arguments: acl object Data: untagged responses: ACL Result: OK - getacl completed NO - getacl failure: can't get acl acl does not exist BAD - command unknown or arguments invalid The GETACL command returns the access control list for the specified object in an untagged ACL reply. If the specified object does not have an ACL, the command fails, returning a NOACL special information token in the tagged NO response. Example: C: A002 GETACL ("/mailboxes") S: * ACL ("/mailboxes") anyone r S: A002 OK Getacl complete Myers [Page 24] Internet DRAFT ACAP June 11, 1996 3.8.4. LISTRIGHTS Command Arguments: acl object authentication identifier Data: untagged responses: LISTRIGHTS Result: OK - listrights completed NO - listrights failure: can't get rights list BAD - command unknown or arguments invalid The LISTRIGHTS command takes an object and an identifier and returns information about what rights may be granted to the identifier in the ACL for the object. Example: C: a001 LISTRIGHTS ("/mailboxes") smith S: * LISTRIGHTS ("/mailboxes") smith r w S: a001 OK Listrights completed C: a005 LISTRIGHTS ("/mailboxes" archive.imap) anyone S: * LISTRIGHTS ("/mailboxes" archive.imap) anyone "" r w S: a005 OK Listrights completed 3.8.5. MYRIGHTS Command Arguments: acl object Data: untagged responses: MYRIGHTS Result: OK - myrights completed NO - myrights failure: can't get rights BAD - command unknown or arguments invalid The MYRIGHTS command returns the set of rights that the user has to the given object in an untagged MYRIGHTS reply. Example: C: A003 MYRIGHTS ("/mailboxes") S: * MYRIGHTS ("/mailboxes") r S: A003 OK Myrights complete Myers [Page 25] Internet DRAFT ACAP June 11, 1996 3.8.6. ACL Response Data: acl object zero or more identifier rights pairs The ACL response occurs as a result of a GETACL command. The first list is the object for which this ACL applies. This is followed by zero or more pairs of strings, each pair contains the identifier for which the entry applies followed by the set of rights that the identifier has. 3.8.7. LISTRIGHTS Response Data: acl object identifier required rights list of optional rights The LISTRIGHTS response occurs as a result of a LISTRIGHTS command. The first two arguments are the object and identifier for which this rights list applies. Following the identifier is a string containing the (possibly empty) set of rights the identifier will always be granted in the mailbox. Following this are zero or more strings each containing a single right the identifier may be granted in the mailbox. The same right may not be listed more than once in the LISTRIGHTS command. 3.8.8. MYRIGHTS Response Data: acl object rights The MYRIGHTS response occurs as a result of a MYRIGHTS command. The first string is the object for which these rights apply. The second string is the set of rights that the client has. 3.9. Advisory locking These commands allow cooperating clients to synchronize their updates to datasets. Myers [Page 26] Internet DRAFT ACAP June 11, 1996 3.9.1. LOCK Command Arguments: dataset name optional list of entry names optional list of attribute names Data: intermediate responses: ENTRY Result: OK - lock completed NO - lock failure: can't lock dataset/entry some other client has obtained lock on dataset/entry BAD - command unknown or arguments invalid The LOCK command accepts as arguments a dataset name and an optional list of entry names. It attempts to acquire an exclusive semaphore on each of the entries in the dataset. The dataset must exist, but the named entries need not. If the optional list of entry names is not present, it attempts to acquire an exclusive semaphore on the dataset as a whole. If the command is successful, the server must ensure that no other client will be able to successfully lock either any of the named entries in the dataset or the dataset as a whole until the successful client either performs a matching UNLOCK command or closes the connection. If the optional list of entry names is not present, the server must also ensure that no other client will be able to lock any entry in the in the dataset. If some other client has obtained either the semaphore on the dataset as a whole or a semaphore on one of the named entries, the command fails, returning a LOCKED special information token in the tagged NO response. If the command is successful and the optional list of attributes is present, the server returns the values of those attributes of those entries in intermediate ENTRY responses. The server should ensure that the client has permission to perform a STORE operation on at least one attribute of each of the entries. [OPEN ISSUE: what is necessary in order to LOCK the entire dataset--at least one entry or all entries?] Even though other clients may not perform a LOCK operation on an entry, servers should not prevent them from performing STORE Myers [Page 27] Internet DRAFT ACAP June 11, 1996 operations on the entry. Example: C: A069 LOCK "/addressbook/fred" (barney) (addressbook.email) S: A069 ENTRY barney addressbook.email "barney@bedrock" S: A069 OK Lock completed C: A070 LOCK "/addressbook/shared" ("Bam Bam") S: A070 NO [LOCKED] Locked by Barney on client7.do.main 3.9.2. UNLOCK Command Arguments: dataset book name optional list of entry names Data: no specific data for this command Result: OK - unlock completed NO - unlock failure: can't unlock that dataset/entry BAD - command unknown or arguments invalid The UNLOCK command accepts as an arguments a dataset name and an optional list of entry names. If the list of entry names is present, it releases any semaphores the client may have previously obtained on those entries by using the LOCK command. If the list of entry names is not present, it removes any semaphore the client may have on the dataset as a whole or on any entry in the dataset. Myers [Page 28] Internet DRAFT ACAP June 11, 1996 3.x. Server Responses - Status Responses [TODO - put this somewhere reasonable] Status responses may include an optional response code. A response code consists of data inside square brackets in the form of an atom, possibly followed by a space and arguments. The response code contains additional information or status codes for client software beyond the OK/NO/BAD condition, and are defined when there is a specific action that a client can take based upon the additional information. The currently defined response codes are: ALERT The human-readable text contains a special alert that MUST be presented to the user in a fashion that calls the user's attention to the message. LOCKED The option or address book entry is already locked by another client. TOOMANY TODO NEWCONTEXT TODO TOOMANYCONTEXTSTODO NOACL TODO Additional response codes defined by particular client or server implementations should be prefixed with an "X" until they are added to a revision of this protocol. Client implementations should ignore response codes that they do not recognize. 3.x Server Responses - Command Continuation Request [TODO - put this somewhere reasonable] The command completion request response is indicated by a "+" token instead of a tag. This form of response indicates that the server is ready to accept the continuation of a command from the client. The remainder of this response is a line of text. This response is used in the AUTHENTICATE command to transmit server data to the client, and request additional client data. This response is also used if an argument to any command is a literal. Myers [Page 29] Internet DRAFT ACAP June 11, 1996 The client is not permitted to send the octets of a synchronizing literal unless the server indicates that it expects it. This permits the server to process commands and reject errors on a line-by-line basis. The remainder of the command, including the CRLF that terminates a command, follows the octets of the literal. If there are any additional command arguments the literal octets are followed by a space and those arguments. [TODO - modify above to describe server processing of non- synchronizing literals] Example: C: A001 LOGIN {11} S: + Ready for additional command text C: FRED FOOBAR {7} S: + Ready for additional command text C: fat man S: A001 OK LOGIN completed C: A044 BLURDYBLOOP {102856} S: A044 BAD No such command as "BLURDYBLOOP" Myers [Page 30] Internet DRAFT ACAP June 11, 1996 4. Predefined Dataset Types Dataset lists name "/foo/bar/baz" serverlist "acap3.andrew.cmu.edu" subscription "show" ; more limited than for mailbox lists Mailbox lists name "INBOX.sent-mail" serverlist "imap2.andrew.cmu.edu imap7.andrew.cmu.edu" subscription "show" ; possible values: ; read - present new messages by default ; show - display in mailbox list ; todo - present all messages by default ; OPEN ISSUE: some other scheme? disconnected-mode "cm" ; Disconnected caching mode ; set of flags. mailbox.creation-time "19951206103412" mailbox.uidvalidity "807558230" mailbox.marked "y" ; non-empty if Marked mailbox.noselect "" ; non-empty if Noselect mailbox.noinferiors "" ; non-empty if Noinferiors mailbox.acl "" ; Access control list ; OPEN ISSUE: how to modify. Use IMAP4? mailbox.separator "." ; Hierarchy separator char. Options name "common.from" ; Need hierarchical registry of names option.value "John Gardiner Myers " Addressbooks name addressbook.commonname addressbook.alias ; should probably not be defined ??? addressbook.email ; may suffix .work, .home, .mobile addressbook.phone ; Voice phone # ; may suffix .work, .home, .car, .mobile addressbook.fax ; Fax phone # ; may suffix .work, .home, .car, .mobile addressbook.pager ; Pager phone # ; may suffix .work, .home ??? Myers [Page 31] Internet DRAFT ACAP June 11, 1996 addressbook.address ; Physical address ; may suffix .work, .home addressbook.members addressbook.expand ; Magic, expansion of email/members Media types name ; Name of media type mediatype.mime ; MIME media type mediatype.mac-code ; Macintosh type/creator code mediatype.extension ; List of common filename extensions mediatype.magic-number ; Magic number Bookmarks name url 5. Dataset Shadowing It is possible for a dataset to ``shadow'' another. Data in the shadowed dataset appears in the shadowing dataset, except where explicitly overridden by data in the shadowing dataset. The shadowed dataset specifies which values may be overridden in shadowing datasets. [OPEN ISSUE: how does it specify?] The shadowed dataset is usually a system-wide set of defaults. The system-wide dataset usually has one shadowing dataset per user, allowing each user to add to or modify the defaults as appropriate. [TODO: What else to say? Which datasets shadow other datasets is mostly implementation-defined.] 9. Formal Syntax The following syntax specification uses the augmented Backus-Naur Form (BNF) notation as specified in [RFC-822] with one exception; the delimiter used with the "#" construct is a single space (SPACE) and not one or more commas. Except as noted otherwise, all alphabetic characters are case-insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion. Myers [Page 32] Internet DRAFT ACAP June 11, 1996 alpha ::= "A" / "B" / "C" / "D" / "E" / "F" / "G" / "H" / "I" / "J" / "K" / "L" / "M" / "N" / "O" / "P" / "Q" / "R" / "S" / "T" / "U" / "V" / "W" / "X" / "Y" / "Z" / "a" / "b" / "c" / "d" / "e" / "f" / "g" / "h" / "i" / "j" / "k" / "l" / "m" / "n" / "o" / "p" / "q" / "r" / "s" / "t" / "u" / "v" / "w" / "x" / "y" / "z" / ;; Case-sensitive astring ::= atom / string atom ::= 1*ATOM_CHAR ATOM_CHAR ::= atom_specials ::= "(" / ")" / "{" / SPACE / CTLs / list_wildcards / quoted_specials authenticate ::= "AUTHENTICATE" SPACE auth_type *(CRLF base64) auth_type ::= atom base64 ::= *(4base64_char) [base64_terminal] base64_char ::= alpha / digit / "+" / "/" base64_terminal ::= (2base64_char "==") / (3base64_char "=") CHAR ::= CHAR8 ::= command ::= tag SPACE (command_any / command_auth / command_nonauth) CRLF ;; Modal based on state continue_req ::= "+" SPACE (resp_text / base64) CR ::= CRLF ::= CR LF CTL ::= digit ::= "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" LF ::= Myers [Page 33] Internet DRAFT ACAP June 11, 1996 literal ::= "{" number [ "+" ] "}" CRLF *CHAR8 ;; The number represents the number of CHAR8 octets number ::= 1*DIGIT quoted ::= <"> *QUOTED_CHAR <"> QUOTED_CHAR ::= / "\" quoted_specials quoted_specials ::= <"> / "\" response ::= * response_done response_data ::= "*" SPACE (resp_cond_state / resp_cond_bye / mailbox_data / option_data / searchaddress_d / fetchaddress_d / address_data / acl_data / myrights_data) CRLF response_done ::= response_tagged / response_fatal response_fatal ::= "*" SPACE resp_cond_bye CRLF response_tagged ::= tag SPACE resp_cond_state CRLF resp_cond_bye ::= "BYE" SPACE resp_text ;; Server will disconnect condition resp_cond_state ::= ("OK" / "NO" / "BAD") SPACE resp_text ;; Status condition resp_text ::= ["[" resp_text_code "]" SPACE] (text_mime2 / text) resp_text_code ::= "ALERT" / "LOCKED" / atom [SPACE 1*] SPACE ::= specials ::= "(" / ")" / "{" / qspecials string ::= quoted / literal tag ::= 1* text ::= 1*TEXT_CHAR text_mime2 ::= "=?" "?" "?" "?=" ;; Syntax defined in [MIME-2] Myers [Page 34] Internet DRAFT ACAP June 11, 1996 TEXT_CHAR ::= x_command ::= "X" atom initial_greeting ::= "*" SPACE "OK" *(SPACE capability) CRLF capability ::= atom [ "(" astring ")" ] command ::+ "LOGIN" SPACE astring SPACE astring command ::+ "AUTHENTICATE" SPACE atom *(CRLF base64-token) command ::+ "NOOP" command ::+ "CHARSET" SPACE astring ; [OPEN ISSUE: alternative is to just use UTF8] dataset ::= astring ;; slash-separated dataset name ;; affected by selected charset ;; begins with slash attribute ::= astring ;; dot-separated attribute name ;; affected by selected charset ;; ends in ".bin" if not textual value ::= astring command ::+ "SEARCH" SPACE (dataset / context) *(SPACE search_modifier) SPACE search_criteria search_modifier ::+ "SORT" SPACE "(" 1#(attribute SPACE ordering) ")" ordering ::= ("+" / "-") atom ; need registry of atom orderings ; predefined: octet, en-case-insensitive ; numeric-decimal ; ignore-case-diacritical-marks (define?) search_modifier ::+ "RETURN" SPACE "(" #attribute ")" search_modifier ::+ "LIMIT" SPACE number search_modifier ::+ "MAKECONTEXT" SPACE atom Myers [Page 35] Internet DRAFT ACAP June 11, 1996 search_criteria ::= 1#search_key search_key ::+ "(" search_criteria ")" / "NOT" SPACE search_key / "OR" SPACE search_key SPACE search_key search_key ::+ "GLOB" SPACE attribute SPACE pattern search_key ::+ "EQUAL" SPACE attribute SPACE ordering SPACE astring search_key ::+ "COMPARE" SPACE attribute SPACE ordering SPACE astring search_key ::+ "RANGE" SPACE nz_number SPACE nz_number search_key ::+ "GLOBREFERENCE" SPACE reference SPACE pattern ; Magic, for mailbox datasets, behaves like ; IMAP4's LIST command. search_response ::= tag SPACE "ENTRY" SPACE entry_name SPACE *(SPACE attribute SPACE value) [SPACE "..."] "[TOOMANY" SPACE number "]" "[NEWCONTEXT" SPACE number "]" "[TOOMANYCONTEXTS]" context ::= astring ; Must not start with "/", to distinguish from ; dataset command ::+ "FREECONTEXT" SPACE context command ::+ "NOTIFYCONTEXT" SPACE context *(SPACE attribute) untagged_response ::+ "*" SPACE "ADDTO" SPACE context SPACE entry_name SPACE number *(SPACE attribute SPACE value) untagged_response ::+ "*" SPACE "REMOVEFROM SPACE context SPACE entry_name SPACE number untagged_response ::+ "*" SPACE "CHANGE" SPACE context SPACE entry_name SPACE number SPACE number *(SPACE attribute SPACE value) command ::+ "STORE" SPACE dataset SPACE entry_name 1*(SPACE attribute SPACE value) command ::+ "DELETE" SPACE dataset SPACE entry_name Myers [Page 36] Internet DRAFT ACAP June 11, 1996 command ::+ "DELETEDSINCE" SPACE dataset SPACE time ; returns DELETEDFROM untagged response, or fails untagged_response ::+ "*" SPACE "DELETEDFROM" SPACE dataset SPACE entry_name command ::+ "SETACL" SPACE acl_object SPACE identifier SPACE rights command ::+ "DELETEACL" SPACE acl_object SPACE identifier command ::+ "GETACL" SPACE acl_object untagged_response ::+ "ACL" SPACE acl_object *(SPACE identifier SPACE rights) command ::+ "MYRIGHTS" SPACE acl_object untagged_response ::+ "MYRIGHTS" SPACE acl_object SPACE rights acl_object ::= "(" dataset [ SPACE attribute [ SPACE entry_name ] ] ")" identifier ::= astring rights ::= astring ; "r" - read, "w" - write "[NOACL]" command ::+ "LOCK" SPACE dataset [ SPACE "(" 1#entry_name ")" [ SPACE "(" 1#attribute ")" ] ] command ::+ "UNLOCK" SPACE dataset [ SPACE "(" 1#entry_name ") ] "[LOCKED]" A protocol session is as follows: Server: greeting * Server: response > Myers [Page 38] Internet DRAFT ACAP June 11, 1996 10. Security Considerations ACAP protocol transactions, including address book and option data, are sent in the clear over the network unless the optional privacy protection is negotiated in the AUTHENTICATE command. Use of the LOGIN command sends passwords in the clear. This can be avoided by using the AUTHENTICATE command instead. Additional security considerations are discussed in the section discussing the AUTHENTICATE and LOGIN commands. 11. Author's Address John G. Myers Carnegie-Mellon University 5000 Forbes Ave. Pittsburgh PA, 15213-3890 Email: jgm+@cmu.edu Myers [Page 39] Internet DRAFT ACAP June 11, 1996 Appendices A. References [IMAP4] Crispin, Mark R., "Internet Message Access Protocol - Version 4", RFC 1730. [IMAP-AUTH] Myers, J., "IMAP4 Authentication Mechanisms", RFC 1731 [MIME-2] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text", RFC 1522. [RFC-822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822. Myers [Page 40] Internet DRAFT ACAP June 11, 1996 B. ACAP Keyword Index (command) ................................................. 23 (command) ................................................. 23 (command) ................................................. 24 (command) ................................................. 24 (command) ................................................. 25 (response) ................................................ 25 (response) ................................................ 26 (response) ................................................ 26 ACAP (response) ............................................ 8 ADDTO (response) ........................................... 18 ALERT (response code) ...................................... 29 AUTHENTICATE (command) ..................................... 12 BAD (response) ............................................. 10 BYE (response) ............................................. 11 CHANGE (response) .......................................... 19 DELETE (command) ........................................... 20 DELETEDFROM (response) ..................................... 21 DELETEDSINCE (command) ..................................... 20 ENTRY (response) ........................................... 16 FREECONTEXT (command) ...................................... 17 LOCK (command) ............................................. 27 LOGIN (command) ............................................ 13 LOGOUT (command) ........................................... 9 NO (response) .............................................. 10 NOOP (command) ............................................. 9 NOTIFYCONTEXT (command) .................................... 18 OK (response) .............................................. 9 REMOVEFROM (response) ...................................... 19 SEARCH (command) ........................................... 14 STORE (command) ............................................ 20 UNLOCK (command) ........................................... 28 Myers [Page 41] Internet DRAFT ACAP June 11, 1996 Table of Contents Status of this Memo ............................................... i Abstract .......................................................... i ACAP Protocol Specification ....................................... 1 1. Conventions Used in this Document ......................... 1 2. Protocol Overview ......................................... 1 2.1. Link Level ................................................ 1 2.2. Commands and Responses .................................... 1 2.2.1. Client Protocol Sender and Server Protocol Receiver ....... 2 2.2.2. Server Protocol Sender and Client Protocol Receiver ....... 2 2.3. State and Flow Diagram .................................... 3 2.3.1. Non-Authenticated State ................................... 3 2.3.2. Authenticated State ....................................... 4 2.3.3. Logout State .............................................. 4 2.4. Data Formats .............................................. 4 2.4.1. Atom ...................................................... 4 2.4.2. Number .................................................... 5 2.4.3. String .................................................... 5 2.4.3.1. 8-bit and Binary Strings .......................... 5 2.5. Operational Considerations ................................ 5 2.5.1. Untagged Status Updates ................................... 6 2.5.2. Response when no Command in Progress ...................... 6 2.5.3. Autologout Timer .......................................... 6 2.5.4. Multiple Commands in Progress ............................. 6 2.6. Datasets .................................................. 6 2.6. Predefined Attributes ..................................... 7 3. Protocol Specification ....................................... 8 3.1. Initial Connection ........................................... 8 3.1.1. ACAP Response ............................................. 8 3.2. Any State ............................................. 9 3.2.1. NOOP Command .............................................. 9 3.2.2. LOGOUT Command ............................................ 9 3.2.3. OK Response ............................................... 9 3.2.4. NO Response ............................................... 10 3.2.5. BAD Response .............................................. 10 3.2.6. BYE Response .............................................. 11 3.3. Non-Authenticated State ............................... 11 3.3.1. AUTHENTICATE Command ...................................... 12 3.3.2. LOGIN Command ............................................. 13 3.4. Searching ................................................. 13 3.4.1. SEARCH Command ............................................ 14 3.4.2. ENTRY Response ............................................ 16 Myers [Page iii] Internet DRAFT ACAP June 11, 1996 3.5. Contexts .................................................. 17 3.5.1. FREECONTEXT Command ....................................... 17 3.5.2. NOTIFYCONTEXT Command ..................................... 18 3.5.3. ADDTO Response ............................................ 18 3.5.4. REMOVEFROM Response ....................................... 19 3.5.5. CHANGE Response ........................................... 19 3.6. Dataset modification ...................................... 19 3.6.1. STORE Command ............................................. 20 3.6.2. DELETE Command ............................................ 20 3.6.3. DELETEDSINCE Command ...................................... 20 3.6.4. DELETEDFROM Response ...................................... 21 3.7. Dataset management ........................................ 21 3.8. Access Control Lists ...................................... 21 3.8.1. SETACL Command .......................................... 23 3.8.2. DELETEACL Command .................................. 23 3.8.3. GETACL Command .......................................... 24 3.8.4. LISTRIGHTS Command .................................. 24 3.8.5. MYRIGHTS Command .......................................... 25 3.8.6. ACL Response ......................................... 25 3.8.7. LISTRIGHTS Response ................................. 26 3.8.8. MYRIGHTS Response ......................................... 26 3.9. Advisory locking .......................................... 26 3.9.1. LOCK Command .............................................. 27 3.9.2. UNLOCK Command ............................................ 28 3.x. Server Responses - Status Responses ....................... 29 3.x Server Responses - Command Continuation Request ........... 29 4. Predefined Dataset Types .................................. 31 5. Dataset Shadowing ......................................... 32 9. Formal Syntax ............................................. 32 10. Security Considerations ................................... 39 11. Author's Address .......................................... 39 Appendices ........................................................ 40 A. References ................................................ 40 B. ACAP Keyword Index ........................................ 41 Myers [Page iv]