Networked Account Manager ProtocolThis is the documentation for the Networked Account Manager (NAM) Protocol. The Networked Account Manager Protocol allows multiple machines running the drink server software to connect to one server, thus allowing for centralized user data-storage and management. The original protocol was developed by Michael Douglas [nodata@csh.rit.edu] and DJ Edwards [dazig@csh.rit.edu]. Kevin Thompson [antiduh@csh.rit.edu] has also contributed to minor improvements. Index: Command Summary add-username/passwordAcronyms:
Protocol Conventions:
Connection Details:
NAM Server-Bound Commands: These are commands that the client may issue to the server. There are no client-bound commands in the NAM protocol. If the wrong number of parameters are specified, the command will automatically fail. This should be assumed for every command. add-username/password Registers a new user with the NAS. The user is created with default values - their balance is set to zero and their admin flag is set to false. The password field is provided simply in the case that the drink system were to switch to drink-specific passwords. As of the writing of this document, the drink system uses the CSH imap server to validate username-password pairs. If the system is not using drink specific passwords, then the password field is discarded. The password, even if blank, must be provided regardless - for example 'add-jason/' is valid. The command will fail if a non-zero-length password must be provided. The command will also fail if the specified user is already registered. Example:
:add-jason/whisperwhisper
Server Responses: >ack-trueThe user was successfully registered. >ack-falseThe command may have failed for a variety of reasons:
See also rem bye Tells the server to end the session and close the socket connecting it to the client. This command will not fail if extra parameters are specified, such as ' bye-data/moreData'.Example:
:bye
Server Response: >ack-trueThe server will always respond ack-true to this command. It will never fail.
After it responds, the socket it closed by the server.cau-login/password Stands for 'client authentication'. Authenticates the Networked Account Client with the Networked Account Server. When the client first connects, it is required to authenticate. If the client issues any command prior to authenticating, the commands will always return negative, which usually means 'ack-false'. The clients username and password pair is also tied to its IP. That is to say, the username, password and IP all have to match in order for the client to pass authentication. If the client fails authentication, 'ack-false' will be sent and the client's connection will be severed. The login is the login specific to the machine that is logging in. The password is the password that matches that login. Example:
:cau-machine1/whisperwhisper
Server Response: >ack-trueThe clients username, password, and IP all matched. The client is now authorized to send commands. >ack-false [disconnect]The client failed authentication, and was disconnected from the server. This means that the client supplied username and password, as well as the IP it was connecting from did not match. dec-username/amount Decrements a user's balance by the specified amount. A users balance may be negative. Note that the command will fail in the case that the username is not a registered user or the amount to decrement their account was not a number. This example first retrieves a users balance, and then sets it to -50 credits:
:gub-antiduh
Server Responses: >ack-trueThe user's balance was successfully decremented. >ack-falseThe username supplied was not a recognized username or the specified amount was not a number. See also gub, inc. gub-username Stands for 'get user balance'. Queries a specified user's balance. The returned data is the number of credits the user has on their account. If the user is not known, then the returned balance is zero. Example:
:gub-antiduh
Server Responses: >ack-nSpecifies that the user has n credits left. >ack-falseThe wrong number of parameters were specified. See also dec, inc inc-username/amount Increments the specified user's balance by the provided amount. If the amount is not a number or if the username is not a registered user, the command will fail. If the command succeeds, the return will be true. Example:
:inc-nodata/100
Server Response: >ack-trueThe specified amount was added to the user's credit balance. >ack-falseThe command failed either because the specified amount was not a number, or the user was not already registered. See also dec, gub. isp-username/password Determines whether or not the supplied username and password pair match. This is used to authenticate users who are connecting to clients. Returns true if the username and password match, false otherwise. Example:
:isp-antiduh/whisperwhisper
Server Responses: >ack-trueThe password provided for the specified username was correct, meaning that the user is now authenticated. >ack-falseThe username and password did not match; the user is not authenticated. isv-user Queries whether or not the given user is a user who is registered with the drink accounting system. Returns true if the user is recognized, false otherwise. Examples:
:isv-antiduh
Server Responses: >ack-trueSignifies that the provided user is a known user. >ack-falseSignifies that the provided user is not a known user. iua-username Queries a user's administrator status. If the user is unknown, false will be returned. Example:
:iua-antiduh
Server Responses: >ack-trueSignifies that the given user is an administrator. >ack-falseSignifies that either the given user is not recognized or is recognized but is not an administrator. See also sua nop Stands for 'no operation'. It is used to 'ping' the server, to determine if the connection to the server is still valid. This command may be especially useful if the software is running on an embedded system, where connection failures may not be immediately apparent. If a response is not sent in a timely fashion, the command could be deemed invalid. The command will not fail if extra parameters are specified, such as ' nop-data/moreData'.The command will always return 'ack-true'. Example:
:nop
Server Response: >ack-trueThe server always returns ' ack-true'. The command will never fail.rem-username Unregisteres a known user. If the user is known and the command is successful, the return is true. If the user is not already registered, or the command failed for an unknown reason, the return is false. Example:
:rem-antiduh
Server Responses: >ack-trueThe user was successfully removed. >ack-falseThe command failed. Most likely, the user was not already registered. See also add sua-username/status Changes a users administrator flag status. The flag controls the users ability to use privileged commands in an end-user client. The status field is either 'true' or 'false', which is the new value of the user's administrator flag. The command will fail if the status flag is not either 'true' or false, or if the specified user is not already registered. Example:
:sua-antiduh/true
Server Responses: >ack-trueThe user's administrator flag was successfully changed. >ack-falseThe command failed. Most likely, the given user was not already registered. See also iua ver Shows the current version of the NAS. The string returned does not contain any spaces, and is not formatted specifically for parsing, moreso for displaying to the user. However, the version number is the last part of the string, and immediately follows the last instance of the letter 'v'. Example:
:ver
Server Response: >ack-NetAcctServer_vNThe response is always in the above form, where N is the 'major.minor' version tag. This document is maintained by Kevin Thompson [antiduh@csh.rit.edu]. Revision: $Revision: #6 $ Last Changed: $Date: 2003/08/20 $ |