Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolab API V1 #850

Merged
merged 137 commits into from
Apr 18, 2018
Merged
Changes from 1 commit
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
0aa1e09
add doorkeeper to gemfile
zyx-billy Feb 11, 2017
1709112
install and configure doorkeeper
zyx-billy Feb 11, 2017
4e9f9d0
update database for doorkeeper
zyx-billy Feb 11, 2017
15793eb
add v1 base api controller
zyx-billy Feb 11, 2017
5219a3e
add first version of courses api controller
zyx-billy Feb 11, 2017
a6e3d4d
Finalize doorkeeper configuration:
zyx-billy Feb 11, 2017
f17f500
implement api error handling
zyx-billy Feb 15, 2017
76aa55c
extend course index method with optional state param
zyx-billy Feb 15, 2017
0f7fbdf
limit course attributes in response
zyx-billy Feb 15, 2017
e01c667
implement cud and course check for api routes
zyx-billy Feb 19, 2017
f2302b0
add user auth_level to response
zyx-billy Feb 19, 2017
09f501f
implement assessment index endpoint
zyx-billy Feb 19, 2017
a81e2c8
implement user info endpoint
zyx-billy Feb 19, 2017
60caaf6
add has_autograder field to assessment response
zyx-billy Feb 19, 2017
cb48b3a
Implement submissions index endpoint
zyx-billy Feb 23, 2017
50b3c5e
implement assessment problems endpoint
zyx-billy Feb 23, 2017
4290e85
fix type issue
zyx-billy Mar 22, 2017
8083c43
add custom 404 handler that returns json
zyx-billy Mar 22, 2017
b1b2edf
implement submission feedback endpoint
zyx-billy Mar 22, 2017
9329ca2
prepare submission endpoint
zyx-billy Mar 31, 2017
bc13b03
refactor handin helpers into separate helper
zyx-billy Mar 29, 2017
aaea17d
refactor autograde helpers into separate helper
zyx-billy Mar 29, 2017
42a4a27
switch to using more expressive error_codes/hashes
zyx-billy Mar 31, 2017
add2fac
fix return values
zyx-billy Mar 31, 2017
78d35ff
set response to json always
zyx-billy Apr 5, 2017
dde8994
remove symbolize_keys hack
zyx-billy Apr 5, 2017
6a80bf1
initial testing framework
zyx-billy Feb 15, 2017
8f908ac
add course index test
zyx-billy Apr 5, 2017
a8b8569
add user info endpoint test
zyx-billy Apr 5, 2017
dc3d2a7
add assessments test
zyx-billy Apr 5, 2017
beb55d6
add failure cases to course test
zyx-billy Apr 5, 2017
a6fd5ef
rename helpers to core
zyx-billy Apr 6, 2017
9943ab9
move batch submission logic into autograde core
zyx-billy Apr 6, 2017
ce5f848
add explanation for sendJob param
zyx-billy Apr 6, 2017
f0b0c0f
minor syntax error fix
zyx-billy Apr 6, 2017
501f287
make explicit autogradeSubmissions may raise errors
zyx-billy Apr 7, 2017
f295dd8
handle errors from autogradeSubmissions
zyx-billy Apr 7, 2017
d4944c9
give autogradeSubmissions a correct name
zyx-billy Apr 7, 2017
d88b449
update comment for handin handler function
zyx-billy Apr 7, 2017
26c3991
rename wrapper functions and add docs
zyx-billy Apr 7, 2017
c68e724
Merge branch 'generic_handin_and_autograde_helpers' into api_v1
zyx-billy Apr 12, 2017
d6debe7
implement submit endpoint to allow submission over api
zyx-billy Apr 12, 2017
4dc2b4b
implement assessment writeup endpoint
zyx-billy Apr 12, 2017
9927c83
use respond_with_hash in submit endpoint
zyx-billy Apr 12, 2017
7a5f8b8
implement assessment handout endpoint
zyx-billy Apr 12, 2017
69cc61b
configure scopes with doorkeeper
zyx-billy Apr 12, 2017
01d66a1
set scope requirements for each action
zyx-billy Apr 12, 2017
7aafc08
add rack-attack to gemfile
zyx-billy Apr 13, 2017
4a05914
initial rack-attack config
zyx-billy Apr 13, 2017
e297b5d
throttle using user id instead of ip
zyx-billy Apr 13, 2017
4b8b28f
Merge branch 'api_v1_throttle_using_rack-attack' into api_v1
zyx-billy Apr 13, 2017
d4d80bf
import doorkeeper views
zyx-billy Apr 19, 2017
f3b6091
modify authorized applications page
zyx-billy Apr 19, 2017
ac09841
modify authorization page
zyx-billy Apr 19, 2017
8fe7e1a
Merge branch 'api_v1_test' into api_v1
zyx-billy Apr 26, 2017
e67b838
update rspec tests to include scopes
zyx-billy Apr 26, 2017
e1a7d1c
add nonexistent course test
zyx-billy Apr 26, 2017
0bda2f2
make tests DRY with shared_context
zyx-billy Apr 26, 2017
507ee8e
add assessment#submit endpoint tests
zyx-billy May 3, 2017
89aaef0
handle cases where file param missing from submission
zyx-billy May 3, 2017
9adfbbd
More descriptive error messages for unexpected errors
zyx-billy May 3, 2017
dffe042
add roundtrip test for submission over api
zyx-billy May 4, 2017
5cf0ad5
install webmock
zyx-billy May 16, 2017
91475d6
implement device flow routes
zyx-billy Aug 15, 2017
f38628e
implement rate limiting for device_flow routes
zyx-billy Aug 15, 2017
c6d17a6
create db tables
zyx-billy Aug 15, 2017
f79b03e
add manage applications link to manage_autolab page
zyx-billy Dec 25, 2017
47171bb
remove non-null requirements on user id and resolved_at columns
zyx-billy Dec 26, 2017
5afc2df
create activerecord model for device_flow_requests
zyx-billy Dec 26, 2017
d6c621f
implement device_flow_init
zyx-billy Dec 26, 2017
b2cd329
implement device_flow_authorize
zyx-billy Dec 27, 2017
caf113d
add field for access_code in device_flow table
zyx-billy Dec 28, 2017
1dfd6b2
fix private method calling issue
zyx-billy Dec 28, 2017
77d4ecd
device_flow issues access_code instead of token
zyx-billy Dec 28, 2017
02ee76c
implement device_flow activation pages and endpoints
zyx-billy Dec 28, 2017
53934ab
implement tests for device_flow api endpoints
zyx-billy Dec 28, 2017
671c7bb
Merge branch 'device_flow' into api_v1
zyx-billy Dec 28, 2017
8228f9a
add column to record submitter application in submissions table
zyx-billy Dec 28, 2017
cad4c01
update roundtrip test to test for submitted_by_app_id attribute
zyx-billy Dec 28, 2017
b7b79fd
store submitter app id during submission
zyx-billy Dec 28, 2017
7f385db
update submissions api controller to filter by submitter app_id
zyx-billy Dec 28, 2017
59513d5
implement mock for tango open
zyx-billy Dec 31, 2017
ac8e0df
rack-attack handle access_token not found
zyx-billy Dec 31, 2017
e0cd3f2
fix activation page form bug
zyx-billy Dec 31, 2017
f0aba3c
add instructor and admin scopes
zyx-billy Jan 2, 2018
5a5e7c3
add api-related links to user account page
zyx-billy Jan 2, 2018
5714a46
implement course#create route
zyx-billy Jan 2, 2018
fcc5c2c
implement tests for course#create route
zyx-billy Jan 2, 2018
3886d04
Merge branch 'develop' into api_v1
zyx-billy Jan 3, 2018
f5d6e70
fix getting message from error
zyx-billy Jan 3, 2018
b9cc787
set assessment dates to make sure they can be submitted to in test cases
zyx-billy Jan 3, 2018
b018494
create logger
zyx-billy Jan 3, 2018
a408b2e
finish tango_mock
zyx-billy Jan 3, 2018
e2a0076
use tango_mock in roundtrip test
zyx-billy Jan 3, 2018
71c2dc1
Merge branch 'use_webmock' into api_v1
zyx-billy Jan 3, 2018
aa88620
use tango_mock in assessment controller test
zyx-billy Jan 3, 2018
3438e7a
extract vars used for handin-related tests into separate context
zyx-billy Jan 3, 2018
77f3a9d
run api tests in travis
zyx-billy Jan 3, 2018
bcdc82c
remove request_stubs after each test case
zyx-billy Jan 3, 2018
c99bd31
allow all unstubbed network requests
zyx-billy Jan 3, 2018
5b8111a
only count released asmts in test
zyx-billy Jan 3, 2018
ecb8d3b
streamline responses on success
zyx-billy Jan 4, 2018
d561eb8
add verification uri to device_flow_init response
zyx-billy Jan 4, 2018
dd6550e
do not return handout and writeup with each assessment
zyx-billy Jan 4, 2018
7efa53e
do not return visible_at with each assessment
zyx-billy Jan 4, 2018
f8e51f8
return error json for rate-limited responses
zyx-billy Jan 5, 2018
020706b
create assessment#show path, and refactor assessment#index
zyx-billy Jan 13, 2018
04419ac
don't return error when handout or writeup non-existent
zyx-billy Jan 13, 2018
429f90c
add version number to footer
zyx-billy Jan 24, 2018
8a28fca
Merge branch 'version_number_in_footer' into api_v1
zyx-billy Jan 24, 2018
79fd034
streamline privilege checking
zyx-billy Feb 22, 2018
3ffa9b4
add course_user_data index route
zyx-billy Feb 23, 2018
acf4ce3
add tests for course_user_data index route
zyx-billy Feb 23, 2018
c509592
implement cud create route
zyx-billy Feb 23, 2018
483009c
add tests for cud create route
zyx-billy Feb 23, 2018
3a81de8
update cud test cases to use correct http method
zyx-billy Feb 23, 2018
011866a
implement cud update route
zyx-billy Feb 23, 2018
019e334
add tests for cud update route
zyx-billy Feb 23, 2018
e1f02bb
implement cud destroy route
zyx-billy Feb 23, 2018
26fd0d5
add tests for cud destroy route
zyx-billy Feb 23, 2018
204eb49
implement cud show route
zyx-billy Feb 23, 2018
39acac1
add tests for cud show route
zyx-billy Feb 23, 2018
140c7f9
streamline data setting in cud routes
zyx-billy Feb 24, 2018
f32e62f
add grade_policy to cud response
zyx-billy Feb 24, 2018
ca8a84b
modify error description for invalid scope
zyx-billy Feb 24, 2018
5618744
allow periods in cud email param
zyx-billy Feb 25, 2018
0241664
turn off browser autocomplete on the activation form
zyx-billy Feb 25, 2018
99e3a34
fix activation page not returning after redirect
zyx-billy Feb 25, 2018
6f9b28d
update new authorization page icon
zyx-billy Feb 25, 2018
1ad20b9
Merge branch 'develop' into api_v1
zyx-billy Feb 26, 2018
617b5cc
set loggers in api_base
zyx-billy Feb 27, 2018
7a798c5
handle disabled course
zyx-billy Feb 28, 2018
9db8216
clarify autograding failure message
zyx-billy Feb 28, 2018
c94abf2
allow specifying start and end dates for course create
zyx-billy Mar 9, 2018
89ed5b7
better error messages for course create
zyx-billy Mar 9, 2018
3a9513e
make course create route consistent with CRUD
zyx-billy Mar 9, 2018
8be09b9
fix rate limit error response
zyx-billy Apr 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix activation page not returning after redirect
  • Loading branch information
zyx-billy committed Feb 25, 2018
commit 99e3a34537384ba6a45765a987486b31588e718d
8 changes: 4 additions & 4 deletions app/controllers/device_flow_activation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def index
def resolve
if not params.has_key?(:user_code)
flash[:error] = "User code missing. Please enter user code."
redirect_to(action: :index)
redirect_to(action: :index) && return
end

req = OauthDeviceFlowRequest.find_by(user_code: params[:user_code])
if req.nil?
flash[:error] = "Invalid user code."
redirect_to(action: :index)
redirect_to(action: :index) && return
end

# update user_code to a new random string as identifier for after
Expand All @@ -45,12 +45,12 @@ def authorization_callback
# encountered error
req.deny_request(current_user.id)
flash[:error] = "Access denied by user"
redirect_to(action: :index)
redirect_to(action: :index) && return
end

# no error, store access_code
req.grant_request(current_user.id, params[:code])
flash[:success] = "Access granted"
redirect_to(action: :index)
redirect_to(action: :index) && return
end
end