Skip to content

Commit 394e6fc

Browse files
committed
Begin chapter 1
1 parent 37e284a commit 394e6fc

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

chapters/01Introduction.tex

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
\chapter{Introduction}
2+
\section{Using the URLs}
3+
4+
Except for noted exceptions, URLs documented in the functions below are suffixes of the following URL, which points to the secure resources of Starexec.
5+
\\\url{https://www.starexec.org/starexec/secure/}\\
6+
7+
The largest exception to this is that all URLs that begin with ?services? do not have the ?secure? prefix. So, any URL that begins with services/ is a suffix of the following URL.
8+
\\\url{https://www.starexec.org/starexec/}\\
9+
10+
Other exceptions are noted where applicable in the function documentation.
11+
12+
13+
\section{Logging In}
14+
15+
To be able to access Starexec resources, you will need to log into Starexec and maintain a secure channel. Logging in is a multistep protocol, with 3 main steps. First, authorization works on a challenge-based system, which means you cannot log in until you request a secure resource. Next, you must provide your username and password, and finally, you will access a secure resource.
16+
17+
\subsection{First Step -- Requesting a Secure Resource}
18+
19+
\begin{description}
20+
\item [URL] index.jsp
21+
\item [Method] GET
22+
\item [Parameter Encoding] N/A
23+
\item [Returns] The login page
24+
\item [Return Cookies] \
25+
26+
\begin{description}
27+
\item [JSESSIONID] \type{Integer} On success, contains a session ID that you will need to use in later steps.
28+
\end{description}
29+
\end{description}
30+
31+
\subsection{Second Step -- Providing Login Credentials}
32+
33+
\begin{description}
34+
\item [URL] j\_security\_check
35+
\item [Method] POST
36+
\item [Parameter Encoding] application/x-www-form-urlencoded
37+
\item [Parameters] \
38+
\begin{description}
39+
\item [j\_username] \type{String} Your username
40+
\item [j\_password] \type{String} Your password
41+
\item [cookieexists] \type{Boolean} Should be set to false for web API calls
42+
\end{description}
43+
44+
\item [Description] Logs you into Starexec. You must provide the JSESSIONID you acquired in the previous steps.
45+
\item [Returns] A jSON string containing a status object
46+
\end{description}
47+
48+
\subsection{Third Step -- Accessing Secure Resources}
49+
50+
\begin{description}
51+
\item [URL] index.jsp
52+
\item [Method] GET
53+
\item [Parameter Encoding] N/A
54+
\item [Returns] The login page
55+
\item [Return Cookies] \
56+
\begin{description}
57+
\item [JSESSIONID] \type{Integer} On success, contains a new session ID. You must begin using this new session ID for all subsequent interactions.
58+
\end{description}
59+
\end{description}
60+
61+
\section{Maintaining a Session}
62+
After you have logged in, you must maintain a session for as long as you want to make requests to the secure resources of Starexec. To maintain a session, your HTTP requests should have the following header keys with the appropriate values.
63+
64+
\begin{description}
65+
\item [Cookie] \type{String} Should contain a string of the form ``killmenothing; JSESSIONID=" + your JSESSIONID obtained when logging in.
66+
\item [Connection] \type{String} Should be ``keep-alive"
67+
\item [Accept-Language] \type{String} Should be ``en-US,en;q=0.5"
68+
\end{description}
69+
70+
\section{Permissions}
71+
72+
Several functions below accept all of the following permissions parameters.
73+
74+
\begin{description}
75+
\item [addBench] \type{Boolean} Whether default permissions for this space should include adding benchmarks
76+
\item [addJob] \type{Boolean} Whether default permissions for this space should include adding jobs
77+
\item [addSolver] \type{Boolean} Whether default permissions for this space should include adding solvers
78+
\item [addSpace] \type{Boolean} Whether default permissions for this space should include adding spaces
79+
\item [addUser] \type{Boolean} Whether default permissions for this space should include adding users
80+
\item [removeBench] \type{Boolean} Whether default permissions for this space should include removing benchmarks
81+
\item [removeJob] \type{Boolean} Whether default permissions for this space should include removing jobs
82+
\item [removeSolver] \type{Boolean} Whether default permissions for this space should include removing solvers
83+
\item [removeSpace] \type{Boolean} Whether default permissions for this space should include removing spaces
84+
\item [removeUser] \type{Boolean} Whether default permissions for this space should include removing users
85+
\item [isLeader] \type{Boolean} Whether the a user should be a leader or not.
86+
\end{description}

0 commit comments

Comments
 (0)