Skip to content

Commit

Permalink
Added avatar to API definition for users
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Wilke committed Nov 5, 2018
1 parent 5d75b43 commit 4c10451
Showing 1 changed file with 69 additions and 3 deletions.
72 changes: 69 additions & 3 deletions 6_Protocol_Definitions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -3178,7 +3236,7 @@ \subsubsection{Node related}
}
\end{lstlisting}


\newpage
\section{CouchDB Documents and Structure}
\todo{als Tabelle darstellen}

Expand Down Expand Up @@ -3210,13 +3268,21 @@ \subsection{Users}
"_id": "dl1abc",
"password": "<bcrypt hash>",
"email": "dl1abc@darc.de",
"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}
Expand Down

0 comments on commit 4c10451

Please sign in to comment.