1 Protocol between the server and the clients
2 ===========================================
4 Messages are sent through a UNIX-domain sequential packet socket
5 and authenticated by automatic passing of user credentials.
6 For every request, a reply is sent through the same connection.
7 Pipelining of requests is currently not supported.
9 All requests and replies are serialized as JSON objects. Requests
10 have always the "cmd" attribute set to the name of the command.
11 Replies always have the "error" attribute set; it contains an error
12 message or an empty string to indicate success.
14 Some operations require root privileges. Other operations are
15 unprivileged if no login name present, or if the correct "auth-passwd"
16 is provided and target user has allowed administration of their
17 account using a password authentication. Only regular password can be
18 used for such authentication, tokens are not accepted.
20 # No operation (unprivileged)
25 # Create an account (privileged)
28 "login": "login name",
32 # Delete an account (privileged)
35 "login": "login name",
36 "zone": "auth zone" # "*" to delete accounts in all zones
39 # Create an authentication token
41 "cmd": "create-token",
42 "login": "login name",
43 "auth-passwd": "current password",
45 "comment": "optional comment"
53 # Delete an authentication token
55 "cmd": "delete-token",
56 "login": "login name",
57 "auth-passwd": "current password",
59 "ident": "token id" # "*" for all tokens for the login+zone
62 # Change parameters of a token
65 "login": "login name",
66 "auth-passwd": "current password",
69 "comment": "new comment" # optional
72 # Set password for an account
75 "login": "login name",
76 "auth-passwd": "current password",
78 "passwd": "new password"
81 # Delete password for an account
83 "cmd": "delete-passwd",
84 "login": "login name",
85 "auth-passwd": "current password",
89 # Create a temporary token
92 "login": "login name",
93 "auth-passwd": "current password",
95 "validity": seconds # Requested token validity
102 # Authenticate a user
105 "login": "login name",
107 "passwd": "password or token"
110 # Allow/disallow management of selected account using password
112 "cmd": "allow-passwd-auth",
113 "login": "login name",
114 "auth-passwd": "current password",
119 # List user's accounts and tokens
122 "login": "login name",
126 "login: "login name",
130 "allow-passwd-auth": integer, # Can anybody manage this account using its password?
133 "type": "token type", # passwd/token
135 "lastmod": timestamp # UNIX timestamp of last modification
144 # List known authentication zones
153 "desc": "human-readable description",
154 "allow-passwd": integer, # Does the zone support passwords?
155 "allow-tokens": integer, # Does the zone support auth tokens?
156 "allow-passwd-auth": integer, # Does the zone support password authentication for account management?
157 "max-temp-validity": seconds # Maximum validity of temp tokens
158 # (if no temp tokens supported)