HTTP/1.1 200 OK Date: Tue, 09 Apr 2002 00:43:56 GMT Server: Apache/1.3.20 (Unix) Last-Modified: Fri, 28 Mar 1997 12:03:00 GMT ETag: "2e9c94-1df4d-333bb374" Accept-Ranges: bytes Content-Length: 122701 Connection: close Content-Type: text/plain Network Working Group C. Newman Internet Draft: ACAP Innosoft Document: draft-ietf-acap-spec-03.txt J. G. Myers Expire in six months March 1997 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. Newman [Page i] Internet DRAFT ACAP March 26, 1997 Table of Contents Status of this Memo ............................................... i Abstract .......................................................... i ACAP Protocol Specification ....................................... 1 0. Changes from version -01 to version -02 .................. 1 0.1. Changes from draft -02 to draft -03 ...................... 2 0.2. Open Issues .............................................. 4 1. Conventions Used in this Document ........................ 4 2. Protocol Overview ........................................ 5 2.1. Link Level ............................................... 5 2.2. Commands and Responses ................................... 5 2.2.1. Client Protocol Sender and Server Protocol Receiver ...... 5 2.2.2. Server Protocol Sender and Client Protocol Receiver ...... 6 2.3. State and Flow Diagram ................................... 7 2.3.1. Non-Authenticated State .................................. 7 2.3.2. Authenticated State ...................................... 7 2.3.3. Logout State ............................................. 7 2.4. Operational Considerations ............................... 8 2.4.1. Untagged Status Updates .................................. 8 2.4.2. Response when No Command in Progress ..................... 8 2.4.3. Autologout Timer ......................................... 8 2.4.4. Multiple Commands in Progress ............................ 9 2.5. Datasets and Entries ..................................... 9 2.6. Predefined Attributes .................................... 9 2.7. Attribute metadata ....................................... 10 2.8. Operational Command Overview ............................. 11 3. Protocol Elements ........................................ 11 3.1. Data Formats ............................................. 12 3.1.1. Atom ..................................................... 12 3.1.2. Number ................................................... 12 3.1.3. String ................................................... 12 3.1.3.1. 8-bit and Binary Strings ................................. 13 3.1.4. Parenthesized List ....................................... 13 3.1.5 NIL ...................................................... 13 3.2. ACAP URL scheme .......................................... 13 3.2.1. ACAP URL User Name and Authentication Mechanism .......... 14 3.2.2. Relative ACAP URLs ....................................... 15 3.3. Contexts ................................................. 15 3.4. Orderings ................................................ 15 3.5. Server Status Responses .................................. 16 3.6. Server Command Continuation Request ...................... 17 4. Protocol Specification ................................... 19 Newman [Page iii] Internet DRAFT ACAP March 26, 1997 4.1. Initial Connection ....................................... 19 4.1.1. ACAP Untagged Response ................................... 19 4.2. Any State ................................................ 20 4.2.1. NOOP Command ............................................. 20 4.2.2. LOGOUT Command ........................................... 21 4.2.3. OK Response .............................................. 21 4.2.4. NO Response .............................................. 21 4.2.5. BAD Response ............................................. 22 4.2.6. BYE Untagged Response .................................... 22 4.3. Non-Authenticated State .................................. 23 4.3.1. AUTHENTICATE Command ..................................... 23 4.4. Searching ................................................ 25 4.4.1. SEARCH Command ........................................... 25 4.4.2. ENTRY Intermediate Response .............................. 29 4.4.3. MODTIME Intermediate Response ............................ 29 4.4.4. REFER Intermediate Response .............................. 29 4.5. Contexts ................................................. 30 4.5.1. FREECONTEXT Command ...................................... 30 4.5.2. UPDATECONTEXT Command .................................... 30 4.5.3. ADDTO Untagged Response .................................. 31 4.5.4. REMOVEFROM Untagged Response ............................. 31 4.5.5. CHANGE Untagged Response ................................. 32 4.5.6. MODTIME Untagged Response ................................ 32 4.6. Dataset modification ..................................... 32 4.6.1. STORE Command ............................................ 33 4.6.2. DELETEDSINCE Command ..................................... 34 4.6.3. DELETED Intermediate Response ............................ 34 4.7. Access Control Lists ..................................... 34 4.7.1. SETACL Command ........................................... 36 4.7.2. DELETEACL Command ........................................ 37 4.7.3. MYRIGHTS Command ......................................... 37 4.7.4. MYRIGHTS Intermediate Response ........................... 38 4.7.5. LISTRIGHTS Command ....................................... 38 4.7.6. LISTRIGHTS Intermediate Response ......................... 38 4.8. Quotas ................................................... 39 4.8.1. SETQUOTA Command ......................................... 39 4.8.2. GETQUOTA Command ......................................... 40 4.8.3. QUOTA Intermediate Response .............................. 40 4.9. Extensions ............................................... 40 5. Dataset Management ....................................... 41 5.1. Dataset Inheritance ...................................... 41 5.2. Dataset attributes ....................................... 41 6. Namespace conventions .................................... 42 6.1. Dataset Namespace ........................................ 42 6.2. Attribute Namespace ...................................... 42 7. Registration procedures .................................. 42 7.1. Ordering Functions ....................................... 43 7.2. ACAP Capabilities ........................................ 43 Newman [Page iv] Internet DRAFT ACAP March 26, 1997 7.3. Dataset Classes .......................................... 44 7.4. Private Attribute Subtree ................................ 44 8. Formal Syntax ............................................ 45 9. Security Considerations .................................. 53 10. Authors' Addresses ....................................... 53 Appendices ........................................................ 54 A. References ............................................... 54 B. ACAP Keyword Index ....................................... 55 Newman [Page v] Internet DRAFT ACAP March 26, 1997 ACAP Protocol Specification 0. Changes from version -01 to version -02 1) Added reference to definitions of MUST, SHOULD, etc. 2) Removed last mention of "NIL". 3) Renamed "name" to "entry". 4) Datasets are ordered in a server-determined manner. 5) "acl" metadata is read-only. 6) return error on fetch of undefined metadata. 7) Added "subdataset" attribute and discussion of dataset hierarchy. 8) Changed "request response" to "request", and "result response" to "result" to simplify the text. 9) Removed "Child Dataset Attributes" and added "Operational Command Overview" 10) Restructured document a bit, adding a "protocol elements" section 11) Added "*" rule to the RETURN search modifier. 12) Added the DEPTH search modifier. 13) Added predefined orderings. 14) Added ACAP URL scheme 15) Removed NOTIFYCONTEXT command, added NOTIFYCONTEXT search modifier. 16) DELETEDFROM -> intermediate DELETED response 17) Added second argument to LIMIT search modifier. 18) Added "[" and "]" to atom_specials to deal with special information tokens cleanly; removed "*" and "%" 19) made resp_text into quoted string to simplify parsing. Newman [Page 1] Internet DRAFT ACAP March 26, 1997 20) Added SASL list to Capability greeting. 21) Removed ACL, LISTRIGHTS, GETACL, NOACL in favor of dataset management attributes 22) Added AND to SEARCH keys and removed parentheses around SEARCH keys. 23) simplified MYRIGHTS command and result 24) Simplified STORE and DELETE using entry-path 25) Remove locking of entire dataset. Add MODTIME intermediate result to LOCK command. 26) Added GETQUOTA and SETQUOTA. 27) Astring is removed from the grammar, except for LOGIN. 28) Changed term "shadow" to "inherit" 29) Added dataset management section 30) Added sort-hint 31) Added QUOTA and PERMISSION response codes 32) Added registration procedures 33) Added dataset namespace conventions 34) TOOMANYCONTEXTS -> TRYFREECONTEXT 0.1. Changes from draft -02 to draft -03 1) Removed sort-hint, LOGIN, createtime, DELETE, LOCK, UNLOCK. DUMB SASL mechanism will be defined in a separate document. 2) Put NIL back in. 3) Changed STORE command to allow NIL, include conditional store, and store multiple entries atomically. 4) Fleshed out "extensions" section a bit. 5) Used parenthesis instead of brackets for special information tokens. Simplifies parsing. Took "[" and "]" back out of atom specials. Newman [Page 2] Internet DRAFT ACAP March 26, 1997 6) *Changed quoted string to allow UTF-8 characters. 7) kilobytes -> octets 8) Added "time" field to the RANGE search modifier to remove ambiguity problems with unsolicited notifications. 9) Clarified that a BAD completion result must be returned for a number of cases (bad metadata, invalid search modifier combinations, etc). 10) Updated example in ACAP URL section and added rest of description for the element. 11) Clarified octet collation. 12) Clarified REFER response code. Added REFER intermediate response to SEARCH. 13) Clarified DEPTH search modifier. 14) Forbid use of "*" in attribute name. Forbid entry name from beginning with ".". 15) Finished changing "NOTIFYCONTEXT command" to "NOTIFYCONTEXT search modifier". 16) Changed ACL identifier to permit UTF-8. 17) Added reference to US-ASCII. 18) private. -> vnd. and prs. 19) permit multiple arguments to a capability. 20) Put back LISTRIGHTS command and response. 21) Added "ALL" search key, "HARDLIMIT" search modifier and "WAYTOOMANY" response code. 22) Allow STORE with no attributes added; SHOULD/MUST rules as appropriate. 23) Clarify inheritance rules with respect to modtime attribute and ACL attributes. 24) Added rule about UPDATECONTEXT returning MODTIME if changes. Newman [Page 3] Internet DRAFT ACAP March 26, 1997 25) Clarify that ADDTO/REMOVEFROM/CHANGE renumber other entries in the context. 26) Added editorial clarity note to section 1. 27) Require MODTIME response to successful SEARCH. 28) Allow size to be 0 in value. 0.2. Open Issues 1) Document structure: do you like it? 2) Need to define precise Unicode-based ordering function, if one exists that isn't a nightmare to implement. If it is a nightmare to implement, we can make it a SHOULD rather than a MUST. 3) Consider making ACL model more precise. Would like to pick AFS semantics over POSIX semantics since AFS semantics are more intuitive. Need to confer with security area director. Currently both ACL semantics are permitted. 4) Current namespace conventions make certion useful operations difficult. Other simple conventions appear worse. Need a way to permit both "list all shared addressbooks" and "list all datasets owned by this user". Ideas include multiple namespaces (e.g., "/addressbooks/user/chris" and "/user/chris/addressbook" are the same), out of band dataset class typing, and permitting "*" wild card in place of a dataset path element. 5) Some people have indicated a desire for multi-valued attributes. 6) Do we need some sort of a "touch" operation? 7) Need to think more about the "subdataset" attribute and inheritance. 8) Need to think more about the "o" ACL right and inheritance. 9) Need more examples. 1. Conventions Used in this Document In examples, "C:" and "S:" indicate lines sent by the client and server respectively. If such lines are wrapped without a new "C:" or "S:" label, then the wrapping is for editorial clarity and is not part of the command. Newman [Page 4] Internet DRAFT ACAP March 26, 1997 The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" in this document are to be interpreted as described in RFC xxxx. The protocol syntax specification uses the Augmented Backus-Naur Form (ABNF) notation as specified in [IMAIL] with one exception; the delimiter used with the "#" construct is a single space (SPACE) and not one or more commas. 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 674. 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. 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. Both clients and servers must be capable of handling lines of arbitrary length. 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 section
); 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 if it is ready for the next part of the command. This response is prefixed with the token "+". Note: If, instead, the server detected an error in the Newman [Page 5] Internet DRAFT ACAP March 26, 1997 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 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. 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 continuation request is prefixed with the token "+". A command completion result 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 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 Newman [Page 6] Internet DRAFT ACAP March 26, 1997 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 server is in an inappropriate state for that command. In this case, a server will respond with a BAD 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. 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. Newman [Page 7] Internet DRAFT ACAP March 26, 1997 +--------------------------------------+ |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 AUTHENTICATE command (4) LOGOUT command, server shutdown, or connection closed 2.4. Operational Considerations 2.4.1. Untagged Status Updates At any time, a server can send data that the client did not request. 2.4.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.4.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 MUST suffice to reset the autologout timer. Newman [Page 8] Internet DRAFT ACAP March 26, 1997 2.4.4. Multiple Commands in Progress The client is not required to wait for the completion result 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.5. Datasets and Entries 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 preceded by a slash ("/") and containing one or more UTF-8 characters (other than slash). Each entry in a dataset is a set of attribute/value pairs. Each attribute is a hierarchical name in UTF-8, with each component of the name being separated with a period ("."). Each attribute/value pair may have additional metadata; this is described in section
. There must be exactly one "entry" attribute, whose value is unique amongst all entries in the dataset and contains zero or more UTF-8 characters other than slash ("/") or dot ("."). Entries in a dataset are ordered in a server-determined manner. The value of an attribute 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. Values of other attributes are textual and are restricted to non-zero UTF-8 characters. Attribute names are not permitted to contain "*", and entry names are not permitted to begin with ".". Servers MUST return a BAD completion result to clients which violate this. 2.6. Predefined Attributes Attribute names which do not contain a dot (".") are reserved for standardized attributes which have meaning in any dataset. The following attributes are defined by the ACAP protocol. entry Contains the name of the entry. modtime Contains the date and time, in UTC, any value or acl in the Newman [Page 9] Internet DRAFT ACAP March 26, 1997 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 fractions of a second. The time, particularly fractions of a second, need not be accurate. It is required, however, that any two entries in a dataset changed by successive modifications have strictly ascending modtime values. subdataset If this attribute is set, it indicates the existence of a sub-dataset of this entry. The value consists of a list of CRLF separated relative ACAP URLs (see section
for ACAP URL specification) which may be used to locate where the sub-dataset is actually stored. The base URL for the subdataset attribute is formed by appending the entry name followed by a "/" to the end of the parent dataset name. For example, if the dataset "/mailboxes/common" has an entry "public-folder" with a subdataset attribute of ".", then there exists a dataset "/mailboxes/common/public-folder". If the value of the subdataset attribute was instead "//other.acap.domain//mailboxes/common/public-folder" that would indicate the dataset is actually located on a different ACAP server. A dataset is created by storing a "subdataset" attribute including ".", and a sub-hierarchy of datasets is deleted by clearing the value of the "subdataset" attribute on the entry in the upper dataset. 2.7. Attribute metadata Each attribute/value pair may have additional metadata associated with it. For completeness, the attribute and value themselves are defined as metadata. The defined items of metadata associated with Newman [Page 10] Internet DRAFT ACAP March 26, 1997 an attribute/value pair are: attribute The attribute name. Read-only. value The value. value A substring of the value. ORIGIN is specified as a non- negative decimal number indicating the octet position of the first desired octet. An ORIGIN of 0 specifies the first octet of the value. SIZE is specified as a positive, decimal number, specifying the maximum number of octets desired. A SIZE of 0 fetches all octets after the ORiGIN. Read-only. size The length of the value, in octets. Read-only. acl The access control list for the attribute/value pair, if one exists. If the attribute/value pair does not have an ACL, NIL is returned. Read-write. See section
for the contents of an ACL. myrights The set of rights that the client has to the attribute/value pair. Read-only. See section
for the possible rights. Additional items of metadata may be defined in extensions to this protocol. Servers must respond to queries of unrecognized metadata by returning a BAD command completion result. 2.8. Operational Command Overview The AUTHENTICATE, NOOP, and LOGOUT commands provide basic protocol services. The SEARCH command is used to select, sort, fetch and monitor changes to attribute values and metadata. The UPDATECONTEXT and FREECONTEXT commands are also used to assist in monitoring changes in attribute values and metadata. The STORE command is used to add, modify and delete entries and attributes. The DELETEDSINCE command is used to assist a client in resynchronizing a cache with the server. The SETQUOTA, GETQUOTA, SETACL, DELETEACL and MYRIGHTS commands are used to examine or modifty quota usages and access permissions. 3. Protocol Elements This section defines data formats and other protocol elements used throughout the ACAP protocol. Newman [Page 11] Internet DRAFT ACAP March 26, 1997 3.1. Data Formats ACAP uses textual commands and responses. Data in ACAP can be in one of four forms: atom, number, string, parenthesized list, or NIL. 3.1.1. Atom An atom consists of one to 1024 non-special characters. 3.1.2. Number A number consists of one or more digit characters, and represents a numeric value. 3.1.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. There are two forms of literals transmitted from client to server. The form where the open brace ("{") and number of octets is immediately followed by a close brace ("}") and CRLF is called a synchronizing literal. When sending a synchronizing literal, 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). The other form of literal, the non- synchronizing literal, is used to transmit a string from client to server without waiting for a command continuation request. The non- synchronizing literal differs from the synchronizing literal by having a plus ("+") between the number of octets and the close brace ("}") and by having the octet data immediately following the CRLF. A quoted string is a sequence of zero to 1024 octets excluding CR, LF, double quote (<">), or backslash ("\") with double quote (<">) characters at each end. The empty string is respresented as "" (a quoted string with zero Newman [Page 12] Internet DRAFT ACAP March 26, 1997 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 synchronizing literal must wait to receive a command continuation request. 3.1.3.1. 8-bit and Binary Strings ACAP implementations MAY transmit 8-bit octets in literals. Except in the values of attributes whose names end with ".bin", these octets are interpreted as UTF-8 character sequences [UTF-8]. NUL octets are only permitted in the values of attributes whose names end with ".bin". Servers SHOULD verify that any non-binary string sent by the client has valid UTF-8 syntax before storing it. 3.1.4. Parenthesized List Data structures are represented as a "parenthesized list"; a sequence of data items, delimited by space, and bounded at each end by parentheses. A parenthesized list can contain other parenthesized lists, using multiple levels of parentheses to indicate nesting. The empty list is represented as () -- a parenthesized list with no members. 3.1.5 NIL The special atom "NIL" represents the non-existence of a particular data item that is represented as a string or parenthesized list, as distinct from the empty string "" or the empty parenthesized list (). 3.2. ACAP URL scheme ACAP URLs are used within the ACAP protocol for the "subdataset" attribute, referrals and inheritance. They provide a convenient syntax for referring to other ACAP datasets. The ACAP URL follows the common Internet scheme syntax as defined in [BASIC-URL]. If : is omitted, the port defaults to 674. An ACAP URL has the following general form: url-acap ::= "acap://" url-server "/" url-enc-entry [url-filter] Newman [Page 13] Internet DRAFT ACAP March 26, 1997 The element (defined below) includes the hostname, and optional user name, authentication mechanism and port number. The element contains the name of an entry path encoded according to the rules in [BASIC-URL]. The element is made up of up to three components. The first is a which specifies a list of interesting attributes. The second is which specifies the DEPTH of the search. The final element is which is an encoded version of search-criteria. The default values for these fields are "*", "DEPTH=1", and "ALL" respectively. Note that unsafe or reserved characters such as " " or "?" must be encoded according to the rules defined in [BASIC-URL]. Note that octets encoded in the %A0 format with the high bit set are interpreted according to UTF-8 [UTF8]. 3.2.1. ACAP URL User Name and Authentication Mechanism A user name and/or authentication mechanism may be supplied. They are used in the "AUTHENTICATE" command after making the connection to the ACAP server. If no user name or authentication mechanism is supplied, then the user name "anonymous" is used with the SASL XXX mechanism and the password is supplied as the Internet e-mail address of the end user accessing the resource. If the URL supplies just a user name, the program interpreting the ACAP URL SHOULD request a password from the user if necessary. An authentication mechanism can be expressed by adding ";AUTH=" to the end of the user name. When such an is indicated, the client SHOULD request appropriate credentials from that mechanism and use the "AUTHENTICATE" command. If no user name is specified, one SHOULD be obtained from the mechanism or requested from the user as appropriate. The string ";AUTH=*" indicates that the client SHOULD select an appropriate authentication mechanism. It MAY use any mechanism listed in the initial ACAP response. If no user name is specified and no appropriate authentication mechanisms are available, the client SHOULD fall back to anonymous login as described above. This allows a URL which grants read-write access to authorized users, and read-only anonymous access to other users. Note that if unsafe or reserved characters such as " " or ";" are present in the user name or authentication mechanism, they MUST be encoded as described in BASE-URL [BASE-URL]. Newman [Page 14] Internet DRAFT ACAP March 26, 1997 3.2.2. Relative ACAP URLs Because ACAP uses "/" as the hierarchy separator for dataset paths, it works well with the relative URL rules defined in REL-URL [REL- URL]. The grammar element is considered part of the user name for purposes of resolving relative ACAP URLs. The base URL for a relative URL stored in an attribute's value is formed by taking the path to the dataset containing that attribute, appending a "/" followed by the entry name of the entry containing that attribute followed by "/". 3.3. 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 in which 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 100, if the server supports a larger limit it must advertise it in a CONTEXTLIMIT capability. 3.4. Orderings An ordering is a named collation function which takes two input strings and determines whether they are greater than, less than, or equal to each other. Orderings are used both for simple equality searching, for ordinal comparision searching and for sorting of attributes. An ordering is prefixed by either "+" or "-". If prefixed by "-", then the order is reversed. In all collation functions, NIL is always less than any other value and is equal only to itself. Additional ordering functions may be registered with IANA according to the rules in section
. The following ordering functions are defined by this standard: octet The octet ordering function interprets the value of an attribute as a series of unsigned octets with ordinal values from 0 to 255. Each octet pair is compared in sequence until the octets are unequal or the end of the string is reached. When collating two strings where the shorter is a Newman [Page 15] Internet DRAFT ACAP March 26, 1997 prefix of the longer, the shorter string is interpreted as having a smaller ordinal value. The +octet form collates smaller ordinal values earlier, and the -octet form collates larger ordinal values earlier. For non-binary values, the +octet ordering is equivalent to the ANSI C strcmp() function applied to C string representations of the values. en-nocase The en-nocase ordering function first applies a mapping to the attribute values which translates all US-ASCII letters to uppercase (octet values 0x61 to 0x7A are translated to octet values 0x41 to 0x5A respectively), then applies the octet ordering function as described above. With this function the values "hello" and "HELLO" have the same ordinal value and are considered equal. numeric The numeric ordering function assigns ordinal values based on a US-ASCII encoded decimal positive integer interpretation. With the numeric function, all values which do not begin with a digit are considered equal with an ordinal value of -1. Otherwise, all US-ASCII digits (octet values 0x30 to 0x39) are interpreted starting from the beginning of the string to the first non-digit or the end of the string. 3.5. Server Status Responses An OK, NO or BAD response from the server, whether tagged or untagged, is considered a status response. Status responses may include an optional response code. A response code consists of data inside parentheses 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. MODIFIED This response code indicates that a conditional store failed because the MODTIME on the entry is later than the modtime specified with the STORE Newman [Page 16] Internet DRAFT ACAP March 26, 1997 command. PERMISSION A STORE, SETQUOTA, or SETACL command failed due to insufficient permission. QUOTA A STORE command which would have increased the size of the dataset failed due to insufficient quota. REFER This response code may be returned in a tagged NO response to any command that takes a dataset name as a parameter. It has one argument with the syntax of a relative URL. It is a referral, indicating that the command should be retried using the dataset named in the relative URL. TOOMANY This response code may be returned in a tagged OK response to a SEARCH command which includes the LIMIT modifier. The argument returns the number of matching entries. TRYFREECONTEXT This response code may be returned in a tagged NO respose to a SEARCH command which includes the MAKECONTEXT modifier. It indicates that a new context may not be created due to the server's limit on the number of existing contexts. WAYTOOMANY This response code may be returned in a tagged OK response to a SEARCH command which includes a HARDLIMIT search modifier. It indicates that the SEARCH would have returned more entries than the hardlimit permitted. 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 MUST ignore response codes that they do not recognize. 3.6. Server Command Continuation Request The command continuation request is indicated by a "+" token instead of a tag. This 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 synchronizing literal. Newman [Page 17] Internet DRAFT ACAP March 26, 1997 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, assuming it checks for non-synchronizing literals at the end of each line. 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. Example: C: A099 FREECONTEXT {10} S: + "Ready for additional command text" C: FRED C: FOOB S: A099 OK "FREECONTEXT completed" C: A044 BLURDYBLOOP {102856} S: A044 BAD "No such command as 'BLURDYBLOOP'" Newman [Page 18] Internet DRAFT ACAP March 26, 1997 4. 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. 4.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
. 4.1.1. ACAP Untagged 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 defined in a standards track or IESG approved experimental RFC and registered with IANA according to the rules in section
. Client implementations SHOULD NOT require any capability name, and MUST ignore any unknown capability names. Newman [Page 19] Internet DRAFT ACAP March 26, 1997 The following initial capabilities are defined: CONTEXTLIMIT The CONTEXTLIMIT capability has one argument which is a number describing the maximum number of contexts the server supports per connection. The number 0 indicates the server has no limit, otherwise this number MUST be greater than 100. IMPLEMENTATION The IMPLEMENTATION capability has one argument which is a string describing the server implementation. ACAP clients MUST NOT alter their behavior based on this value. It is intended primarily for debugging purposes. ORDERINGS The ORDERINGS capability includes a list of the ordering/comparison functions which the server supports. See section
for a description of ordering/comparison functions. SASL The SASL capability includes a list of the authentication mechanisms supported by the server. See [SASL] for more information. Example: S: * OK IMPLEMENTATION("ACME v3.5") SASL("CRAM-MD5" "GSSAPI") 4.2. Any State The following commands and responses are valid in any state. 4.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. It can be Newman [Page 20] Internet DRAFT ACAP March 26, 1997 used to reset any inactivity autologout timer on the server. Example: C: a002 NOOP S: a002 OK "NOOP completed" 4.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) 4.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" 4.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 Newman [Page 21] Internet DRAFT ACAP March 26, 1997 command may still complete successfully. The human-readable text describes the condition. Example: C: A001 NOOP S: * NO (ALERT) "Dataset '/addressbook/user/fred' is at 98% of quota" S: A001 OK "NOOP" ... C: A222 STORE ("/mailboxes/comp.mail.misc" "mailbox.creation-time" "19951206103412") S: A222 NO (PERMISSION) "Permission denied" 4.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 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" C: A444 NOOP Hello S: A444 BAD "invalid arguments" 4.2.6. BYE Untagged 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 Newman [Page 22] Internet DRAFT ACAP March 26, 1997 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" 4.3. Non-Authenticated State In non-authenticated state, the AUTHENTICATE command establishes authentication and enters authenticated state. The AUTHENTICATE command provides a general mechanism for a variety of authentication techniques. Server implementations may allow non-authenticated access to certain information. The convention is to use an AUTHENTICATE command with the userid "anonymous" with the SASL XXX mechanism. 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. 4.3.1. AUTHENTICATE Command Arguments: SASL mechanism name optional initial response 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 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 security layer for subsequent protocol interactions. If the requested authentication mechanism is not supported, the server rejects the AUTHENTICATE command by sending a tagged NO response. The authentication protocol exchange consists of a series of Newman [Page 23] Internet DRAFT ACAP March 26, 1997 server challenges and client answers that are specific to the authentication mechanism. A server challenge consists of a command continuation request 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. The optional initial-response argument to the AUTHENTICATE command is used to save a round trip when using authentication mechanisms that are defined to send no data in the initial challenge. When the initial-response argument is used with such a mechanism, the initial empty challenge is not sent to the client and the server uses the data in the initial-response argument as if it were sent in response to the empty challenge. If the initial-response argument to the AUTHENTICATE command is used with a mechanism that sends data in the initial challenge, the server rejects the AUTHENTICATE command by sending a tagged NO response. The service name specified by this protocol's profile of SASL is "acap". If a security layer is negotiated through the SASL authentication exchange, it 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. The server is not required to support any particular authentication mechanism, nor are authentication mechanisms required to support any protection mechanisms. If an AUTHENTICATE command fails with a NO response, the client may try another authentication mechanism by issuing another AUTHENTICATE command. In other words, the client may request authentication types in decreasing order of preference. Example: S: * OK IMPLEMENTATION("Blorfysoft v3.5") SASL(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 Newman [Page 24] Internet DRAFT ACAP March 26, 1997 editorial clarity and are not in real authenticators. 4.4. Searching This section describes the SEARCH command, for retrieving data from datasets. 4.4.1. SEARCH Command Arguments: dataset or context name optional list of modifiers search criteria Data: intermediate responses: ENTRY, MODTIME, REFER untagged responses: ADDTO, REMOVEFROM, CHANGE, MODTIME 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. A successful SEARCH command MUST result in a MODTIME intermediate response. Following that are zero or more modifiers to the search. Each modifier may be specified at most once. The defined modifiers are: DEPTH number The SEARCH command will traverse the dataset tree up to the specified depth. ENTRY responses will include the full path to the entry. A value of "0" indicates that the search should traverse the entire tree. A value of "1" is the default and indicates only the specified dataset should be searched. If a dataset is traversed which is not located on the current server, then a REFER intermediate response is returned for that subtree and the search continues. Newman [Page 25] Internet DRAFT ACAP March 26, 1997 If this is used in combination with a SORT or MAKECONTEXT operator, the server MUST return a BAD command completion result. HARDLIMIT number If the SEARCH command would result in more than number entries, the SEARCH fails with a NO completion result with a WAYTOOMANY response code. LIMIT number number Limits the number of intermediate ENTRY responses that the search may generate. The first numeric argument specifies the limit, the second number specifies the number of entries to return if the number of matches exceeds the limit. If the limit is exceeded, the SEARCH command still succeeds, returning the total number of matches in a TOOMANY response code in the tagged OK response. MAKECONTEXT context 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 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 number of existing contexts, the command fails, returning a TRYFREECONTEXT response code in the tagged NO response. Contexts are discussed in more detail in section
. NOTIFYCONTEXT Requests that the server send untagged ADDTO, REMOVEFROM, CHANGE, and MODTIME responses while the context created or referenced by this SEARCH command exists. The server MAY issue untagged ADDTO, REMOVEFROM, CHANGE and MODTIME notifications for a context at any time between the issuing of the SEARCH command with NOTIFYCONTEXT and the completion of a FREECONTEXT command for the context. After issuing a sequence of ADDTO, REMOVEFROM or CHANGE notifications, the server MUST Newman [Page 26] Internet DRAFT ACAP March 26, 1997 issue an untagged MODTIME notification indicating that the client has all updates to the entries in the context up to and including the given modtime value. The client MAY issue a subsequent SEARCH on the context with a NOTIFYCONTEXT modifier, and this MAY be used to change the list of attributes and metadata included in ADDTO and CHANGE responses for the context. RETURN (metadata...) Specifies what is to be returned in intermediate ENTRY responses. If this modifier is not specified, no intermediate ENTRY responses are returned. Inside the parentheses is a list of attributes, each optionally followed by a parenthesized list of metadata. If the parenthesized list of metadata is not specified, it defaults to "(value)". An attribute name with a trailing "*" requests all attributes with that prefix. A "*" by itself requests all attributes. If the parenthesized list of metadata is not specified for an attribute with a trailing "*", it defaults to "(attribute value)". Following the last intermediate ENTRY response, the server returns a single intermediate MODTIME response. 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. Successive attribute/ordering pairs are used to order two entries only when all preceeding pairs indicate the 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. Newman [Page 27] Internet DRAFT ACAP March 26, 1997 If no SORT modifier is specified, or none of the attribute/ordering pairs indicates an order for the 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. Search keys may be combined using the AND, and OR search keys. For example, the criteria (the newline is for readability and not part of the criteria): AND COMPARE modtime +octet "19951206103400" COMPARE modtime -octet "19960112000000" refers to all entries modified between 10:34 December 6 1995 and midnight January 12, 1996 UTC. The currently defined search keys are as follows. ALL This matches all entries. AND search-key1 search-key2 Entries that match both search keys. 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. 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 end time Entries which are within the specified range of the context's ordering. The lowest-ordered entry in the context is assigned number one, the next lowest entry is assigned number two, and so on. The numeric arguments specify the lowest and Newman [Page 28] Internet DRAFT ACAP March 26, 1997 highest numbers to match. The time specifies that the client has processed notifications for the context up to the specified time. If the context has been modified since then, the server MUST either return a NO with a MODIFIED response code, or return the results that the SEARCH would have returned if none of the changes since that time had been made. RANGE is only permitted on contexts. If RANGE is used with a dataset, the server MUST return a BAD command completion result. Example: C: [TODO - write examples] 4.4.2. ENTRY Intermediate Response Data: entry name entry data The ENTRY intermediate response occurs as a result of a SEARCH 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 strings, each containing the respective metadata, contained in the entry, that was specified in the RETURN search modifier. 4.4.3. MODTIME Intermediate Response Data: modtime value The MODTIME intermediate response occurs as a result of a SEARCH command. It indicates that the just created context or the previously returned ENTRY responses include all updates to the returned entries up to and including the modtime value in the argument. 4.4.4. REFER Intermediate Response Data: dataset path ACAP URL The REFER intermediate response occurs as a result of a multi- level SEARCH where one of the levels is located on a different server. The reponse indicates the dataset which is not located on the current server and an ACAP URL for where that dataset may be found. Newman [Page 29] Internet DRAFT ACAP March 26, 1997 4.5. Contexts The following commands use contexts created by a SEARCH command with a MAKECONTEXT modifier. 4.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" 4.5.2. UPDATECONTEXT Command Arguments: list of context names Data: untagged responses: ADDTO REMOVEFROM CHANGE MODTIME Result: OK - Updatecontext completed: all updates completed NO - Updatecontext failed: no such context BAD - command unknown or arguments invalid The UPDATECONTEXT command causes the server to ensure that the client is notified of all changes to the contexts listed as arguments up to the current time. The contexts listed in the arguments must have been previously given to a successful SEARCH command with a NOTIFYCONTEXT modifier. A MODTIME untagged response MUST be returned if any read-write metadata in the dataset changed since the last MODTIME on that context. This includes metadata which is not listed in the RETURN modifier on the last SEARCH command with a NOTIFYCONTEXT modifier for this context. While a server may issue untagged ADDTO, REMOVEFROM, CHANGE, and Newman [Page 30] Internet DRAFT ACAP March 26, 1997 MODTIME at any time, the UPDATECONTEXT command is used to "prod" the server to send any notifications it has not sent yet. The UPDATECONTEXT command SHOULD NOT be used to poll for updates. Example: C: Z4S9 UPDATECONTEXT "blurdybloop" "blarfl" S: Z4S9 OK "client has been notified of all changes" 4.5.3. ADDTO Untagged Response Data: context name entry name position metadata 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 metadata contained in the entry which match the RETURN statement specified in the last SEARCH command on the context with a NOTIFYCONTEXT search modifier. The ADDTO response implicitly adds one to the position of all members of the context which had position numbers that were greater than or equal to the ADDTO position number. Example: S: * ADDTO "blurdybloop" "fred" 15 ("addressbook.email" "fred@rock.org") 4.5.4. REMOVEFROM Untagged 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). The REMOVEFROM response implicity subtracts one from the position numbers of all members of the context which had position numbers greater than the REMOVEFROM position number. Example: S: * REMOVEFROM "blurdybloop" "fred" 15 Newman [Page 31] Internet DRAFT ACAP March 26, 1997 4.5.5. CHANGE Untagged Response Data: context name entry name old position new position metadata 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 SEARCH command with a NOTIFYCONTEXT search modifier 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 SEARCH command with a NOTIFYCONTEXT search modifier for the context. The CHANGE reponse implicitly changes the position numbers of all entries which had position numbers between the old and new position. If old position is less than new position, than one is subtracted from all entries which had position numbers in that range. Otherwise one is added to all entries which had position numbers in that range. If the old position and new position are the same, then no implicit position renumbering occurs. Example: S: * CHANGE "blurdybloop" "fred" 15 10 ("addressbook.email" "fred@stone.org") 4.5.6. MODTIME Untagged Response Data: context name modtime value The untagged MODTIME response informs the client that it has recieved all updates to entries in the context which have modtime values less than or equal to the modtime value in the argument. Example: S: * MODTIME mycontext "19970320162338" 4.6. Dataset modification The following commands and responses handle modification of datasets. Newman [Page 32] Internet DRAFT ACAP March 26, 1997 4.6.1. STORE Command Arguments: entry store list Data: no specific data for this command Result: OK - store completed NO - store failure: can't store that name UNCHANGEDSINCE specified and entry changed BAD - command unknown or arguments invalid invalid UTF-8 syntax Creates, modifies or deletes the named entries in the named datasets. The values of metadata not specified in the command are not changed. Setting the "value" metadata of an attribute to NIL removes that attribute from the entry. Setting the "value" metadata of the "entry" attribute to NIL removes that entry from the dataset. Changing the value of the "entry" attribute indicates a request to rename the entry. For each entry listed, an "UNCHANGEDSINCE" time may be included. If the "modtime" of the entry is later than the unchangedsince time, then the store fails with a MODIFIED response code. Clients writing to a shared dataset SHOULD use UNCHANGEDSINCE when modifying an existing entry. The server MUST either make all the changes specified or make none of them. If the STORE command includes no metadata for an entry, that entry's MODTIME MUST NOT be updated. The reserved attribute "modtime" may not be included in the metadata list, but will automatically be updated. Example: C: A342 STORE ("/addressbook/user/fred/ABC547" "addressbook.phone" "555-1234" "addressbook.Common Name" "Barney Rubble" "addressbook.email" NIL) S: A342 OK "Store completed" C: A343 STORE ("/addressbook/group/Tech/ABD42" UNCHANGEDSINCE "19970320162338" "addressbook.prs.hair-length" "10 inches") S: A343 NO (MODIFIED) "'ABD42' has been changed by somebody else." C: A344 STORE ("/addressbook/group/Tech/ACD54" "entry" NIL) S: A344 OK "Store completed" Newman [Page 33] Internet DRAFT ACAP March 26, 1997 4.6.2. DELETEDSINCE Command Arguments: dataset name time Data: intermediate response: DELETED Result: OK - DELETED completed NO - DELETED failure: can't read dataset date too far in the past BAD - command unknown or arguments invalid The DELETEDSINCE command returns in intermediate DELETED 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 response code in the tagged NO response. Example: C: Z4S9 DELETEDSINCE "/mailboxes/common" 19951205103412 S: Z4S9 DELETED "blurdybloop" S: Z4S9 DELETED "anteaters" S: Z4S9 OK "DELETEDSINCE completed" C: Z4U3 DELETEDSINCE "/mailboxes/common" 19951009040854 S: Z4U3 NO (TOOOLD) "Don't have that information" 4.6.3. DELETED Intermediate Response Data: entry name The untagged DELETED response occurs as a result of a DELETEDSINCE command. It returns an entry that has been deleted from the dataset specified in the DELETEDSINCE command. Example: S: Z4S9 DELETED "blurdybloop" 4.7. Access Control Lists An access control list is a tab-separated set of identifier,rights pairs. Identifier is a UTF-8 string. The identifier anyone is reserved to refer to the universal identity (all authentications, including anonymous). All user name strings accepted by the AUTHENTICATE command to authenticate to the ACAP server are reserved as Newman [Page 34] Internet DRAFT ACAP March 26, 1997 identifiers for the corresponding user. Identifiers starting with a dash ("-") are reserved for "negative rights", described below. All other identifier strings have implementation-defined semantics. 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. The set of standard rights may only be extended by a standards-track or IESG approved experimental RFC. Digits are reserved for implementation or site defined rights. The currently defined standard rights are: r - read w - write i - insert (store a new value) o - override (see section
) a - administer (perform store on ACL attribute/metadata) An implementation may force rights to always or never be granted. Rights are never tied, unlike the IMAP ACL extension [IMAP-ACL]. It is possible for multiple identifiers in an access control list to apply to a given user (or other authentication identity). For example, an ACL may include rights to be granted to the identifier matching the user, one or more implementation-defined identifiers matching groups which include the user, and/or the identifier "anyone". How these rights are combined to determine the user's access is implementation-defined. An implementation may choose, for example, to use the union of the rights granted to the applicable identifiers. An implementation may instead choose, for example, to only use those rights granted to the most specific identifier present in the ACL. A client may determine the set of rights granted to the logged-in user for a given mailbox by using the MYRIGHTS command. When an identifier in an ACL starts with a dash ("-"), that indicates that associated rights are to be removed from the identifier that is prefixed by the dash. For example, if the identifier "-fred" is granted the "w" right, that indicates that the "w" right is to be removed from users matching the identifier "fred". Implementations need not support having identifiers which start with a dash in ACLs. 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. Newman [Page 35] Internet DRAFT ACAP March 26, 1997 In order to perform any manipulation on an entry in a dataset, the client must have 'r' rights on the "entry" attribute of the entry. Implementations should take care not to reveal via error messages the existence of an entry for which the client does not have 'r' rights. A client does not need access to the "subdataset" attribute of the parent dataset in order to access the contents of a dataset. 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. 4.7.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, one is created. Example: C: A123 SETACL ("/addressbook/user/joe/public") anyone r S: A123 OK "Setacl complete" C: A124 SETACL ("/mailboxes/common") B1FF rwa S: A124 NO (PERMISSION) "'B1FF' not permitted to modify access rights for '/mailboxes/common'" Newman [Page 36] Internet DRAFT ACAP March 26, 1997 4.7.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. This form of the DELETEACL command is not permitted on the default ACL for a dataset and servers MUST return a BAD. Example: C: A223 DELETEACL ("/addressbook/user/joe/public") anyone S: A223 OK "Deleteacl complete" C: A224 DELETEACL ("/mailboxes/common") S: A224 BAD "Can't delete ACL from dataset" C: A225 DELETEACL ("/addressbook/user/fred" "addressbook.email" "barney") S: A225 OK "Deleteacl complete" 4.7.3. MYRIGHTS Command Arguments: acl object Data: intermediate 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 client has to the given dataset or dataset attribute. Example: C: A003 MYRIGHTS ("/mailboxes/common") S: A003 MYRIGHTS "r" Newman [Page 37] Internet DRAFT ACAP March 26, 1997 S: A003 OK "Myrights complete" 4.7.4. MYRIGHTS Intermediate Response Data: rights The MYRIGHTS response occurs as a result of a MYRIGHTS command. The argument is the set of rights that the client has for the object referred to in the MYRIGHTS command. 4.7.5. 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: a001 LISTRIGHTS ("/mailboxes") smith r w S: a001 OK Listrights completed C: a005 LISTRIGHTS ("/mailboxes" archive.imap) anyone S: a005 LISTRIGHTS ("/mailboxes" archive.imap) anyone "" r w S: a005 OK Listrights completed 4.7.6. LISTRIGHTS Intermediate Response Data: acl object identifier required rights list of optional rights The LISTRIGHTS response occurs as a result of a LISTRIGHTS Newman [Page 38] Internet DRAFT ACAP March 26, 1997 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 on the dataset or attribute. Following this are zero or more strings each containing a single right the identifier may be granted in the dataset or attribute. The same right may not be listed more than once in the LISTRIGHTS response. 4.8. Quotas Quotas are used to manage storage consumed by ACAP datasets. A quota root is a place where a resource limit may be set which applies to an implementation dependant subset of datasets. 4.8.1. SETQUOTA Command Arguments: quota root resource limit in octets or NIL Data: intermediate responses: QUOTA Result: OK - Quota root resource limit modified NO - Quota failure: can't modify resourse limit BAD - command unknown or arguments invalid The SETQUOTA command takes the name of a quota root and a number indicating the desired resource limit in octets on all datasets within that root. A value of "0" indicates no resource limit is desired. A value of NIL indicates the quota root should be removed. If the named quota root did not previously exist and a value other than NIL is specified, an implementation SHOULD create it. If the quota root exists and a value of NIL is specified, an implementation SHOULD delete the quota root. In either case the implementation may change the quota root which applies to any number of datasets. Example: C: A042 SETQUOTA "/user/fred" 1048576 S: A042 QUOTA "/user/fred" 1048576 0 S: A042 OK "Setquota completed" C: A043 SETQUOTA "/usr/fred" NIL S: A043 OK "Setquota completed" Newman [Page 39] Internet DRAFT ACAP March 26, 1997 4.8.2. GETQUOTA Command Arguments: dataset Data: intermediate responses: QUOTA Result: OK - Quota information returned NO - Quota failure: can't access resourse limit BAD - command unknown or arguments invalid The GETQUOTA command takes the name of a dataset, and returns in an intermediate QUOTA response the name of the quota root, the amount of the resource limit on that root and the amount of that resource limit which is used. Example: C: A043 GETQUOTA "/option/user/fred/common" S: A043 QUOTA "/user/fred" 1024 50 S: A043 OK "Getquota completed" 4.8.3. QUOTA Intermediate Response Data: quota root resource limit in octets amount of resource limit used The QUOTA intermediate response is generated as a result of a SETQUOTA or GETQUOTA command. It includes the name of the quota root, the resource limit in octets and the amount of resource limit used. 4.9. Extensions In order to simplify the process of extending the protocol, clients MUST ignore unknown server responses which meet the syntax of response-extend. In addition, clients MUST ignore server response codes which meet the syntax of resp-code-ext. Availability of new commands MUST be announced via a capability on the initial greeting line and such commands SHOULD meet the syntax of command-extend. Servers MUST respond to unknown commands with a BAD command completion result. Servers MUST skip over non-synchronizing literals contained in an extension command. This may be done by assuming the unknown command matches the command-extend syntax, or by reading a line at a time and checking for the non-synchronizing literal syntax at the end of the line. Newman [Page 40] Internet DRAFT ACAP March 26, 1997 5. Dataset Management The entry with an empty name in the dataset is used to hold management information for the dataset as a whole. 5.1. Dataset Inheritance It is possible for a dataset to inherit data from another. Data in the inherited dataset appears in the inheriting dataset, except where explicitly overridden by data in the inheriting dataset. The inherited dataset specifies which values may be overridden in the inheriting datasets. If an inherited dataset has a non-NIL value for any given attribute in an entry, the ACL for that attribute in that entry must grant a user the 'o' right in order for the user to store a corresponding value in an inheriting dataset. The inherited dataset is usually a system-wide or group-wide set of defaults. The system-wide dataset usually has one inheriting dataset per user, allowing each user to add to or modify the defaults as appropriate. An entry which exists in both the inheriting and inherited dataset has a modtime equal to the greator of the modtimes for the purposes of a SEARCH command and context notification. Inheritance has no effect on the STORE command other than that specified by the 'o' right. Servers MUST support at least two levels of inheritance. This permits a user's dataset such as "/options/user/fred/common" to inherit from a group dataset such as "/options/group/dinosaur operators/common" which in turn inherits from a server-wide dataset such as "/options/common/common". 5.2. Dataset attributes The following attributes apply to management of the dataset when stored in the "" entry of a dataset. dataset.acl This holds the default access control list for the dataset. It can not be modified by the STORE command, only by the SETACL and DELETEACL commands. dataset.acl. This holds the default access control list for an attribute within the dataset. It can not be modified by the STORE command, Newman [Page 41] Internet DRAFT ACAP March 26, 1997 only by the SETACL and DELETEACL commands. dataset.inherit This holds the name of a dataset to inherit according to the rules in section
. 6. Namespace conventions 6.1. Dataset Namespace The dataset namespace is a slash-separated hierarchy. By convention, the first component of the dataset namespace is a dataset class. A dataset class SHOULD be published as an RFC which includes predefined set of attributes and their meanings. The second component of the dataset name is "common", "group", or "user" for server-wide, group- wide, or per-user datasets respectively. For group or user datasets, the third component of the dataset name is the name of the group or the AUTHENTICATE identifier for the user. Other components of the dataset name are specific to the dataset class. Dataset classes MUST be registered with IANA according to the rules in section
. Dataset classes which are intended for interoperable use MUST be published as a standards track or IESG approved experimental RFC. 6.2. Attribute Namespace Attribute names which do not contain a dot (".") are reserved for standardized attributes which have meaning in any dataset. In order to simplify implementations, the attribute namespace is intended to be unique across all datasets. To achieve this, attribute names are prefixed with the dataset class name followed by a dot ("."). Attributes which effect management of the dataset are prefixed with "dataset.". In addition, a subtree of the "vnd." or "prs." namespaces may be registered with IANA according to the rules in section
. ACAP implementors are encouraged to help define interoperable dataset classes rather than using the private attribute namespaces. 7. Registration procedures ACAP's usefulness comes from providing a structured storage model for all sorts of configuration data. However, for its potential to be achieved, it is important that the Internet community strives for the following goals: Newman [Page 42] Internet DRAFT ACAP March 26, 1997 (1) Standardization. It is very important to standardize dataset classes. The authors hope that ACAP achieves the success that SNMP has seen with the definition of numerous standards track MIBs. (2) Community Review. In the absence of standardization, it is important to get community review on a proposal to improve the engineering quality. Community review is strongly recommended prior to registration. The ACAP developers mailing list may be used for this purpose. (3) Registration. Registration serves a two-fold purpose. First it prevents use of the same name for different purposes, and second it provides a one-stop list which can be used to locate existing extensions. The following registration templates may be used to register ACAP protocol elements. 7.1. Ordering Functions Additional ordering functions may be registered with IANA on a first-come, first-served basis. Ordering functions intended for interoperable use SHOULD be defined as a standards track or IESG approved experimental RFC. To: XXX@XXX.XXX Subject: Registration of new ACAP ordering function Ordering name: Scope: Any Dataset / Specific Dataset class / Specific locality Published Specification(s): (If the published specification is not standards track, or no published specifiction is referenced then the ordering function is assumed to be for limited use) Person and email address to contact for further information: 7.2. ACAP Capabilities New ACAP capabilities MUST be standards track or IESG approved experimental RFCs. Registration provides a simple way to locate all extensions. Careful consideration should be made before extending the protocol, as it can lead to complexity or interoperability problems. Newman [Page 43] Internet DRAFT ACAP March 26, 1997 To: XXX@XXX.XXX Subject: Registration of ACAP capability Capability name: Capability keyword: Capability arguments: standards track/IESG-approved experimental RFC number: 7.3. Dataset Classes A dataset class provides a core set of attributes for use in a specified hierarchy. It may also define rules for the dataset hierarchy underneath that class. Community review of dataset classes is strongly encouraged. Classes intended for interoperable use should be written as standards track or IESG approved experimental RFCs. To: XXX@XXX.XXX Subject: Registration of ACAP dataset class Dataset class name/attribute prefix: Purpose: Required attributes: Optional attributes: Published Specification(s): (The published specification must be freely available on the Internet or included with the registration. It should include ABNF [as defined in RFC 822] for the specified attributes.) Person and email address to contact for further information: 7.4. Private Attribute Subtree A private attribute subtree may be registered on a first come, first serve basis. Private attributes may be used to store information specific to a particular client within an ACAP entry of any dataset class. Whenever possible, private attributes should be avoided in favor of improving interoperable dataset class definitions. Newman [Page 44] Internet DRAFT ACAP March 26, 1997 To: XXX@XXX.XXX Subject: Registration of ACAP private prefix Private Prefix: vnd.. or prs.. Person and email address to contact for further information: (company names and addresses should be included when appropriate) 8. Formal Syntax The following syntax specification uses the augmented Backus-Naur Form (BNF) notation as specified in [IMAIL] 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. 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 ATOM-CHAR ::= ATOM-SPECIALS ::= "(" / ")" / "{" / SPACE / CTL / QUOTED-SPECIALS BASE64-CHAR ::= ALPHA / DIGIT / "+" / "/" CHAR ::= CHAR8 ::= CR ::= CRLF ::= CR LF CTL ::= DIGIT ::= "0" / DIGIT-NZ DIGIT-NZ ::= "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" Newman [Page 45] Internet DRAFT ACAP March 26, 1997 LF ::= OCTET ::= QUOTED-CHAR ::= / "\" QUOTED-SPECIALS QUOTED-SPECIALS ::= <"> / "\" SPACE ::= TEXT-CHAR ::= TEXT-UTF8-CHAR ::= UTF8-CHAR ::= acl-identifier ::= string acl-object ::= "(" dataset [SPACE attribute [SPACE entry-name]] ")" acl-rights ::= quoted atom ::= 1*1024ATOM-CHAR attribute ::= string ;; dot-separated attribute name ;; ends in ".bin" if value not textual ;; MUST NOT contain "*" auth-type ::= atom ;; as defined in SASL [SASL] base64-token ::= *(4BASE64-CHAR) [base64-terminal] base64-terminal ::= (2BASE64-CHAR "==") / (3BASE64-CHAR "=") command ::= tag SPACE (command-any / command-auth / command-nonauth) CRLF ;; Modal based on state command-authent ::= "AUTHENTICATE" SPACE atom [SPACE base64-token] *(CRLF base64-token) command-any ::= "NOOP" Newman [Page 46] Internet DRAFT ACAP March 26, 1997 command-auth ::= command-delacl / command-dsince / command-freectx / command-getquota / command-lrights / command-myrights / command-search / command-setacl / command-setquota / command-store ;; only valid in authenticaticated state command-delacl ::= "DELETEACL" SPACE acl-object [SPACE acl-identifier] command-delete ::= "DELETE" SPACE entry-path command-dsince ::= "DELETEDSINCE" SPACE dataset SPACE time command-extend ::= atom [SPACE #extension-data] command-freectx ::= "FREECONTEXT" SPACE context command-getquota ::= "GETQUOTA" SPACE dataset command-lrights ::= "LISTRIGHTS" SPACE acl-object command-myrights ::= "MYRIGHTS" SPACE acl-object command-nonauth ::= command-authent ;; only valid in non-authenticated state command-search ::= "SEARCH" SPACE (dataset / context) *(SPACE search-modifier) SPACE search-criteria command-setacl ::= "SETACL" SPACE acl-object SPACE acl-identifier SPACE acl-rights command-setquota ::= "SETQUOTA" SPACE quota-root SPACE (number / nil) command-store ::= "STORE" SPACE 1#store-entry context ::= string ;; MUST NOT begin with slash ("/") continue-req ::= "+" SPACE (resp-text / base64-token) dataset ::= string ;; slash-separated dataset name ;; begins with slash entry ::= entry-name / entry-path Newman [Page 47] Internet DRAFT ACAP March 26, 1997 entry-name ::= string ;; entry name MUST NOT contain slash ;; MUST NOT begin with "." entry-path ::= string ;; slash-separated path to entry ;; begins with slash entry-relative ::= string ;; potentially relative path to entry extension-data ::= string / number / "(" #extension-data ")" initial-greeting ::= "*" SPACE "ACAP" *(SPACE init-capability) CRLF init-capability ::= atom [ "(" 1#string ")" ] literal ::= "{" number [ "+" ] "}" CRLF *OCTET ;; The number represents the number of octets ;; MUST be literal-utf8 except for values of ;; attributes whose names end in ".bin" literal-utf8 ::= "{" number [ "+" ] "}" CRLF *UTF8-CHAR ;; The number represents the number of octets metadata ::= attribute [ "(" 1#metadata-type ")" ] metadata-partial ::= "value<" number "." number ">" metadata-store ::= 1#(attribute ["(" metadata-write ")"] SPACE nstring) metadata-type ::= "acl" / "attribute" / "myrights" / "size" / metadata-partial / metadata-write metadata-write ::= "value" nil ::= "NIL" nstring ::= nil / string number ::= 1*DIGIT nz-number ::= DIGIT-NZ *DIGIT ordering ::= ("+" / "-") atom quota-root ::= dataset Newman [Page 48] Internet DRAFT ACAP March 26, 1997 quoted ::= <"> *QUOTED-CHAR <"> response ::= *response-data response-done response-addto ::= "*" SPACE "ADDTO" SPACE context SPACE entry-name SPACE number SPACE #return-data response-bye ::= "*" SPACE "BYE" SPACE resp-body CRLF ;; Server will disconnect condition response-change ::= "*" SPACE "CHANGE" SPACE context SPACE entry-name SPACE number SPACE number SPACE #return-data response-data ::= response-change / response-deleted / response-entry / response-implic / response-mtimei / response-mtimeu / response-myright / response-refer / response-remove / response-stat / response-bye response-deleted ::= tag SPACE "DELETED" SPACE entry-name response-done ::= tag SPACE resp-cond-state CRLF response-entry ::= tag SPACE "ENTRY" SPACE entry SPACE #return-data response-extend ::= tag SPACE atom [SPACE 1#extension-data] response-implic ::= tag SPACE "LISTRIGHTS" SPACE acl-rights 0*(SPACE acl-rights) response-mtimei ::= tag SPACE "MODTIME" SPACE time response-mtimeu ::= "*" SPACE "MODTIME" SPACE context SPACE time response-myright ::= tag SPACE "MYRIGHTS" SPACE acl-rights response-refer ::= tag SPACE "REFER" SPACE dataset SPACE <"> url-relative <"> response-remove ::= "*" SPACE "REMOVEFROM" SPACE context SPACE entry-name SPACE number response-stat ::= "*" SPACE resp-cond-state CRLF resp-body ::= ["(" resp-code ")" SPACE] quoted Newman [Page 49] Internet DRAFT ACAP March 26, 1997 resp-code ::= "ALERT" / "MODIFIED" / "PERMISSION" / "QUOTA" / resp-code-refer / resp-code-many / "TRYFREECONTEXT" / resp-code-ext resp-code-ext ::= atom [SPACE 1#extension-data] ;; extension-data MUST NOT contain "]" resp-code-many ::= "TOOMANY" SPACE nz_number resp-code-refer ::= "REFER" SPACE 1#(<"> url-relative <">) resp-cond-state ::= ("OK" / "NO" / "BAD") SPACE resp-body ;; Status condition return-data ::= nstring / number searchkey-equal ::= "EQUAL" SPACE attribute SPACE ordering SPACE value searchkey-comp ::= "COMPARE" SPACE attribute SPACE ordering SPACE value searchkey-strict ::= "COMPARESTRICT" SPACE attribute SPACE ordering SPACE value searchkey-range ::= "RANGE" SPACE nz-number SPACE nz-number SPACE time searchmod-depth ::= "DEPTH" SPACE number searchmod-hard ::= "HARDLIMIT" SPACE nz-number searchmod-limit ::= "LIMIT" SPACE number SPACE number searchmod-make ::= "MAKECONTEXT" SPACE context searchmod-notify ::= "NOTIFYCONTEXT" searchmod-return ::= "RETURN" SPACE "(" #metadata ")" searchmod-sort ::= "SORT" SPACE "(" 1#(attribute SPACE ordering) ")" search-criteria ::= "ALL" / searchkey-equal / searchkey-comp / searchkey-strict / searchkey-range / "NOT" SPACE search-criteria / "OR" SPACE search-criteria SPACE search-criteria / "AND" SPACE search-criteria SPACE search-criteria Newman [Page 50] Internet DRAFT ACAP March 26, 1997 search-modifier ::= searchmod-depth / searchmod-hard / searchmod-limit / searchmod-make / searchmod-notify / searchmod-return / searchmod-sort store-cond ::= SPACE "UNCHANGEDSINCE" SPACE time store-entry ::= "(" entry-path [store-cond] *(SPACE metadata-store) ")" string ::= quoted / literal tag ::= 1* time ::= <"> time-year time-month time-day time-hour time-minute time-second time-subsecond <"> time-day ::= 2DIGIT ;; 00-31 time-hour ::= 2DIGIT ;; 00-23 time-minute ::= 2DIGIT ;; 00-59 time-month ::= 2DIGIT ;; 01-12 time-second ::= 2DIGIT ;; 00-60 time-subsecond ::= *DIGIT time-year ::= 4DIGIT value ::= nstring url-acap ::= "acap://" url-server "/" url-enc-entry [url-filter] ;; url-enc-entry interpreted relative to "/" url-attr-list ::= url-enc-attr *("&" url-enc-attr) url-auth ::= ";AUTH=" ("*" / auth-type) url-achar ::= uchar / "&" / "=" / "~" ;; See RFC 1738 for definition of "uchar" url-char ::= uchar / "=" / "~" / ":" / "@" / "/" ;; See RFC 1738 for definition of "uchar" url-depth ::= "DEPTH=" number Newman [Page 51] Internet DRAFT ACAP March 26, 1997 url-enc-attr ::= 1*url-char ;; encoded version of attribute name url-enc-auth ::= 1*url-achar ;; encoded version of auth-type above url-enc-entry ::= 1*url-char ;; encoded version of entry-relative above url-enc-search ::= 1*url-char ;; encoded version of search-criteria above url-enc-user ::= *url-achar ;; encoded version of login userid url-filter ::= "?" url-attr-list ["?" url-depth ["?" url-enc-search]] url-relative ::= url-acap / [url-enc-entry] [url-filter] ;; url-enc-entry is relative to base URL url-server ::= [url-user [url-auth] "@"] hostport ;; See RFC 1738 for definition of "hostport" Newman [Page 52] Internet DRAFT ACAP March 26, 1997 9. 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. Additional security considerations are discussed in the section discussing the AUTHENTICATE command. 10. Authors' Addresses Chris Newman Innosoft International, Inc. 1050 East Garvey Ave. South West Covina, CA 91790 USA Email: chris.newman@innosoft.com John G. Myers Email: jgm+@cmu.edu Newman [Page 53] Internet DRAFT ACAP March 26, 1997 Appendices A. References [IMAP4] Crispin, M., "Internet Message Access Protocol - Version 4rev1", RFC 2060, University of Washington, December 1996. [IMAP-ACL] Myers, J., "IMAP4 ACL extension", RFC 2086, Carnegie Mellon, January 1997. [SASL] Myers, J., "Simple Authentication and Security Layer (SASL)", draft-myers-auth-sasl-xx.txt [IMAIL] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, University of Delaware, August 1982. [UTF8] Yergeau, F. "UTF-8, a transformation format of Unicode and ISO 10646", RFC 2044, Alis Technologies, October 1996. [US-ASCII] "USA Standard Code for Information Interchange," X3.4. American National Standards Institute: New York (1968). [BASIC-URL] Berners-Lee, Masinter, McCahill, "Uniform Resource Locators (URL)", RFC 1738, CERN, Xerox Coproration, University of Minnesota, December 1994. [REL-URL] Fielding, "Relative Uniform Resource Locators", RFC 1808, UC Irvine, June 1995. Newman [Page 54] Internet DRAFT ACAP March 26, 1997 B. ACAP Keyword Index ACAP (untagged response) ................................... 19 ADDTO (untagged response) .................................. 31 ALERT (response code) ...................................... 16 ALL (search keyword) ....................................... 28 AND (search keyword) ....................................... 28 AUTHENTICATE (command) ..................................... 23 BAD (response) ............................................. 22 BYE (untagged response) .................................... 22 CHANGE (untagged response) ................................. 32 COMPARE (search keyword) ................................... 28 COMPARESTRICT (search keyword) ............................. 28 CONTEXTLIMIT (ACAP capability) ............................. 20 DELETEACL (command) ........................................ 37 DELETED (intermediate response) ............................ 34 DELETEDSINCE (command) ..................................... 34 DEPTH (search modifier) .................................... 25 ENTRY (intermediate response) .............................. 29 EQUAL (search keyword) ..................................... 28 FREECONTEXT (command) ...................................... 30 GETQUOTA (command) ......................................... 40 HARDLIMIT (search modifier) ................................ 26 IMPLEMENTATION (ACAP capability) ........................... 20 LIMIT (search modifier) .................................... 26 LISTRIGHTS (command) ....................................... 38 LISTRIGHTS (intermediate response) ......................... 38 LOGOUT (command) ........................................... 21 MAKECONTEXT (search modifier) .............................. 26 MODIFIED (response code) ................................... 16 MODTIME (intermediate response) ............................ 29 MODTIME (untagged response) ................................ 32 MYRIGHTS (command) ......................................... 37 MYRIGHTS (intermediate response) ........................... 38 NO (response) .............................................. 21 NOOP (command) ............................................. 20 NOT (search keyword) ....................................... 28 NOTIFYCONTEXT (search modifier) ............................ 26 OK (response) .............................................. 21 OR (search keyword) ........................................ 28 ORDERINGS (ACAP capability) ................................ 20 PERMISSION (response code) ................................. 17 QUOTA (intermediate response) .............................. 40 QUOTA (response code) ...................................... 17 RANGE (search keyword) ..................................... 28 REFER (intermediate response) .............................. 29 REFER (response code) ...................................... 17 REMOVEFROM (untagged response) ............................. 31 Newman [Page 55] Internet DRAFT ACAP March 26, 1997 RETURN (search modifier) ................................... 27 SASL (ACAP capability) ..................................... 20 SEARCH (command) ........................................... 25 SETACL (command) ........................................... 36 SETQUOTA (command) ......................................... 39 SORT (search keyword) ...................................... 27 STORE (command) ............................................ 33 TOOMANY (response code) .................................... 17 TRYFREECONTEXT (response code) ............................. 17 UNCHANGEDSINCE (STORE modifier) ............................ 33 UPDATECONTEXT (command) .................................... 30 WAYTOOMANY (response code) ................................. 17 acl (attribute metadata) ................................... 11 anyone (ACL identifier) .................................... 34 attribute (attribute metadata) ............................. 11 dataset.acl (dataset attribute) ............................ 41 dataset.acl. (dataset attribute) ................ 41 dataset.inherit (dataset attribute) ........................ 42 en-nocase (ordering function) .............................. 16 entry (predefined attribute) ............................... 9 modtime (predefined attribute) ............................. 9 myrights (attribute metadata) .............................. 11 numeric (ordering function) ................................ 16 octet (ordering function) .................................. 15 size (attribute metadata) .................................. 11 subdataset (predefined attribute) .......................... 10 value (attribute metadata) ................................. 11 value (attribute metadata) .................... 11 Newman [Page 56]