Fossil

JSON API: /user
Login

(⬑JSON API Index)

Jump to:


Get User Info

Status: implemented 20110927.

Required privileges: "a" or "s"

Request:

Response payload example:

{
  "uid":1,
  "name":"stephan",
  "capabilities":"abcdefhgijkmnopqrstuvwxz",
  "info":"https://wanderinghorse.net/home/stephan/",
  "timestamp":1316122562
}

(What does that timestamp field represent, anyway?)

List Users

Status: implemented 20110927.

Required privileges: "a" or "s"

Request: /json/user/list

Response payload example:

[
 {
  "uid":1,
  "name":"stephan",
  "capabilities":"abcdefhgijkmnoprstuvwxz",
  "info":"",
  "timestamp":1316122562
 },
 ... more users...
]

Save User

Only admin/setup users may modify accounts other than their own.

Status: implemented 20111021 but it is missing "login group" support, so changes do not yet propagate to other repos within a group.

Required privileges: 'p' or 'a' or 's', depending on the context.

Request: /json/user/save

All request options must come from the POST.payload and/or GET/CLI parameters (exception: "name" must come from POST.payload or CLI). GET/CLI parameters take precedence over those in POST.payload, the intention being to use an input file as a template and overriding the template's defaults via the CLI. The options include:

Fields which are not provided in the request will not be modified. Non-admin/setup users cannot edit other users and may only change their own data if they have the 'p' (password) privilege.

As of 20120217, users who do not have the setup privilege may neither change the setup privilege for any user nor edit another user who has that privilege. That is, only users with setup access may propagate or remove setup status and accounts with the setup privilege may only be edited by themselves and other setup users.

Response payload: Same as user/get, using the new/saved state of the modified user.

Example usage from the command line:

$ fossil json user save --name drh --password sqlite3 \
 --capabilities "as" --info "DRH"
$ fossil json user save --uid 1 --name richard \
 --password fossil \
 --info "Previously known as drh"

Warnings:

TODOs: