Skip to content

Commit 3ba0eeb

Browse files
authored
Merge pull request #58 from LibreSign/chore/reorganize-developer-content-structure
Chore/reorganize developer content structure
2 parents ef8cb44 + 291b399 commit 3ba0eeb

28 files changed

+616
-718
lines changed

developer_manual/api/guide-api.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
API Usage
2+
=========
3+
4+
LibreSign exposes endpoints via **REST** and **OCS (Open Collaboration Services)**.
5+
6+
By default, all requests require authentication (Basic Auth, App Password, OIDC, or session cookies) and return JSON responses.
7+
8+
Base URLs
9+
---------
10+
11+
- **OCS**: ``https://cloud.example.com/ocs/v2.php/apps/libresign/api/v1/``
12+
13+
**Versioning**: breaking changes result in a new major version (e.g., ``v2``).
14+
15+
Authentication
16+
--------------
17+
18+
Supported methods:
19+
20+
- **Basic Auth** (App Password or Username/Password)
21+
- **OIDC Access Token** (``Authorization: Bearer <ACCESS_TOKEN>``)
22+
- **Session cookies** (for non-OCS endpoints, may require CSRF token)
23+
24+
.. note::
25+
Prefer using an **App Password** for Basic Auth. For OIDC, use **Access Tokens**.
26+
27+
.. note::
28+
Use an application password instead of your regular password.
29+
Besides improved security, this also improves performance.
30+
31+
To configure one:
32+
33+
- log into the Nextcloud Web interface
34+
- click on your avatar,
35+
- select *Personal settings*, then *Security*.
36+
- At the bottom of the page you can create an app password, which can also be revoked later without changing your main password.
37+
38+
Basic Auth (App Password)
39+
~~~~~~~~~~~~~~~~~~~~~~~~~
40+
41+
.. code-block:: bash
42+
43+
curl -sS -u "username:app-password" \
44+
-H "Accept: application/json" \
45+
-H "OCS-APIRequest: true" \
46+
"https://cloud.example.com/ocs/v2.php/apps/libresign/api/v1/..."
47+
48+
OIDC (Access Token)
49+
~~~~~~~~~~~~~~~~~~~
50+
51+
`Read more <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization/>`__
52+
53+
.. code-block:: bash
54+
55+
curl -sS \
56+
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
57+
-H "Accept: application/json" \
58+
-H "OCS-APIRequest: true" \
59+
"https://cloud.example.com/ocs/v2.php/apps/libresign/api/v1/..."
60+
61+
Clients
62+
-------
63+
64+
- Requests with a body (:code:`POST`, :code:`PUT`, :code:`PATCH`) must include ``Content-Type: application/json``.
65+
66+
CURL
67+
~~~~
68+
69+
All OCS requests can be tested with :code:`curl` by specifying the request method (:code:`GET`, :code:`POST`, :code:`PATCH`, etc.) and the required headers.
70+
71+
Example:
72+
73+
.. code-block:: bash
74+
75+
curl --request POST \
76+
--url http://cloud.example.com/apps/libresign/api/v1/request-signature \
77+
--header 'Authorization: Basic <base64-credentials>' \
78+
--header 'Content-Type: application/json' \
79+
--data '{
80+
"file": {
81+
"url": "https://example.com/test.pdf"
82+
},
83+
"status": 0,
84+
"name": "Contract",
85+
"users": [
86+
{
87+
"email": "[email protected]"
88+
"displayName": "User Name"
89+
}
90+
]
91+
}'

developer_manual/api/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=================
2+
API Documentation
3+
=================
4+
5+
.. toctree::
6+
:maxdepth: 2
7+
8+
guide-api
9+
openapi
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
API
2-
===
1+
OCS OpenAPI
2+
===========
33

44
.. raw:: html
55

developer_manual/code-of-conduct.rst

Lines changed: 0 additions & 96 deletions
This file was deleted.

developer_manual/commits.rst

Lines changed: 0 additions & 133 deletions
This file was deleted.

developer_manual/branch-policies.rst renamed to developer_manual/getting-started/branch-policies.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Branch policies
33

44
This document describes the branching model used in LibreSign and how contributions should be targeted.
55

6-
Branch Names
6+
Branch names
77
------------
88

99
Main
@@ -42,7 +42,7 @@ Stable branches maintain release lines compatible with a specific **Nextcloud Se
4242
In LibreSign, ``min-version`` and ``max-version`` are always the same number.
4343
This number is the MAJOR version of the compatible Nextcloud Server.
4444

45-
Target Branches for Contributions
45+
Target branches for contributions
4646
---------------------------------
4747

4848
- **New features / improvements**:
@@ -61,18 +61,18 @@ Target Branches for Contributions
6161
- Create a branch from that stable branch.
6262
- Open a PR to the same stable branch.
6363

64-
Bugfixes and Backports
64+
Bugfixes and backports
6565
----------------------
6666
If a bug fix also needs to be applied to an older release line, it must be **backported**.
6767
Backporting means applying the same change to another branch (Git calls this *cherry-picking*).
6868

69-
Automatic Backport
69+
Automatic backport
7070
^^^^^^^^^^^^^^^^^^
7171
If the cherry-pick applies cleanly and only small conflicts need to be resolved, the `backport bot <https://github.com/nextcloud/backportbot>`_ can be used.
7272

7373
See the `bot usage <https://github.com/nextcloud/backportbot#usage>`_ for available commands.
7474

75-
Manual Backport
75+
Manual backport
7676
^^^^^^^^^^^^^^^
7777
For more complex changes, the backport must be done manually:
7878

@@ -93,6 +93,6 @@ For more complex changes, the backport must be done manually:
9393
9494
# Open a pull request for the backport
9595
96-
Creating Branch
96+
Creating branch
9797
---------------
9898
Follow the convention of naming branches as ``feature/description`` or ``bugfix/description``.

0 commit comments

Comments
 (0)