Commit Graph

23 Commits

Author SHA1 Message Date
Landon Wilkins c5b5cc786d da licença part 53
add consistent license headers to all source files

Change-Id: I405d2def01ad68c76533b9254983497485cd7073
Reviewed-on: https://gerrit.instructure.com/110160
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:06:11 +00:00
Jon Jensen be84615841 bump simplecov, fixes SD-2056
test plan:
see coverage in previous rspec/selenium builds, same numbers as before

Change-Id: I331bf5102914da00a5d350f32b74b4bc9d49c5f8
Reviewed-on: https://gerrit.instructure.com/106895
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2017-04-04 18:06:25 +00:00
Simon Williams 359c6dea13 upgrade many canvas gems to rspec 3 syntax
as of this commit, all canvas gems should be on rspec 3.5, and pass
without deprecation warnings.

closes CNVS-34040

test plan: specs should pass without deprecation warnings

Change-Id: I556b1a4a5aeb791c6ddd50ee35b51c513e025019
Reviewed-on: https://gerrit.instructure.com/98414
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-12-27 18:44:23 +00:00
Cody Cutrer f552f4fc00 simplify gem test harnesses
rely on test_all_gems.sh to output header and trailer,
and use `set -e` in each test.sh to simplify passing
through errors

Change-Id: I3ba724ad2539ddfe31195394c43f646acfc73920
Reviewed-on: https://gerrit.instructure.com/70469
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-19 17:52:58 +00:00
Jacob Fugal 371ec30967 refactor CSRF handling for clarity and rails3+
closes CNVS-18870

CNVS-18870 as described in the ticket description is not a bug. see
comments on the ticket for more details. but while investigating and
confirming that, it became obvious that the odd structure and scattered
implementation of the CSRF protection was both making it hard to reason
about and easy to introduce new bugs. after the refactor, we still:

* don't perform CSRF validation on GET requests
* don't perform it on token-authenticated API requests
* do perform it on session-authenticated API requests
* do perform it on non-API requests regardless of authentication method

additionally, we now:

* don't perform CSRF validation on HEAD requests

finally, we _don't_ support a csrf_token in the session anymore. that's
been deprecated forever; we can remove the code now.

test-plan:
 - should not perform CSRF validation for:
   - GET requests
   - token-authenticated POST requests to API endpoints (path prefixed
     by /api/) without an authenticity_token parameter or X-CSRF-Token
     header
   - token-authenticated POST requests to API endpoints even with an
     authenticity_token parameter
   - token-authenticated POST requests to API endpoints even with an
     X-CSRF-Token header

 - should perform CSRF validation for:
   - POST requests to non-API endpoints
   - session-authenticated POST requests to API endpoints

 - when CSRF validation should occur, but the user has cookies off:
   - POST requests to non-API endpoints should redirect to a "need
     cookies" page
   - XHR POST requests to non-API endpoints should not redirect
   - POST requests to API endpoints should not redirect

Change-Id: I3dbb3a68623bc9d03a3e744a9d4e1f038a32709c
Reviewed-on: https://gerrit.instructure.com/65103
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2016-01-11 23:31:47 +00:00
Shawn Meredith bebc309651 spec: simple_cov tweaks
Change-Id: Ib7db93b7ce5c877d2c0dcf24ee0d748f11ec58cb
Reviewed-on: https://gerrit.instructure.com/44806
Reviewed-by: Adam Ard <aard@instructure.com>
Product-Review: Adam Ard <aard@instructure.com>
QA-Review: Adam Ard <aard@instructure.com>
Tested-by: Adam Ard <aard@instructure.com>
2014-11-24 17:39:14 +00:00
Shawn Meredith e52ff14e2c spec: simple_cov tweaking
Change-Id: I0d870506404a384a335449ee3ffbc0750b425ea7
Reviewed-on: https://gerrit.instructure.com/44711
Reviewed-by: Adam Ard <aard@instructure.com>
Product-Review: Adam Ard <aard@instructure.com>
QA-Review: Adam Ard <aard@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-11-21 22:21:52 +00:00
Jacob Fugal fbda0f4344 use SSL-only flag on CSRF cookie
fixes CNVS-16884

test-plan:
 - in HTTP-session environment (`secure: false` or unset in
   config/session_store.yml), CSRF cookie should be sent without secure
   flag

 - in HTTPS-session environment (`secure: true` in
   config/session_store.yml), CSRF cookie should be sent with secure
   flag.

 - on a non-files host, javascript should be able to read the CSRF
   cookie: value of "document.cookie" in javascript console should
   include "_csrf_token"

 - on a files host, javascript should not be able to read the CSRF
   cookie: value of "document.cookie" in javascript console should not
   include "_csrf_token"

Change-Id: Ifd57c973478a6d07497a404dcf1a9b9caa9014af
Reviewed-on: https://gerrit.instructure.com/44451
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-11-19 23:18:37 +00:00
James Williams e45ff7189a use double-cookie csrf protection
test plan:
* in one tab, start to fill out an ajax form
 (e.g. editing a quiz)
* in another tab, log out of canvas
* return to the original tab and try to
 submit the form (e.g. save your changes)
* should get an error message with a link to
 login in a new tab
* login in the new tab
* return to the original, and try to resubmit
* should save successfully

closes #CNVS-3957 #CNVS-13673

Change-Id: I7758514de8ce09361fef469034645d8a29e2a5e5
Reviewed-on: https://gerrit.instructure.com/40396
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2014-09-23 15:29:03 +00:00
Paul Hinze 071d6d8a96 align rspec version in gems with parent
update spec_helpers to fix deprecation warning after upgrade

Change-Id: I31b370d1d60f73d5256c69a8d5e69418657f880d
Reviewed-on: https://gerrit.instructure.com/39144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
2014-08-12 22:27:39 +00:00
Cody Cutrer 92ea7c5be5 bundle check before bundle install for gem tests
they're likely already installed, and it will save a ton of trips
to rubygems.org

Change-Id: I9ccf2194619a6e8f97d7f21b4e232dac7ff20d3c
Reviewed-on: https://gerrit.instructure.com/35694
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 20:09:10 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
Simon Williams dc3b16f9bf add gem names to gem script runners
Change-Id: I0dad5345aae75e552af97f5b54ded10bbfebbe37
Reviewed-on: https://gerrit.instructure.com/33925
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2014-04-28 15:51:28 +00:00
Mark Severson a1fac754d2 extract i18n_tasks gem
fixes CNVS-11181

test plan:
 * i18n rake tasks still operate correctly

Change-Id: I261973a947ce28840d6817f5a931f5221192e8db
Reviewed-on: https://gerrit.instructure.com/31441
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-21 03:19:47 +00:00
Shawn Meredith 26090c0298 spec: simple_cov vendored_gems report merging
Change-Id: I2421119792dcd6f8b02618c9ecfb050e00a104bd
Reviewed-on: https://gerrit.instructure.com/31013
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-02-28 09:04:50 +00:00
Shawn Meredith 2f23ac7924 Revert "Revert "spec: vendored_gems coverage result merge with canvas""
This reverts commit 7c29516091.

Change-Id: I37c31c26dcb4456664714848a7b9cb12ab40a755
Reviewed-on: https://gerrit.instructure.com/30900
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
2014-02-27 07:34:24 +00:00
Shawn Meredith 7c29516091 Revert "spec: vendored_gems coverage result merge with canvas"
This reverts commit 19a27ae758.

Change-Id: Icd11deec1340057bf2a1fc541a9a7848d11d6b7e
Reviewed-on: https://gerrit.instructure.com/30881
Reviewed-by: Shawn Meredith <shawn@instructure.com>
Product-Review: Shawn Meredith <shawn@instructure.com>
QA-Review: Shawn Meredith <shawn@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
2014-02-26 17:43:38 +00:00
Shawn Meredith 19a27ae758 spec: vendored_gems coverage result merge with canvas
Change-Id: Ic2bd9a9045da4aa417f60b66ef08ca9d470ec2bb
Reviewed-on: https://gerrit.instructure.com/30829
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2014-02-26 08:11:20 +00:00
Shawn Meredith 420ec475de spec: vendor_gems test.sh result determination tweak
Change-Id: I68ca527f6e48e0305315d824aaf9a9625ecd8276
Reviewed-on: https://gerrit.instructure.com/30675
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-24 19:54:21 +00:00
Shawn Meredith 89b2072df3 spec: canvas rspec rake task for vendored_gems
Change-Id: I8aceb8e5aa2b95790eadca83725c8fd03bd28965
Reviewed-on: https://gerrit.instructure.com/30621
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-24 05:47:34 +00:00
Simon Williams 63830287ea don't use git to build vendored gem specification file list
fixes CNVS-11072

test plan: in a canvas repository without a .git directory (like a deploy) call
a bundle command (like script/console).  it should not give you warnings about
missing .git directories

Change-Id: I2daa1371d97c94f7c3db81d3fd2bad387fcabaf8
Reviewed-on: https://gerrit.instructure.com/29947
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-12 22:58:25 +00:00
Raphael Weiner 9044087ae1 use test.sh scripts for all gems
Change-Id: If97bbe476b8bf747e3b83bb7bf22783e2508da69
Reviewed-on: https://gerrit.instructure.com/29507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-04 22:23:57 +00:00
Raphael Weiner 55cf0246e8 convert breach migration plugin to proper gem and fix name
Change-Id: Ie26495b5ea3e09f31b6b80d643679fe94ca9816b
Reviewed-on: https://gerrit.instructure.com/29455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-01-30 22:55:31 +00:00