Skip to content

Commit 4c10451

Browse files
author
Ralf Wilke
committed
Added avatar to API definition for users
1 parent 5d75b43 commit 4c10451

File tree

1 file changed

+69
-3
lines changed

1 file changed

+69
-3
lines changed

6_Protocol_Definitions.tex

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ \subsubsection{GET /users/<username>}
235235
Send \verb|403 Forbidden|.
236236

237237

238-
\subsubsection{GET /users/\_usernames}
238+
\subsubsection{GET /users/<usernames}
239239
\label{protocoldef:microservicesapi:database:getusers/_usernames}
240240

241241
\begin{table}[htbp]
@@ -255,6 +255,25 @@ \subsubsection{GET /users/\_usernames}
255255
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
256256
Send \verb|403 Forbidden|.
257257

258+
\subsubsection{GET /users/<username>/avatar.jpg}
259+
\label{protocoldef:microservicesapi:database:getusers/username/avatar.jpg}
260+
261+
\begin{table}[htbp]
262+
\begin{tabular}{|l|p{12cm}|} \hline
263+
Item & Description \\ \hline \hline
264+
Description & Return the attachment called avatar.jpg for the given user \\ \hline
265+
Permission & \verb|user.list| \\ \hline
266+
Mapping to CouchDB & \verb|GET /users/<username>/avatar.jpg|\\ \hline
267+
\end{tabular}
268+
\end{table}
269+
270+
\textbf{Auth response: \texttt{true}:}
271+
Get image with Content-Type: image/jpeg
272+
273+
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
274+
Send \verb|403 Forbidden|.
275+
276+
258277
\newpage
259278
\subsubsection{PUT /users - Add new user}
260279
\label{protocoldef:microservicesapi:database:putusers/username_create}
@@ -373,6 +392,25 @@ \subsubsection{PUT /users - Edit existing user}
373392
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
374393
Send \verb|403 Forbidden|.
375394

395+
\subsubsection{PUT /users/<username>/avatar.jpg}
396+
\label{protocoldef:microservicesapi:database:putusers/username/avatar.jpg}
397+
398+
\begin{table}[htbp]
399+
\begin{tabular}{|l|p{12cm}|} \hline
400+
Item & Description \\ \hline \hline
401+
Description & Set the attachment called avatar.jpg for the given user \\ \hline
402+
Permission & \verb|user.list| \\ \hline
403+
Mapping to CouchDB & \verb|PUT /users/<username>/avatar.jpg|\\ \hline
404+
Content in body & Image as raw bytes \\ \hline
405+
\end{tabular}
406+
\end{table}
407+
408+
\textbf{Auth response: \texttt{true}:}\\
409+
Transparent forwarding.
410+
411+
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
412+
Send \verb|403 Forbidden|.
413+
376414

377415
\subsubsection{DELETE /users/<username>?rev=<rev>}
378416
\label{protocoldef:microservicesapi:database:deleteusers}
@@ -382,6 +420,25 @@ \subsubsection{DELETE /users/<username>?rev=<rev>}
382420
Item & Description \\ \hline \hline
383421
Description & Delete user <username>\\ \hline
384422
Permission & \verb|user.delete/<username>| \\ \hline
423+
Mapping to CouchDB & \verb|DELETE /users/<username>/avatar.jpg?rev=<rev>|\\ \hline
424+
Mandatory fields & \verb|rev| as parameter (\verb|rev| has to be obtained as in \ref{protocoldef:microservicesapi:database:getusers/username})\\ \hline
425+
\end{tabular}
426+
\end{table}
427+
428+
\textbf{Auth response: \texttt{true}:}\\
429+
Transparent forwarding.
430+
431+
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
432+
Send \verb|403 Forbidden|.
433+
434+
\subsubsection{DELETE /users/<username>/avatar.jpg?rev=<rev>}
435+
\label{protocoldef:microservicesapi:database:deleteuser/avatar.jpg}
436+
437+
\begin{table}[htbp]
438+
\begin{tabular}{|l|p{12cm}|} \hline
439+
Item & Description \\ \hline \hline
440+
Description & Delete the attachment called avatar.jpg for the given user\\ \hline
441+
Permission & \verb|user.delete/<username>| \\ \hline
385442
Mapping to CouchDB & \verb|DELETE /users/<username>?rev=<rev>|\\ \hline
386443
Mandatory fields & \verb|rev| as parameter (\verb|rev| has to be obtained as in \ref{protocoldef:microservicesapi:database:getusers/username})\\ \hline
387444
\end{tabular}
@@ -393,6 +450,7 @@ \subsubsection{DELETE /users/<username>?rev=<rev>}
393450
\textbf{Auth response: \texttt{false} or \texttt{limited}:}\\
394451
Send \verb|403 Forbidden|.
395452

453+
396454
\newpage
397455
\subsubsection{GET /nodes}
398456
\label{protocoldef:microservicesapi:database:getnodes}
@@ -3178,7 +3236,7 @@ \subsubsection{Node related}
31783236
}
31793237
\end{lstlisting}
31803238

3181-
3239+
\newpage
31823240
\section{CouchDB Documents and Structure}
31833241
\todo{als Tabelle darstellen}
31843242

@@ -3210,13 +3268,21 @@ \subsection{Users}
32103268
"_id": "dl1abc",
32113269
"password": "<bcrypt hash>",
32123270
"email": "dl1abc@darc.de",
3213-
"roles": "admin",
3271+
"roles": ["admin"],
32143272
"enabled": true,
32153273
"created_on": "2018-07-03T08:00:52.786458Z",
32163274
"created_by": "dh3wr",
32173275
"changed_on": "2018-07-03T08:00:52.786458Z",
32183276
"changed_by":"dh3wr",
32193277
"email_lastchecked": "2018-07-03T08:00:52.786458Z",
3278+
"defaults": {
3279+
"subscribers": ["dh3wr",...],
3280+
"subscriber\_groups": [...],
3281+
"transmitters": [...],
3282+
"transmitter\_groups": [...],
3283+
"expiration\_duration": 120,
3284+
"priority" : 1 to 5
3285+
}
32203286
"avatar_picture": <couchdb attachment>
32213287
}
32223288
\end{lstlisting}

0 commit comments

Comments
 (0)