-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added avatar to API definition for users
- Loading branch information
Ralf Wilke
committed
Nov 5, 2018
1 parent
5d75b43
commit 4c10451
Showing
1 changed file
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,7 +235,7 @@ \subsubsection{GET /users/<username>} | |
Send \verb|403 Forbidden|. | ||
|
||
|
||
\subsubsection{GET /users/\_usernames} | ||
\subsubsection{GET /users/<usernames} | ||
\label{protocoldef:microservicesapi:database:getusers/_usernames} | ||
|
||
\begin{table}[htbp] | ||
|
@@ -255,6 +255,25 @@ \subsubsection{GET /users/\_usernames} | |
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
\subsubsection{GET /users/<username>/avatar.jpg} | ||
\label{protocoldef:microservicesapi:database:getusers/username/avatar.jpg} | ||
|
||
\begin{table}[htbp] | ||
\begin{tabular}{|l|p{12cm}|} \hline | ||
Item & Description \\ \hline \hline | ||
Description & Return the attachment called avatar.jpg for the given user \\ \hline | ||
Permission & \verb|user.list| \\ \hline | ||
Mapping to CouchDB & \verb|GET /users/<username>/avatar.jpg|\\ \hline | ||
\end{tabular} | ||
\end{table} | ||
|
||
\textbf{Auth response: \texttt{true}:} | ||
Get image with Content-Type: image/jpeg | ||
|
||
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
|
||
\newpage | ||
\subsubsection{PUT /users - Add new user} | ||
\label{protocoldef:microservicesapi:database:putusers/username_create} | ||
|
@@ -373,6 +392,25 @@ \subsubsection{PUT /users - Edit existing user} | |
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
\subsubsection{PUT /users/<username>/avatar.jpg} | ||
\label{protocoldef:microservicesapi:database:putusers/username/avatar.jpg} | ||
|
||
\begin{table}[htbp] | ||
\begin{tabular}{|l|p{12cm}|} \hline | ||
Item & Description \\ \hline \hline | ||
Description & Set the attachment called avatar.jpg for the given user \\ \hline | ||
Permission & \verb|user.list| \\ \hline | ||
Mapping to CouchDB & \verb|PUT /users/<username>/avatar.jpg|\\ \hline | ||
Content in body & Image as raw bytes \\ \hline | ||
\end{tabular} | ||
\end{table} | ||
|
||
\textbf{Auth response: \texttt{true}:}\\ | ||
Transparent forwarding. | ||
|
||
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
|
||
\subsubsection{DELETE /users/<username>?rev=<rev>} | ||
\label{protocoldef:microservicesapi:database:deleteusers} | ||
|
@@ -382,6 +420,25 @@ \subsubsection{DELETE /users/<username>?rev=<rev>} | |
Item & Description \\ \hline \hline | ||
Description & Delete user <username>\\ \hline | ||
Permission & \verb|user.delete/<username>| \\ \hline | ||
Mapping to CouchDB & \verb|DELETE /users/<username>/avatar.jpg?rev=<rev>|\\ \hline | ||
Mandatory fields & \verb|rev| as parameter (\verb|rev| has to be obtained as in \ref{protocoldef:microservicesapi:database:getusers/username})\\ \hline | ||
\end{tabular} | ||
\end{table} | ||
|
||
\textbf{Auth response: \texttt{true}:}\\ | ||
Transparent forwarding. | ||
|
||
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
\subsubsection{DELETE /users/<username>/avatar.jpg?rev=<rev>} | ||
\label{protocoldef:microservicesapi:database:deleteuser/avatar.jpg} | ||
|
||
\begin{table}[htbp] | ||
\begin{tabular}{|l|p{12cm}|} \hline | ||
Item & Description \\ \hline \hline | ||
Description & Delete the attachment called avatar.jpg for the given user\\ \hline | ||
Permission & \verb|user.delete/<username>| \\ \hline | ||
Mapping to CouchDB & \verb|DELETE /users/<username>?rev=<rev>|\\ \hline | ||
Mandatory fields & \verb|rev| as parameter (\verb|rev| has to be obtained as in \ref{protocoldef:microservicesapi:database:getusers/username})\\ \hline | ||
\end{tabular} | ||
|
@@ -393,6 +450,7 @@ \subsubsection{DELETE /users/<username>?rev=<rev>} | |
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\ | ||
Send \verb|403 Forbidden|. | ||
|
||
|
||
\newpage | ||
\subsubsection{GET /nodes} | ||
\label{protocoldef:microservicesapi:database:getnodes} | ||
|
@@ -3178,7 +3236,7 @@ \subsubsection{Node related} | |
} | ||
\end{lstlisting} | ||
|
||
|
||
\newpage | ||
\section{CouchDB Documents and Structure} | ||
\todo{als Tabelle darstellen} | ||
|
||
|
@@ -3210,13 +3268,21 @@ \subsection{Users} | |
"_id": "dl1abc", | ||
"password": "<bcrypt hash>", | ||
"email": "[email protected]", | ||
"roles": "admin", | ||
"roles": ["admin"], | ||
"enabled": true, | ||
"created_on": "2018-07-03T08:00:52.786458Z", | ||
"created_by": "dh3wr", | ||
"changed_on": "2018-07-03T08:00:52.786458Z", | ||
"changed_by":"dh3wr", | ||
"email_lastchecked": "2018-07-03T08:00:52.786458Z", | ||
"defaults": { | ||
"subscribers": ["dh3wr",...], | ||
"subscriber\_groups": [...], | ||
"transmitters": [...], | ||
"transmitter\_groups": [...], | ||
"expiration\_duration": 120, | ||
"priority" : 1 to 5 | ||
} | ||
"avatar_picture": <couchdb attachment> | ||
} | ||
\end{lstlisting} | ||
|