Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
7643424b
Commit
7643424b
authored
Apr 10, 2024
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API documentation.
parent
cc38c530
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
README.API
README.API
+82
-0
No files found.
README.API
0 → 100644
View file @
7643424b
# Galene's administrative API
Galene provides an HTTP-based API that can be used to create groups and
users. For example, in order to create a group, a client may do
PUT /galene-api/0/.groups/groupname/
Content-Type: application/json
If-None-Match: *
The `If-None-Match` header avoids overwriting an existing group.
In order to edit a group definition, a client first does
GET /galene-api/0/.groups/groupname/
This yields the group definition and an entity tag (in the ETag header).
The client then modifies the group defintion, and does
PUT /galene-api/0/.groups/groupname/
If-Match: "abcd"
where "abcd" is the entity tag returned by the GET request. If the group
definition has changed in the meantime, the entity tag will no longer be
valid, and the server will fail the update, which avoids losing an update
in the case of a concurrent modification.
## Endpoints
The API is located under `/galene-api/0/`. The `/0/` is a version number,
and will be incremented if we ever find out that the current API cannot be
extended in a backwards compatible manner.
### Statistics
/galene-api/0/.stats
Provides a number of statistics about the running server, in JSON. The
exact format is undocumented, and may change between versions. The only
allowed methods are HEAD and GET.
### List of groups
/galene-api/0/.groups/
Returns a list of groups, as plain text, one per line. The only allowed
methods are HEAD and GET.
### Group definition
/galene-api/0/.groups/groupname
Contains a "sanitised" group definition in JSON format, analogous to the
on-disk format but without any user definitions or cryptographic keys.
Allowed methods are HEAD, GET, PUT and DELETE. The only accepted
content-type is `application/json`.
### List of users
/galene-api/0/.groups/groupname/.users/
Returns a list of users, as plain text, one per line. The only allowed
methods are HEAD and GET.
### User definition
/galene-api/0/.groups/groupname/.users/username
Contains a "sanitised" user definition (without any passwords), a JSON
object with a single field `permissions`. Allowed methods are HEAD, GET,
PUT and DELETE. The only accepted content-type is `application/json`.
### Passwords
/galene-api/0/.groups/groupname/.users/username/.password
Contains the password of a given user. The PUT method takes a full
password definition, identical to what can appear in the `"password"`
field of the on-disk format, while the POST method takes a string which
will be hashed on the server. Allowed methods are PUT, POST and DELETE.
Accepted content-types are `application/json` for PUT and `text/plain` for
POST.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment