The background REST Service for renewing your UPass. It is currently hosted here
Your credentials are not logged and are encrypted using a public key and decrypted by the server using the accompanying private key.
- Java & JDK
- Process Variables:
PRIVATE_KEY
: The private key for your application (keep this safe)SECRET
: The secret key used to shutdown the job pool
gradle build
gradle bootRun
You will be able to find the server running at [https://localhost:8080]
Get the API version number
-
URL
/api
-
Method:
GET
-
Success Response:
- Code: 200
Content:{ version : 2 }
- Code: 200
Create a new renew job
-
URL
/api/renew
-
Method:
POST
-
URL Header Params
Required:
username=[string encrypted with public key]
password=[string encrypted with public key]
school=[string]
-
Data Params
None
-
Success Response:
- Code: 202 ACCEPTED
Content:{"status": "RUNNNING", "jobId": "7045f3a0-dbc4-40cc-bef8-88523afeedc9"}
OR
- Code: 208 ALREADY_REPORTED
Content:{ response : "Job already submitted" }
- Code: 202 ACCEPTED
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Username is encrypted incorrectly" }
OR
- Code: 401 UNAUTHORIZED
Content:{ error : "Password is encrypted incorrectly" }
- Code: 401 UNAUTHORIZED
-
Notes:
The jobId returned can be used to retrieve the status of the job later
Get the job status
-
URL
/api/get
-
Method:
GET
-
URL Header Params
Required:
id=[string]
-
Data Params
None
-
Success Response:
- Code: 200 OK
Content:{"status": "NOTHING_TO_RENEW", "jobId": "7045f3a0-dbc4-40cc-bef8-88523afeedc9"}
- Code: 200 OK
-
Error Response:
- Code: 400 BAD REQUEST
Content:{ error : "No Job found" }
- Code: 400 BAD REQUEST
Get the job status
-
URL
/api/shutdown
-
Method:
GET
-
URL Header Params
Required:
key=[string]
-
Data Params
None
-
Success Response:
- Code: 200 OK
Content:{"result": "Job pool shutdown"}
- Code: 200 OK
-
Error Response:
- Code: 403 FORBIDDEN
Content:{ error : "That is the incorrect key" }
- Code: 403 FORBIDDEN
-
Notes:
This is just in case the server goes out of memory
Your school credentials are stored locally on your phone, and your password is encrypted before being saved, so only RenewPass can see it.
- UBC
More schools are coming soon!
Pull requests and issues are welcome.
Huge shoutout to Coffeeboys for their Android App
The MIT License (MIT)
Copyright (c) 2017 Prayansh Srivastava
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.