diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..d3826750d66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile ~/.gitignore_global + +*.rbc +*.sassc +**.orig +.bundle +.coveralls.yml +.databag_secret +.env +.idea +.powrc +.sass-cache +.zeus.sock +.DS_store +.rspec +.ruby-gemset +.vagrant +.capistrano + +# root files +capybara-*.html +dump.rdb +latest.dump +rerun.txt +Vagrantfile + +# folders +code/upaya/config/application.yml +code/upaya/config/aws.yml +code/upaya/config/database.yml +code/upaya/config/newrelic.yml +code/upaya/config/saml.key.enc +code/upaya/config/secrets.yml +code/upaya/coverage +code/upaya/db/*.sqlite3 +code/upaya/doc/search_stats.csv +code/upaya/fixtures +code/upaya/kitchen/cookbooks +code/upaya/log/* +code/upaya/private_certs/* +code/upaya/public/system +code/upaya/spec/tmp +code/upaya/test +code/upaya/tmp/* +code/upaya/vendor/bundle + +# This is a hack to keep the files that are added to the repo and to prevent git from worrying about +# new (transient) files that may be created in those dirs. +code/upaya/config/deploy/*.rb +code/upaya/kitchen/nodes/*.json +code/upaya/kitchen/data_bags/config/*.yml +code/upaya/kitchen/data_bags/config/databag_secrets.json diff --git a/code/upaya/Gemfile b/code/upaya/Gemfile new file mode 100644 index 00000000000..5aa4a212d8c --- /dev/null +++ b/code/upaya/Gemfile @@ -0,0 +1,93 @@ +source 'https://rubygems.org' + +gem 'rails', '~> 4.2.6' + +gem 'attr_encrypted' +gem 'autoprefixer-rails', '~> 5.2' +gem 'coffee-rails', '~> 4.1.0' +gem 'devise' +gem 'devise_security_extension' +gem 'dotiw' +gem 'figaro' +gem 'jbuilder', '~> 2.0' +gem 'jquery-rails' +gem 'jquery-ui-rails' +gem 'kaminari-bootstrap', '~> 3.0.1' +gem 'letter_opener_web' +gem 'lograge' +gem 'newrelic_rpm' +gem 'omniauth-saml', github: 'amoose/omniauth-saml', branch: 'feature/internal_idp' +gem 'phony_rails' +gem 'pg' +gem 'pundit' +gem 'valid_email' +gem 'rack-attack' +gem 'responders', '~> 2.0' +gem 'resque' +gem 'ruby-saml', github: 'amoose/ruby-saml' +# gem 'nokogiri-xmlsec-me-harder', '~> 0.9.1', require: 'xmlsec' +gem 'saml_idp', github: '18F/saml_idp' +gem 'sass-rails', '~> 5.0' +gem 'secure_headers', '~> 3.0.0' +gem 'simple_form', github: 'amoose/simple_form', branch: 'feature/aria-invalid' +gem 'slim-rails' +gem 'style_guide', git: 'git@github.com:18F/myuscis-style-guide.git', branch: 'no-usps' +gem 'turbolinks' +gem 'twilio-ruby' +gem 'two_factor_authentication', git: 'https://github.com/Houdini/two_factor_authentication' +gem 'uglifier', '>= 1.3.0' +gem 'whenever', require: false +gem 'activerecord-session_store' # TODO[astone] added gem due to CookieOverflow + +group :deploy do + gem 'berkshelf' + gem 'capistrano'#, '~> 3.4' + gem 'capistrano-rails'#, '~> 1.1', require: false + gem 'capistrano-rbenv'#, '~> 2.0', require: false + gem 'capistrano-resque'#, '~> 0.2.1', require: false + gem 'chef', '~> 12.0.1' + gem 'knife-ec2' + gem 'knife-solo', github: 'matschaffer/knife-solo', submodules: true + gem 'knife-solo_data_bag' +end + +group :development do + gem 'aws-sdk', '~> 2.0' + gem 'better_errors' + gem 'derailed' + gem 'binding_of_caller', platforms: [:mri_21] + gem 'guard-rspec', require: false + gem 'quiet_assets' + gem 'rack-mini-profiler' + gem 'rails_layout' + gem 'spring' + gem 'spring-commands-rspec' + gem 'spring-watcher-listen' +end + +group :development, :test do + gem 'pry-byebug' + gem 'rspec-rails', '~> 3.3' + gem 'thin' + gem 'brakeman' + gem 'bullet' + gem 'dawnscanner', require: false +end + +group :test do + gem 'capybara-screenshot' + gem 'codeclimate-test-reporter', require: nil + gem 'database_cleaner' + gem 'email_spec' + gem 'factory_girl_rails' + gem 'faker' + gem 'poltergeist' + gem 'rack_session_access' + gem 'rack-test' + gem 'rspec-activejob' + gem 'rubocop' + gem 'shoulda-matchers', '~> 2.8', require: false + gem 'sms-spec', git: 'https://github.com/monfresh/sms-spec.git', require: 'sms_spec' + gem 'timecop' + gem 'webmock' +end diff --git a/code/upaya/Gemfile.lock b/code/upaya/Gemfile.lock new file mode 100644 index 00000000000..61e196bd446 --- /dev/null +++ b/code/upaya/Gemfile.lock @@ -0,0 +1,966 @@ +GIT + remote: git://github.com/18F/saml_idp.git + revision: afe6e7967fc4db89052c6ee171b5b1c365c1465f + specs: + saml_idp (0.1.1) + activesupport + httparty + nokogiri + uuid + +GIT + remote: git://github.com/amoose/omniauth-saml.git + revision: 06c019e451db4eb769bf40fcba2b092091fe7d4a + branch: feature/internal_idp + specs: + omniauth-saml (1.3.0) + omniauth (~> 1.2) + +GIT + remote: git://github.com/amoose/ruby-saml.git + revision: f2bfac4cbbffba46beb6ad277927edfb46b40084 + specs: + ruby-saml (0.9) + nokogiri (>= 1.5.0) + uuid (~> 2.3) + +GIT + remote: git://github.com/amoose/simple_form.git + revision: 7f70e35f772e0e806407592af260bda48f5f08ea + branch: feature/aria-invalid + specs: + simple_form (3.1.0.rc2) + actionpack (~> 4.0) + activemodel (~> 4.0) + +GIT + remote: git://github.com/matschaffer/knife-solo.git + revision: 3b3fa546f24fcee291ef73315e0e9729894f6500 + submodules: true + specs: + knife-solo (0.5.2) + chef (>= 10.20) + erubis (~> 2.7.0) + net-ssh (>= 2.7, < 4.0) + +GIT + remote: git@github.com:18F/myuscis-style-guide.git + revision: 437325f156c4ae7e3f7a7d0128832e6392a89e72 + branch: no-usps + specs: + style_guide (2.1.61) + autoprefixer-rails (>= 5.1) + block_helpers (~> 0.3) + carmen-rails (~> 1.0) + font-awesome-sass (~> 4.3.0) + httparty + rails (>= 4.1.9) + sass-rails (>= 3.2) + +GIT + remote: https://github.com/Houdini/two_factor_authentication + revision: 675f651929b7a09bb59169bf4206a10895c2b9d9 + specs: + two_factor_authentication (1.1.5) + devise + encryptor + rails (>= 3.1.1) + randexp + rotp + +GIT + remote: https://github.com/monfresh/sms-spec.git + revision: 786238c1924c055d16a4963abb329c9b985ce104 + specs: + sms-spec (0.2.0) + rspec (~> 3.1) + +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.2) + actionmailer (4.2.6) + actionpack (= 4.2.6) + actionview (= 4.2.6) + activejob (= 4.2.6) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.6) + actionview (= 4.2.6) + activesupport (= 4.2.6) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.6) + activesupport (= 4.2.6) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + activejob (4.2.6) + activesupport (= 4.2.6) + globalid (>= 0.3.0) + activemodel (4.2.6) + activesupport (= 4.2.6) + builder (~> 3.1) + activerecord (4.2.6) + activemodel (= 4.2.6) + activesupport (= 4.2.6) + arel (~> 6.0) + activerecord-session_store (0.1.2) + actionpack (>= 4.0.0, < 5) + activerecord (>= 4.0.0, < 5) + railties (>= 4.0.0, < 5) + activesupport (4.2.6) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.4.0) + arel (6.0.3) + ast (2.2.0) + attr_encrypted (3.0.1) + encryptor (~> 3.0.0) + autoprefixer-rails (5.2.1.3) + execjs + json + aws-sdk (2.2.31) + aws-sdk-resources (= 2.2.31) + aws-sdk-core (2.2.31) + jmespath (~> 1.0) + aws-sdk-resources (2.2.31) + aws-sdk-core (= 2.2.31) + bcrypt (3.1.11) + bcrypt-ruby (3.1.5) + bcrypt (>= 3.1.3) + benchmark-ips (2.5.0) + berkshelf (4.3.1) + addressable (~> 2.3, >= 2.3.4) + berkshelf-api-client (~> 2.0, >= 2.0.2) + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-shell_out (~> 0.1) + celluloid (= 0.16.0) + celluloid-io (~> 0.16.1) + cleanroom (~> 1.0) + faraday (~> 0.9) + httpclient (~> 2.7) + minitar (~> 0.5, >= 0.5.4) + octokit (~> 4.0) + retryable (~> 2.0) + ridley (~> 4.5) + solve (~> 2.0) + thor (~> 0.19) + berkshelf-api-client (2.0.2) + faraday (~> 0.9.1) + httpclient (~> 2.7.0) + ridley (~> 4.5) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) + block_helpers (0.3.3) + activesupport (>= 2.0) + brakeman (3.2.1) + erubis (~> 2.6) + haml (>= 3.0, < 5.0) + highline (>= 1.6.20, < 2.0) + ruby2ruby (~> 2.3.0) + ruby_parser (~> 3.8.1) + safe_yaml (>= 1.0) + sass (~> 3.0) + slim (>= 1.3.6, < 4.0) + terminal-table (~> 1.4) + buff-config (1.0.1) + buff-extensions (~> 1.0) + varia_model (~> 0.4) + buff-extensions (1.0.0) + buff-ignore (1.1.1) + buff-ruby_engine (0.1.0) + buff-shell_out (0.2.0) + buff-ruby_engine (~> 0.1.0) + builder (3.2.2) + bullet (5.0.0) + activesupport (>= 3.0.0) + uniform_notifier (~> 1.9.0) + byebug (8.2.2) + capistrano (3.4.0) + i18n + rake (>= 10.0.0) + sshkit (~> 1.3) + capistrano-bundler (1.1.4) + capistrano (~> 3.1) + sshkit (~> 1.2) + capistrano-rails (1.1.6) + capistrano (~> 3.1) + capistrano-bundler (~> 1.1) + capistrano-rbenv (2.0.4) + capistrano (~> 3.1) + sshkit (~> 1.3) + capistrano-resque (0.2.2) + capistrano + resque + resque-scheduler + capybara (2.6.2) + addressable + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + capybara-screenshot (1.0.12) + capybara (>= 1.0, < 3) + launchy + carmen (1.0.2) + activesupport (>= 3.0.0) + carmen-rails (1.0.1) + carmen (~> 1.0.0) + rails + celluloid (0.16.0) + timers (~> 4.0.0) + celluloid-io (0.16.2) + celluloid (>= 0.16.0) + nio4r (>= 1.1.0) + chef (12.0.3) + chef-zero (~> 3.2) + diff-lcs (~> 1.2, >= 1.2.4) + erubis (~> 2.7) + ffi-yajl (~> 1.2) + highline (~> 1.6, >= 1.6.9) + mixlib-authentication (~> 1.3) + mixlib-cli (~> 1.4) + mixlib-config (~> 2.0) + mixlib-log (~> 1.3) + mixlib-shellout (>= 2.0.0.rc.0, < 3.0) + net-ssh (~> 2.6) + net-ssh-multi (~> 1.1) + ohai (~> 8.0) + plist (~> 3.1.0) + pry (~> 0.9) + chef-config (12.8.1) + mixlib-config (~> 2.0) + mixlib-shellout (~> 2.0) + chef-zero (3.2.1) + ffi-yajl (~> 1.1) + hashie (~> 2.0) + mixlib-log (~> 1.3) + rack + uuidtools (~> 2.1) + chronic (0.10.2) + cleanroom (1.0.0) + cliver (0.3.2) + codeclimate-test-reporter (0.5.0) + simplecov (>= 0.7.1, < 1.0.0) + coderay (1.1.1) + coffee-rails (4.1.1) + coffee-script (>= 2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + concurrent-ruby (1.0.1) + crack (0.4.3) + safe_yaml (~> 1.0.0) + cvss (0.99.0) + daemons (1.2.3) + data_mapper (1.2.0) + dm-aggregates (~> 1.2.0) + dm-constraints (~> 1.2.0) + dm-core (~> 1.2.0) + dm-migrations (~> 1.2.0) + dm-serializer (~> 1.2.0) + dm-timestamps (~> 1.2.0) + dm-transactions (~> 1.2.0) + dm-types (~> 1.2.0) + dm-validations (~> 1.2.0) + data_objects (0.10.17) + addressable (~> 2.1) + database_cleaner (1.5.1) + dawnscanner (1.6.2) + cvss + data_mapper + dm-sqlite-adapter + haml + justify + logger-colors + ptools + ruby_parser + sqlite3 + sys-uname + terminal-table + debug_inspector (0.0.2) + derailed (0.1.0) + derailed_benchmarks + derailed_benchmarks (1.3.1) + benchmark-ips (~> 2) + get_process_mem (~> 0) + heapy (~> 0) + memory_profiler (~> 0) + rack (>= 1) + rake (> 10, < 12) + thor (~> 0.19) + devise (3.5.6) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + devise_security_extension (0.10.0) + devise (>= 3.0.0, < 4.0) + railties (>= 3.2.6, < 5.0) + diff-lcs (1.2.5) + dm-aggregates (1.2.0) + dm-core (~> 1.2.0) + dm-constraints (1.2.0) + dm-core (~> 1.2.0) + dm-core (1.2.1) + addressable (~> 2.3) + dm-do-adapter (1.2.0) + data_objects (~> 0.10.6) + dm-core (~> 1.2.0) + dm-migrations (1.2.0) + dm-core (~> 1.2.0) + dm-serializer (1.2.2) + dm-core (~> 1.2.0) + fastercsv (~> 1.5) + json (~> 1.6) + json_pure (~> 1.6) + multi_json (~> 1.0) + dm-sqlite-adapter (1.2.0) + dm-do-adapter (~> 1.2.0) + do_sqlite3 (~> 0.10.6) + dm-timestamps (1.2.0) + dm-core (~> 1.2.0) + dm-transactions (1.2.0) + dm-core (~> 1.2.0) + dm-types (1.2.2) + bcrypt-ruby (~> 3.0) + dm-core (~> 1.2.0) + fastercsv (~> 1.5) + json (~> 1.6) + multi_json (~> 1.0) + stringex (~> 1.4) + uuidtools (~> 2.1) + dm-validations (1.2.0) + dm-core (~> 1.2.0) + do_sqlite3 (0.10.17) + data_objects (= 0.10.17) + docile (1.1.5) + dotiw (3.1.1) + actionpack (>= 3) + i18n + email_spec (2.0.0) + htmlentities (~> 4.3.3) + launchy (~> 2.1) + mail (~> 2.6.3) + encryptor (3.0.0) + erubis (2.7.0) + eventmachine (1.2.0.1) + excon (0.49.0) + execjs (2.6.0) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.6.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) + faker (1.6.3) + i18n (~> 0.5) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + fastercsv (1.5.5) + ffi (1.9.10) + ffi-yajl (1.4.0) + ffi (~> 1.5) + libyajl2 (~> 1.2) + figaro (1.1.1) + thor (~> 0.14) + fission (0.5.0) + CFPropertyList (~> 2.2) + fog (1.29.0) + fog-atmos + fog-aws (~> 0.0) + fog-brightbox (~> 0.4) + fog-core (~> 1.27, >= 1.27.4) + fog-ecloud + fog-json + fog-local + fog-powerdns (>= 0.1.1) + fog-profitbricks + fog-radosgw (>= 0.0.2) + fog-riakcs + fog-sakuracloud (>= 0.0.4) + fog-serverlove + fog-softlayer + fog-storm_on_demand + fog-terremark + fog-vmfusion + fog-voxel + fog-xml (~> 0.1.1) + ipaddress (~> 0.5) + nokogiri (~> 1.5, >= 1.5.11) + fog-atmos (0.1.0) + fog-core + fog-xml + fog-aws (0.9.2) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + ipaddress (~> 0.8) + fog-brightbox (0.10.1) + fog-core (~> 1.22) + fog-json + inflecto (~> 0.0.2) + fog-core (1.37.0) + builder + excon (~> 0.45) + formatador (~> 0.2) + fog-ecloud (0.3.0) + fog-core + fog-xml + fog-json (1.0.2) + fog-core (~> 1.0) + multi_json (~> 1.10) + fog-local (0.3.0) + fog-core (~> 1.27) + fog-powerdns (0.1.1) + fog-core (~> 1.27) + fog-json (~> 1.0) + fog-xml (~> 0.1) + fog-profitbricks (0.0.5) + fog-core + fog-xml + nokogiri + fog-radosgw (0.0.5) + fog-core (>= 1.21.0) + fog-json + fog-xml (>= 0.0.1) + fog-riakcs (0.1.0) + fog-core + fog-json + fog-xml + fog-sakuracloud (1.7.5) + fog-core + fog-json + fog-serverlove (0.1.2) + fog-core + fog-json + fog-softlayer (1.1.0) + fog-core + fog-json + fog-storm_on_demand (0.1.1) + fog-core + fog-json + fog-terremark (0.1.0) + fog-core + fog-xml + fog-vmfusion (0.1.0) + fission + fog-core + fog-voxel (0.1.0) + fog-core + fog-xml + fog-xml (0.1.2) + fog-core + nokogiri (~> 1.5, >= 1.5.11) + font-awesome-sass (4.3.2.1) + sass (~> 3.2) + formatador (0.2.5) + get_process_mem (0.2.0) + globalid (0.3.6) + activesupport (>= 4.1.0) + gssapi (1.2.0) + ffi (>= 1.0.1) + guard (2.13.0) + formatador (>= 0.2.4) + listen (>= 2.7, <= 4.0) + lumberjack (~> 1.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.6.5) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + gyoku (1.3.1) + builder (>= 2.1.2) + haml (4.0.7) + tilt + hashdiff (0.3.0) + hashie (2.1.2) + heapy (0.1.2) + highline (1.7.8) + hitimes (1.2.3) + htmlentities (4.3.4) + httparty (0.13.7) + json (~> 1.8) + multi_xml (>= 0.5.2) + httpclient (2.7.1) + i18n (0.7.0) + inflecto (0.0.2) + ipaddress (0.8.3) + jbuilder (2.4.1) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jmespath (1.2.3) + json_pure (>= 1.8.1) + jquery-rails (4.1.1) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + jquery-ui-rails (5.0.5) + railties (>= 3.2.16) + json (1.8.3) + json_pure (1.8.3) + justify (1.0.2) + jwt (1.5.4) + kaminari (0.16.3) + actionpack (>= 3.0.0) + activesupport (>= 3.0.0) + kaminari-bootstrap (3.0.1) + kaminari (>= 0.13.0) + rails + knife-ec2 (0.12.0) + fog (~> 1.29.0) + knife-windows (~> 1.0) + knife-solo_data_bag (1.1.0) + knife-windows (1.4.0) + winrm (~> 1.7) + launchy (2.4.3) + addressable (~> 2.3) + letter_opener (1.4.1) + launchy (~> 2.2) + letter_opener_web (1.3.0) + actionmailer (>= 3.2) + letter_opener (~> 1.0) + railties (>= 3.2) + libyajl2 (1.2.0) + listen (3.0.6) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9.7) + little-plugger (1.1.4) + logger-colors (1.0.0) + logging (2.1.0) + little-plugger (~> 1.1) + multi_json (~> 1.10) + lograge (0.3.6) + actionpack (>= 3) + activesupport (>= 3) + railties (>= 3) + loofah (2.0.3) + nokogiri (>= 1.5.9) + lumberjack (1.0.10) + macaddr (1.7.1) + systemu (~> 2.6.2) + mail (2.6.4) + mime-types (>= 1.16, < 4) + memory_profiler (0.9.6) + method_source (0.8.2) + mime-types (2.99.1) + mini_portile2 (2.0.0) + minitar (0.5.4) + minitest (5.8.4) + mixlib-authentication (1.4.0) + mixlib-log + rspec-core (~> 3.2) + rspec-expectations (~> 3.2) + rspec-mocks (~> 3.2) + mixlib-cli (1.5.0) + mixlib-config (2.2.1) + mixlib-log (1.6.0) + mixlib-shellout (2.2.6) + molinillo (0.4.4) + mono_logger (1.1.0) + multi_json (1.11.2) + multi_xml (0.5.5) + multipart-post (2.0.0) + nenv (0.3.0) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.4) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) + net-ssh-multi (1.2.1) + net-ssh (>= 2.6.5) + net-ssh-gateway (>= 1.2.0) + newrelic_rpm (3.15.1.316) + nio4r (1.2.1) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + nori (2.6.0) + notiffany (0.0.8) + nenv (~> 0.1) + shellany (~> 0.0) + octokit (4.3.0) + sawyer (~> 0.7.0, >= 0.5.3) + ohai (8.4.0) + ffi (~> 1.9) + ffi-yajl (>= 1.1, < 3.0) + ipaddress + mime-types (~> 2.0) + mixlib-cli + mixlib-config (~> 2.0) + mixlib-log + mixlib-shellout (~> 2.0) + rake (~> 10.1) + systemu (~> 2.6.4) + wmi-lite (~> 1.0) + omniauth (1.3.1) + hashie (>= 1.2, < 4) + rack (>= 1.0, < 3) + orm_adapter (0.5.0) + parser (2.3.0.7) + ast (~> 2.2) + pg (0.18.4) + phony (2.15.20) + phony_rails (0.13.1) + activesupport (>= 3.0) + phony (~> 2.12) + plist (3.1.0) + poltergeist (1.9.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + multi_json (~> 1.0) + websocket-driver (>= 0.2.0) + powerpack (0.1.1) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-byebug (3.3.0) + byebug (~> 8.0) + pry (~> 0.10) + ptools (1.3.3) + pundit (1.1.0) + activesupport (>= 3.0.0) + quiet_assets (1.1.0) + railties (>= 3.1, < 5.0) + rack (1.6.4) + rack-attack (4.4.1) + rack + rack-mini-profiler (0.9.9.2) + rack (>= 1.2.0) + rack-protection (1.5.3) + rack + rack-test (0.6.3) + rack (>= 1.0) + rack_session_access (0.1.1) + builder (>= 2.0.0) + rack (>= 1.0.0) + rails (4.2.6) + actionmailer (= 4.2.6) + actionpack (= 4.2.6) + actionview (= 4.2.6) + activejob (= 4.2.6) + activemodel (= 4.2.6) + activerecord (= 4.2.6) + activesupport (= 4.2.6) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.6) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.7) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6.0) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rails_layout (1.0.29) + railties (4.2.6) + actionpack (= 4.2.6) + activesupport (= 4.2.6) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rainbow (2.1.0) + rake (10.5.0) + randexp (0.1.7) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) + ffi (>= 0.5.0) + redis (3.2.2) + redis-namespace (1.5.2) + redis (~> 3.0, >= 3.0.4) + responders (2.1.2) + railties (>= 4.2.0, < 5.1) + resque (1.26.0) + mono_logger (~> 1.0) + multi_json (~> 1.0) + redis-namespace (~> 1.3) + sinatra (>= 0.9.2) + vegas (~> 0.1.2) + resque-scheduler (4.1.0) + mono_logger (~> 1.0) + redis (~> 3.0) + resque (~> 1.25) + rufus-scheduler (~> 3.0) + retryable (2.0.3) + ridley (4.5.0) + addressable + buff-config (~> 1.0) + buff-extensions (~> 1.0) + buff-ignore (~> 1.1) + buff-shell_out (~> 0.1) + celluloid (~> 0.16.0) + celluloid-io (~> 0.16.1) + chef-config (>= 12.5.0) + erubis + faraday (~> 0.9.0) + hashie (>= 2.0.2, < 4.0.0) + httpclient (~> 2.7) + json (>= 1.7.7) + mixlib-authentication (>= 1.3.0) + retryable (~> 2.0) + semverse (~> 1.1) + varia_model (~> 0.4.0) + rotp (2.1.1) + rspec (3.4.0) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-activejob (0.6.1) + activejob (>= 4.2) + rspec-mocks + rspec-core (3.4.4) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-mocks (3.4.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) + rubocop (0.39.0) + parser (>= 2.3.0.7, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.7.5) + ruby2ruby (2.3.0) + ruby_parser (~> 3.1) + sexp_processor (~> 4.0) + ruby_parser (3.8.1) + sexp_processor (~> 4.1) + rubyntlm (0.6.0) + rufus-scheduler (3.2.0) + safe_yaml (1.0.4) + sass (3.4.22) + sass-rails (5.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sawyer (0.7.0) + addressable (>= 2.3.5, < 2.5) + faraday (~> 0.8, < 0.10) + secure_headers (3.0.3) + useragent + semverse (1.2.1) + sexp_processor (4.7.0) + shellany (0.0.1) + shoulda-matchers (2.8.0) + activesupport (>= 3.0.0) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + sinatra (1.4.7) + rack (~> 1.5) + rack-protection (~> 1.4) + tilt (>= 1.3, < 3) + slim (3.0.6) + temple (~> 0.7.3) + tilt (>= 1.3.3, < 2.1) + slim-rails (3.0.1) + actionmailer (>= 3.1, < 5.0) + actionpack (>= 3.1, < 5.0) + activesupport (>= 3.1, < 5.0) + railties (>= 3.1, < 5.0) + slim (~> 3.0) + slop (3.6.0) + solve (2.0.3) + molinillo (~> 0.4.2) + semverse (~> 1.1) + spring (1.6.4) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + spring-watcher-listen (2.0.0) + listen (>= 2.7, < 4.0) + spring (~> 1.2) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.0.4) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.11) + sshkit (1.9.0) + net-scp (>= 1.1.2) + net-ssh (>= 2.8.0) + stringex (1.5.1) + sys-uname (1.0.2) + ffi (>= 1.0.0) + systemu (2.6.5) + temple (0.7.6) + terminal-table (1.5.2) + thin (1.6.4) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (~> 1.0) + thor (0.19.1) + thread_safe (0.3.5) + tilt (2.0.2) + timecop (0.8.1) + timers (4.0.4) + hitimes + turbolinks (2.5.3) + coffee-rails + twilio-ruby (4.11.1) + builder (>= 2.1.2) + jwt (~> 1.0) + multi_json (>= 1.3.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (3.0.0) + execjs (>= 0.3.0, < 3) + unicode-display_width (1.0.3) + uniform_notifier (1.9.0) + useragent (0.16.7) + uuid (2.3.8) + macaddr (~> 1.0) + uuidtools (2.1.5) + valid_email (0.0.13) + activemodel + mail (~> 2.6.1) + varia_model (0.4.1) + buff-extensions (~> 1.0) + hashie (>= 2.0.2, < 4.0.0) + vegas (0.1.11) + rack (>= 1.0.0) + warden (1.2.6) + rack (>= 1.0) + webmock (1.24.2) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + websocket-driver (0.6.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + whenever (0.9.4) + chronic (>= 0.6.3) + winrm (1.7.3) + builder (>= 2.1.2) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0) + wmi-lite (1.0.0) + xpath (2.0.0) + nokogiri (~> 1.3) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord-session_store + attr_encrypted + autoprefixer-rails (~> 5.2) + aws-sdk (~> 2.0) + berkshelf + better_errors + binding_of_caller + brakeman + bullet + capistrano + capistrano-rails + capistrano-rbenv + capistrano-resque + capybara-screenshot + chef (~> 12.0.1) + codeclimate-test-reporter + coffee-rails (~> 4.1.0) + database_cleaner + dawnscanner + derailed + devise + devise_security_extension + dotiw + email_spec + factory_girl_rails + faker + figaro + guard-rspec + jbuilder (~> 2.0) + jquery-rails + jquery-ui-rails + kaminari-bootstrap (~> 3.0.1) + knife-ec2 + knife-solo! + knife-solo_data_bag + letter_opener_web + lograge + newrelic_rpm + omniauth-saml! + pg + phony_rails + poltergeist + pry-byebug + pundit + quiet_assets + rack-attack + rack-mini-profiler + rack-test + rack_session_access + rails (~> 4.2.6) + rails_layout + responders (~> 2.0) + resque + rspec-activejob + rspec-rails (~> 3.3) + rubocop + ruby-saml! + saml_idp! + sass-rails (~> 5.0) + secure_headers (~> 3.0.0) + shoulda-matchers (~> 2.8) + simple_form! + slim-rails + sms-spec! + spring + spring-commands-rspec + spring-watcher-listen + style_guide! + thin + timecop + turbolinks + twilio-ruby + two_factor_authentication! + uglifier (>= 1.3.0) + valid_email + webmock + whenever + +BUNDLED WITH + 1.11.2 diff --git a/code/upaya/README.rdoc b/code/upaya/README.rdoc new file mode 100644 index 00000000000..dd4e97e22e1 --- /dev/null +++ b/code/upaya/README.rdoc @@ -0,0 +1,28 @@ +== README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... + + +Please feel free to use a different markup language if you do not plan to run +rake doc:app. diff --git a/code/upaya/Rakefile b/code/upaya/Rakefile new file mode 100644 index 00000000000..ba6b733dd23 --- /dev/null +++ b/code/upaya/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require File.expand_path('../config/application', __FILE__) + +Rails.application.load_tasks diff --git a/code/upaya/app/assets/images/.keep b/code/upaya/app/assets/images/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/assets/javascripts/application.js b/code/upaya/app/assets/javascripts/application.js new file mode 100644 index 00000000000..e07c5a830f7 --- /dev/null +++ b/code/upaya/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require jquery +//= require jquery_ujs +//= require turbolinks +//= require_tree . diff --git a/code/upaya/app/assets/stylesheets/application.css b/code/upaya/app/assets/stylesheets/application.css new file mode 100644 index 00000000000..f9cd5b34830 --- /dev/null +++ b/code/upaya/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/code/upaya/app/controllers/application_controller.rb b/code/upaya/app/controllers/application_controller.rb new file mode 100644 index 00000000000..d83690e1b9a --- /dev/null +++ b/code/upaya/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + # Prevent CSRF attacks by raising an exception. + # For APIs, you may want to use :null_session instead. + protect_from_forgery with: :exception +end diff --git a/code/upaya/app/controllers/concerns/.keep b/code/upaya/app/controllers/concerns/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/helpers/application_helper.rb b/code/upaya/app/helpers/application_helper.rb new file mode 100644 index 00000000000..de6be7945c6 --- /dev/null +++ b/code/upaya/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/code/upaya/app/mailers/.keep b/code/upaya/app/mailers/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/models/.keep b/code/upaya/app/models/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/models/concerns/.keep b/code/upaya/app/models/concerns/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/app/views/layouts/application.html.erb b/code/upaya/app/views/layouts/application.html.erb new file mode 100644 index 00000000000..32554be0e80 --- /dev/null +++ b/code/upaya/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + +
+To protect your information, we need to confirm that you are who you say you are. + Only you, the immigrant receiving a Green Card, + are allowed to create a Upaya online account.
+Attorneys, accredited representatives, preparers, interpreters, or notaries cannot create a + Upaya online account for you. If you are not the immigrant who will receive the Green Card, + please click Cancel to exit this screen.
+ index_info_html: > + Once you click Get Started, + we will ask you a series of questions to confirm your identity. + You may find it helpful to refer to the following documents before you begin: + fail_html: > + You may take this quiz again.+ Before you take the quiz, you may find it helpful to refer to the following documents: + documents: + - Your passport(s) + - A copy of your visa application(s) + - Your Immigrant Data Summary Sheet + time_limit: You will have 60 minutes to complete the quiz. + hardfail_html: > + Until we can verify your identity, you cannot use a Upaya online account to change your U.S. + mailing address or view your case history. However, you can still track the status of your + Green Card through Case Status Online. + You will need your Upaya Receipt Number to get the status of your case. The receipt number + will begin with the letters "IOE." You can also change your address with Upaya by visiting + the Change of Address + website. + hardfail_kicker_html: > + Please contact the Customer Contact Center + by filling out the online help form if you need further assistance. + inprogress: > + It appears you have not successfully completed an identity quiz. + Do you want to continue confirming your identity? + generating: This can take up to a minute. We will start your quiz when it is ready. + resume_quiz: > + We were not able to retrieve your question. Would you like to try again? + complete: > + You can now access your Upaya online account to get status updates, update your online + account profile, and change your U.S. mailing address. + misc: + index_kicker: Are you ready to start? + no_more_questions: Not enough questions could be generated for the quiz. + timeout_alert: You have exceeded the 60 minutes allowed for the quiz. + too_many_times: You have attempted the quiz too many times + labels: + start: Get started! + next: "Next " + again: Take the Identity Verification Quiz again + continue: Continue + retry_quiz: Retry Quiz + hide_finder: "Hide document" + hide_finder_hidden: " sample displayed below" + where_find: "Where do I find this?" + where_find_hidden: "– Display document sample below" + resume_quiz: Resume Quiz + links: + no_thanks: Cancel + exit_quiz_now: Exit + home: Go back + accessibility: + next: Next question + start: Get started with the identity quiz + no_thanks: Cancel quiz diff --git a/code/upaya/config/locales/security_questions.en.yml b/code/upaya/config/locales/security_questions.en.yml new file mode 100644 index 00000000000..c94ff4c964f --- /dev/null +++ b/code/upaya/config/locales/security_questions.en.yml @@ -0,0 +1,5 @@ +en: + devise: + security_questions: + user: + invalid_token: Invalid password reset token. Please try again. diff --git a/code/upaya/config/locales/simple_form.en.yml b/code/upaya/config/locales/simple_form.en.yml new file mode 100644 index 00000000000..9e4147d8670 --- /dev/null +++ b/code/upaya/config/locales/simple_form.en.yml @@ -0,0 +1,38 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'This field is required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + + labels: + user: + account_type: "Select an account type:" + + options: + user: + account_type: + # TODO move this markup into template(s) + self: | +
+ + I am a Customer.
++ I am submitting an application, petition, or request for myself or a family member. +
+ representative: | ++ + I am a Legal Representative.
++ I am an attorney eligible to practice law in the United States. +
++ I am a representative of a qualified organization that is recognized by the Board of Immigration Appeals (BIA). +
diff --git a/code/upaya/config/routes.rb b/code/upaya/config/routes.rb new file mode 100644 index 00000000000..3f66539d543 --- /dev/null +++ b/code/upaya/config/routes.rb @@ -0,0 +1,56 @@ +Rails.application.routes.draw do + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + # root 'welcome#index' + + # Example of regular route: + # get 'products/:id' => 'catalog#view' + + # Example of named route that can be invoked with purchase_url(id: product.id) + # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase + + # Example resource route (maps HTTP verbs to controller actions automatically): + # resources :products + + # Example resource route with options: + # resources :products do + # member do + # get 'short' + # post 'toggle' + # end + # + # collection do + # get 'sold' + # end + # end + + # Example resource route with sub-resources: + # resources :products do + # resources :comments, :sales + # resource :seller + # end + + # Example resource route with more complex sub-resources: + # resources :products do + # resources :comments + # resources :sales do + # get 'recent', on: :collection + # end + # end + + # Example resource route with concerns: + # concern :toggleable do + # post 'toggle' + # end + # resources :posts, concerns: :toggleable + # resources :photos, concerns: :toggleable + + # Example resource route within a namespace: + # namespace :admin do + # # Directs /admin/products/* to Admin::ProductsController + # # (app/controllers/admin/products_controller.rb) + # resources :products + # end +end diff --git a/code/upaya/config/secrets.yml.example b/code/upaya/config/secrets.yml.example new file mode 100644 index 00000000000..4e9e703304d --- /dev/null +++ b/code/upaya/config/secrets.yml.example @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: e1dfd52b4cf2ce7d416cd5c99b1344c7bf56a44567f5230836e4089faf6f099cefc3d761430de52f63bdf1365f6b2ac948f467ecb1f731d74bf72ed5aae82dd9 + +test: + secret_key_base: 1b6ae780463cf5b6aaf4b9ea4c865b5b56ab53bb114d212b8b3272a874d6edcfc6b1dfc4f75c6a732b6c4d6cc670d0cfcac585df2b5f98b2e96407e6b41fda1c + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/code/upaya/db/migrate/20160405212342_add_initial_schema.rb b/code/upaya/db/migrate/20160405212342_add_initial_schema.rb new file mode 100644 index 00000000000..7af9bfc36fc --- /dev/null +++ b/code/upaya/db/migrate/20160405212342_add_initial_schema.rb @@ -0,0 +1,153 @@ +class InitialSchema < ActiveRecord::Migration + def change + create_table "app_settings", force: :cascade do |t| + t.string "name", limit: 255 + t.string "value", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "app_settings", ["name"], name: "index_app_settings_on_name", using: :btree + + create_table "authorizations", force: :cascade do |t| + t.string "provider", limit: 255 + t.string "uid", limit: 255 + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "authorized_at" + end + + add_index "authorizations", ["provider", "uid"], name: "index_authorizations_on_provider_and_uid", using: :btree + add_index "authorizations", ["user_id"], name: "index_authorizations_on_user_id", using: :btree + + create_table "identities", force: :cascade do |t| + t.string "service_provider", limit: 255 + t.string "authn_context", limit: 255 + t.datetime "last_authenticated_at" + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "session_index", limit: 4 + t.string "session_uuid", limit: 255 + t.boolean "quiz_started", default: false + end + + add_index "identities", ["service_provider", "authn_context"], name: "index_identities_on_service_provider_and_authn_context", using: :btree + add_index "identities", ["session_uuid"], name: "index_identities_on_session_uuid", unique: true, using: :btree + add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree + + create_table "old_passwords", force: :cascade do |t| + t.string "encrypted_password", limit: 255, null: false + t.string "password_salt", limit: 255 + t.string "password_archivable_type", limit: 255, null: false + t.integer "password_archivable_id", limit: 4, null: false + t.datetime "created_at" + end + + add_index "old_passwords", ["password_archivable_type", "password_archivable_id"], name: "index_password_archivable", using: :btree + + create_table "second_factors", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "second_factors", ["name"], name: "index_second_factors_on_name", unique: true, using: :btree + + create_table "second_factors_users", id: false, force: :cascade do |t| + t.integer "user_id", limit: 4, null: false + t.integer "second_factor_id", limit: 4, null: false + end + + add_index "second_factors_users", ["user_id", "second_factor_id"], name: "index_second_factors_users_on_user_id_and_second_factor_id", unique: true, using: :btree + + create_table "security_answers", force: :cascade do |t| + t.integer "question_id", limit: 4 + t.integer "user_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.string "encrypted_text", limit: 255 + t.string "encrypted_text_iv", limit: 255 + t.string "encrypted_text_salt", limit: 255 + t.integer "security_question_id", limit: 4 + end + + add_index "security_answers", ["question_id", "user_id"], name: "index_security_answers_on_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id", "user_id"], name: "index_security_answers_on_security_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id"], name: "index_security_answers_on_security_question_id", using: :btree + add_index "security_answers", ["user_id"], name: "index_security_answers_on_user_id", using: :btree + + create_table "security_questions", force: :cascade do |t| + t.text "question", limit: 65535, null: false + t.boolean "active", default: true, null: false + t.integer "old_index", limit: 4, default: 0 + end + + create_table "sessions", force: :cascade do |t| + t.string "session_id", limit: 255, null: false + t.text "data", limit: 65535 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + + create_table "users", force: :cascade do |t| + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", limit: 4, default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.string "confirmation_token", limit: 255 + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email", limit: 255 + t.integer "role", limit: 4 + t.string "otp_secret_key", limit: 255 + t.integer "second_factor_attempts_count", limit: 4, default: 0 + t.string "mobile", limit: 255 + t.string "uuid", limit: 255, null: false + t.datetime "password_changed_at" + t.datetime "second_factor_confirmed_at" + t.integer "security_question_attempts_count", limit: 4, default: 0 + t.datetime "security_questions_answered_at" + t.datetime "reset_requested_at" + t.datetime "second_factor_locked_at" + t.datetime "locked_at" + t.integer "failed_attempts", limit: 4, default: 0 + t.string "unlock_token", limit: 255 + t.integer "account_type", limit: 4 + t.datetime "mobile_confirmed_at" + t.string "unconfirmed_mobile", limit: 255 + t.integer "ial", limit: 4, default: 0, null: false + t.string "ial_token", limit: 255 + t.boolean "idp_hard_fail", default: false + t.string "encrypted_otp_secret_key", limit: 255 + t.string "encrypted_otp_secret_key_iv", limit: 255 + t.string "encrypted_otp_secret_key_salt", limit: 255 + end + + add_index "users", ["account_type"], name: "index_users_on_account_type", using: :btree + add_index "users", ["uuid"], name: "index_users_on_uuid", unique: true, using: :btree + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true, using: :btree + add_index "users", ["ial_token"], name: "index_users_on_ial_token", unique: true, using: :btree + add_index "users", ["mobile"], name: "index_users_on_mobile", using: :btree + add_index "users", ["otp_secret_key"], name: "index_users_on_otp_secret_key", unique: true, using: :btree + add_index "users", ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + add_index "users", ["unconfirmed_email"], name: "index_users_on_unconfirmed_email", using: :btree + add_index "users", ["unconfirmed_mobile"], name: "index_users_on_unconfirmed_mobile", using: :btree + add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", using: :btree + end +end diff --git a/code/upaya/db/schema.rb b/code/upaya/db/schema.rb new file mode 100644 index 00000000000..51a39ab70b0 --- /dev/null +++ b/code/upaya/db/schema.rb @@ -0,0 +1,169 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160405212342) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "app_settings", force: :cascade do |t| + t.string "name", limit: 255 + t.string "value", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "app_settings", ["name"], name: "index_app_settings_on_name", using: :btree + + create_table "authorizations", force: :cascade do |t| + t.string "provider", limit: 255 + t.string "uid", limit: 255 + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.datetime "authorized_at" + end + + add_index "authorizations", ["provider", "uid"], name: "index_authorizations_on_provider_and_uid", using: :btree + add_index "authorizations", ["user_id"], name: "index_authorizations_on_user_id", using: :btree + + create_table "identities", force: :cascade do |t| + t.string "service_provider", limit: 255 + t.string "authn_context", limit: 255 + t.datetime "last_authenticated_at" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "session_index" + t.string "session_uuid", limit: 255 + t.boolean "quiz_started", default: false + end + + add_index "identities", ["service_provider", "authn_context"], name: "index_identities_on_service_provider_and_authn_context", using: :btree + add_index "identities", ["session_uuid"], name: "index_identities_on_session_uuid", unique: true, using: :btree + add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree + + create_table "old_passwords", force: :cascade do |t| + t.string "encrypted_password", limit: 255, null: false + t.string "password_salt", limit: 255 + t.string "password_archivable_type", limit: 255, null: false + t.integer "password_archivable_id", null: false + t.datetime "created_at" + end + + add_index "old_passwords", ["password_archivable_type", "password_archivable_id"], name: "index_password_archivable", using: :btree + + create_table "second_factors", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "second_factors", ["name"], name: "index_second_factors_on_name", unique: true, using: :btree + + create_table "second_factors_users", id: false, force: :cascade do |t| + t.integer "user_id", null: false + t.integer "second_factor_id", null: false + end + + add_index "second_factors_users", ["user_id", "second_factor_id"], name: "index_second_factors_users_on_user_id_and_second_factor_id", unique: true, using: :btree + + create_table "security_answers", force: :cascade do |t| + t.integer "question_id" + t.integer "user_id" + t.datetime "created_at" + t.datetime "updated_at" + t.string "encrypted_text", limit: 255 + t.string "encrypted_text_iv", limit: 255 + t.string "encrypted_text_salt", limit: 255 + t.integer "security_question_id" + end + + add_index "security_answers", ["question_id", "user_id"], name: "index_security_answers_on_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id", "user_id"], name: "index_security_answers_on_security_question_id_and_user_id", unique: true, using: :btree + add_index "security_answers", ["security_question_id"], name: "index_security_answers_on_security_question_id", using: :btree + add_index "security_answers", ["user_id"], name: "index_security_answers_on_user_id", using: :btree + + create_table "security_questions", force: :cascade do |t| + t.text "question", null: false + t.boolean "active", default: true, null: false + t.integer "old_index", default: 0 + end + + create_table "sessions", force: :cascade do |t| + t.string "session_id", limit: 255, null: false + t.text "data" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", unique: true, using: :btree + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + + create_table "users", force: :cascade do |t| + t.string "email", limit: 255, default: "", null: false + t.string "encrypted_password", limit: 255, default: "" + t.string "reset_password_token", limit: 255 + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip", limit: 255 + t.string "last_sign_in_ip", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.string "confirmation_token", limit: 255 + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email", limit: 255 + t.integer "role" + t.string "otp_secret_key", limit: 255 + t.integer "second_factor_attempts_count", default: 0 + t.string "mobile", limit: 255 + t.string "uuid", limit: 255, null: false + t.datetime "password_changed_at" + t.datetime "second_factor_confirmed_at" + t.integer "security_question_attempts_count", default: 0 + t.datetime "security_questions_answered_at" + t.datetime "reset_requested_at" + t.datetime "second_factor_locked_at" + t.datetime "locked_at" + t.integer "failed_attempts", default: 0 + t.string "unlock_token", limit: 255 + t.integer "account_type" + t.datetime "mobile_confirmed_at" + t.string "unconfirmed_mobile", limit: 255 + t.integer "ial", default: 0, null: false + t.string "ial_token", limit: 255 + t.boolean "idp_hard_fail", default: false + t.string "encrypted_otp_secret_key", limit: 255 + t.string "encrypted_otp_secret_key_iv", limit: 255 + t.string "encrypted_otp_secret_key_salt", limit: 255 + end + + add_index "users", ["account_type"], name: "index_users_on_account_type", using: :btree + add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree + add_index "users", ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true, using: :btree + add_index "users", ["ial_token"], name: "index_users_on_ial_token", unique: true, using: :btree + add_index "users", ["mobile"], name: "index_users_on_mobile", using: :btree + add_index "users", ["otp_secret_key"], name: "index_users_on_otp_secret_key", unique: true, using: :btree + add_index "users", ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree + add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + add_index "users", ["unconfirmed_email"], name: "index_users_on_unconfirmed_email", using: :btree + add_index "users", ["unconfirmed_mobile"], name: "index_users_on_unconfirmed_mobile", using: :btree + add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", using: :btree + add_index "users", ["uuid"], name: "index_users_on_uuid", unique: true, using: :btree + +end diff --git a/code/upaya/db/seeds.rb b/code/upaya/db/seeds.rb new file mode 100644 index 00000000000..5ee82698253 --- /dev/null +++ b/code/upaya/db/seeds.rb @@ -0,0 +1,12 @@ +require "#{Rails.root}/db/data/faq_importer" +require "#{Rails.root}/lib/security_question_populator" +include SecurityQuestionPopulator + +# create second factors (email and sms) +%w(Email Mobile).collect { |factor| SecondFactor.find_or_create_by!(name: factor) } + +AppSetting.find_or_create_by!(name: 'RegistrationsEnabled') do |setting| + setting.value = '1' +end + +# populate_security_questions unless Rails.env.test? diff --git a/code/upaya/lib/assets/.keep b/code/upaya/lib/assets/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/lib/tasks/.keep b/code/upaya/lib/tasks/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/log/.keep b/code/upaya/log/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/code/upaya/public/404.html b/code/upaya/public/404.html new file mode 100644 index 00000000000..b612547fc21 --- /dev/null +++ b/code/upaya/public/404.html @@ -0,0 +1,67 @@ + + + +You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
+If you are the application owner check the logs for more information.
+