This repository has been archived by the owner on Aug 12, 2018. It is now read-only.
forked from 401ChemistryGenealogy/ChemistryGenealogy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
2,163 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
app/lib/search.rb 009de4b8a28901f2c7436495a4abbcb1db1dfc69 | ||
app/lib/search.rb 641aeb729fc6e5e1f4e9c317afc48f37b52f4a5a | ||
app/models/user.rb d3c9dedf945d625674077a30bf2f2cbb6409fdb1 | ||
app/lib/deleter.rb 35ea32167a4221c52c9149b7e3babebcef121db2 | ||
app/lib/find_id.rb aa8bfd0ed4df0e35548d78d0bd7ffd8ed49f61a4 | ||
app/models/admin.rb 619c9860fd009f905a3c46c3d0d97d9fc7aa1e62 | ||
app/lib/notifier.rb 4dbd59e8d0f0ba3a4688f5adaa1224834e02269d | ||
app/models/person.rb 54c8e4d8c29aea76a736cd0e84e59678266faf67 | ||
app/models/degree.rb 27a138a7125cd65d37ed72cd5d78fc171867a5ad | ||
app/lib/auth_token.rb c39d411dd19f9c380fd31fe38a8f8ba83b61285f | ||
app/lib/find_detail.rb fd3fa869d315b712aa3e94ee4c5adf0a5c6b0106 | ||
app/models/mentorship.rb ae689710839b206c144f6671e1bd9968361ada65 | ||
app/lib/auto_complete.rb bbdb027e4c2292a986578f9f01e35db14984e730 | ||
app/models/supervision.rb b541dff3c87c20dc29fce31ba42516f420667cac | ||
app/models/institution.rb 487af31b2b4390188d7bf0218fb629159b064253 | ||
app/lib/notifier.rb a9f713a84d8fa05b20e88ae7a514e041dfb08807 | ||
app/lib/verifier.rb 7f1f2e80ef565f0cb6998c8eed710a288343da1b | ||
app/models/person.rb 214df9d48749eac7c4e6335da7008be3579ce20c | ||
app/models/degree.rb cd5a2c48725f9e8ea90e2b480a81e0c0de42f968 | ||
app/lib/auth_token.rb 4fe2ba5cc707a564a5da3709e6f81bb30bf3b82f | ||
app/lib/information.rb 44817aeba505f7477087cb8a7f1f769b2f40b56d | ||
app/lib/find_detail.rb 1edc0d8e0562c51fe0a3f92cbd5eb40e19d8e815 | ||
app/models/mentorship.rb 156f0976315ec3f85b3c9bc8b6b3cf0ee1898903 | ||
app/lib/auto_complete.rb af4a0eee76a76a6cb7a6474bba1887e8f929d3cf | ||
app/models/supervision.rb 9a9b51ff812b4bff2091ffb04b20897b1c869c54 | ||
app/models/institution.rb fde2fd1345388aef4ea09f11067cca4c3bd94522 | ||
app/models/audit_trail.rb 0ce06729b003a9150ee8f5d019beca55abdb6a66 | ||
app/controllers/api_controller.rb c410401db882d5af75cb0ef93ed16b9bd661ae4d | ||
app/controllers/api_controller.rb 439079430f75c5ee36083463c9622caf5b76e1c0 | ||
app/serializers/user_serializer.rb 3e2275741192602828a96ed0bd399c2c4bc1f9f9 | ||
app/controllers/auth_controller.rb 440f4c10764a54012395e8e7ab21252eb5669a0b | ||
app/controllers/user_controller.rb f9e3ad506ab6a42b9d040ee45aa1e23b8127275c | ||
app/controllers/auth_controller.rb f87eda4c62d55a8316476802d6866b17a18bc78d | ||
app/controllers/user_controller.rb 279c1a49fd694ecb8316dd4894720d3b6828f72c | ||
app/serializers/admin_serializer.rb ade50ceaf1d63c7f528fc887300b4aff58bef003 | ||
app/controllers/admin_controller.rb 1019fa7c700c93112a9dccb6fdbad538c8117527 | ||
app/controllers/admin_controller.rb c766d1575bf70d3e6cfe63f5a96cb6fed1f3649e | ||
app/serializers/search_serializer.rb 6dc86c5cbc82b9c3d7748349c14aee4d0f05b668 | ||
app/controllers/errors_controller.rb 1cbe908cb905b37e9b969d96d8df4f5b83fac8d2 | ||
app/controllers/search_controller.rb 49816061ce185069a5cc8b4be643498d182c464b | ||
app/controllers/errors_controller.rb 2fde7d97e22d9e9a7655aa76cbefb06177d59aef | ||
app/controllers/search_controller.rb 09f2930f31161dfabccd75bb32e1e23ac033eb5a | ||
app/serializers/api/degree_serializer.rb 5de6f60042b88a3535917d58d6fb878155f40934 | ||
app/serializers/api/person_serializer.rb fc6cd532f8b97954b63cd72e7fbe0b44d8700d0b | ||
app/serializers/api/mentor_serializer.rb 4ac428fbe51b0210d5147ca2a8df617210c6504a | ||
app/serializers/api/person_serializer.rb 1769202ae6e349e8edb45d9be3cc2cce8c1e8fdd | ||
app/controllers/api/admins_controller.rb b176a597dad8e26790c4373478e002f3460bd5e0 | ||
app/controllers/api/people_controller.rb 5820c0f4ed3cd7afcd75494b2c15a54ce3acabd8 | ||
app/serializers/api/postdoc_serializer.rb b1a393f46ec51efa52333339fa2dc228ba87cc98 | ||
app/controllers/application_controller.rb 5929e07351b3b97d7750f38bd1ae404784564be9 | ||
app/controllers/application_controller.rb 50904503abc5d2481c22a8f0edda9c7ca90e8350 | ||
app/controllers/api/degrees_controller.rb ad31dd8b09048fb7b4b9146c19af54adbb1f0a3f | ||
app/controllers/auto_complete_controller.rb 202d7df112dcf6125ebb8fdabac92fbdaeb6b35f | ||
app/serializers/api/supervisor_serializer.rb 62df2aa2907be83fb5f664d5685d9b03243c2887 | ||
app/controllers/api/aggregated_controller.rb aaec5023668cc6e967e0118ebf758bd379cd2c7b | ||
app/serializers/api/mentorship_serializer.rb 4ac428fbe51b0210d5147ca2a8df617210c6504a | ||
app/serializers/api/supervisor_serializer.rb 4d5231576e7501f61e04aa2aec76349146e92cca | ||
app/controllers/api/aggregated_controller.rb fa9988656ffef891705847f02dc3aa878908519e | ||
app/serializers/api/supervision_serializer.rb 4d5231576e7501f61e04aa2aec76349146e92cca | ||
app/serializers/api/institution_serializer.rb 574178e98f1a52d5fb771187154d6f1a12c41e86 | ||
app/controllers/api/mentorships_controller.rb f6432d45654930656cca8cc498534c5d7321c7c2 | ||
app/controllers/api/audit_trail_controller.rb 43de4c695c9992216d41efc1e4798e6a240745a7 | ||
app/controllers/api/audit_trail_controller.rb 946558ff78057781001760dec6b9ccbcb22412a2 | ||
app/controllers/api/supervisions_controller.rb 9b119c65b20ecfe893cc9002ff69cd7583e4d7c0 | ||
app/controllers/api/notification_controller.rb b076b8eaff36609753c36128a2ece398de4db7db | ||
app/controllers/api/institutions_controller.rb 6299bb48caef66a71d9580065d7d8f04439a80b1 | ||
app/controllers/api/verification_controller.rb ff649486c7ddbd94060a854ca3aede62321cbefc | ||
app/controllers/api/verification_controller.rb 30756a39440a5c2d39e3b6cd69df6aab979846a4 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
Remember to "bundle install" to download the gem files. | ||
### database loading script | ||
There is a script `reloadDB.sh` that will load both the test database and the development database. | ||
It tears everything down though, so if you're using it frequently you'll want to remove a few lines. | ||
|
||
February 10, 2016: | ||
|
||
* Initialized the backend with rails-api | ||
* Followed most of #17 on https://github.com/mefeghhi/poll-api | ||
* Haven't been able to do #18 yet | ||
* Created a User model and controller | ||
* Created a temporary model and controller for Contact Us (when receiving information for a concern) | ||
* Honestly, haven't been able to do anything too solid for both | ||
### test database location/initialization | ||
|
||
`/backend/lib/tasks/test_data.rake` is where test data is loaded from. This is the | ||
data that is tested against in the tests. This data is automatically loaded with `./reloadDB.sh` | ||
|
||
## example test for authentication route -- when it works it should return some token provided username/password combo | ||
### test location | ||
|
||
http://stackoverflow.com/questions/6885990/rails-params-explained | ||
tests are located in the `/backend/spec` folder. You can run these with `rake spec`. | ||
|
||
``` | ||
curl -X POST -H 'Content-Length: 0' \ | ||
'http://localhost:3000/authenticate/?username=testUser&password=testPassword' | ||
``` | ||
response: | ||
### futher documentation | ||
|
||
``` | ||
{"auth_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0NTc4MjQ0OTR9.AplIW545pEZCSXb3BtBu2j4svTriNuRPs6_imIkO_aQ","user":{"id":1,"username":"testUser"}} | ||
``` | ||
|
||
## sources | ||
|
||
http://adamalbrecht.com/2015/07/20/authentication-using-json-web-tokens-using-rails-and-react/ | ||
|
||
http://adamalbrecht.com/2014/12/04/add-json-web-token-authentication-to-your-angular-rails-app/ | ||
|
||
|
||
### work on error repsonses... shouldn't be responding with HTML | ||
|
||
https://wyeworks.com/blog/2016/1/12/improvements-to-error-responses-in-rails-5-api-mode | ||
There is further documentation on the [project wiki](https://github.com/401ChemistryGenealogy/ChemistryGenealogy/wiki#documentation). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# @author Steven Myers | ||
# will authenticate every request besides GETs for everything | ||
# inheriting from the ApiController | ||
class ApiController < ApplicationController | ||
before_action :authenticate_request!, except: [:index, :show] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
bundle exec rake db:drop | ||
bundle exec rake db:migrate | ||
bundle exec rake db:schema:load | ||
RAILS_ENV=development bundle exec rake db:seed | ||
RAILS_ENV=test bundle exec rake app:load_demo_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.