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

Add authentication #41

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8126672
Added developer setup instructions to README
nwalker2398 Mar 11, 2024
0126484
Added redis and resque config files
nwalker2398 Mar 11, 2024
41afba8
Added new ymls to gitignore and deployment, setup resque wroker resta…
nwalker2398 Mar 11, 2024
450a014
created atc.rb initializer and atc config file ad added resque config…
nwalker2398 Mar 11, 2024
bf2d363
Added resque gem. Confirmed queue is working properly by running resq…
nwalker2398 Mar 11, 2024
addad85
WIP implemented create_pending_transfer_job
nwalker2398 Mar 11, 2024
633af6a
Added /resque/overview route
nwalker2398 Mar 11, 2024
3d92dd2
added queues.rb
nwalker2398 Mar 11, 2024
a23e06c
Added resque rake tasks
nwalker2398 Mar 11, 2024
0b27038
Style fixes
nwalker2398 Mar 11, 2024
2c2afa5
Revert "Added resque rake tasks"
nwalker2398 Mar 11, 2024
5a5e466
Revert "Style fixes"
nwalker2398 Mar 11, 2024
2153ed9
re-added resque.rake
nwalker2398 Mar 11, 2024
5a6c176
Merged db-restructuring-plus-pending-transfer-model to add pending_tr…
nwalker2398 Mar 13, 2024
0624706
Added atc:pending_transfers:from_transfer_source rake task
nwalker2398 Mar 13, 2024
579f48f
Added x86_64-linux platform to Gemfile.lock
nwalker2398 Mar 13, 2024
bc48de8
Added missing end keywords in pending_transfers.rake
nwalker2398 Mar 13, 2024
f3b4523
changed refernces to PendingTransfer model to TransferSource model
nwalker2398 Mar 15, 2024
7ee6494
Finished resolving all rubocop offenses
nwalker2398 Mar 15, 2024
d5763ae
Added create_pending_transfer_job tests
nwalker2398 Mar 15, 2024
a0e6d3a
bug fixes in create_pending_transfer_job, now passing tests
nwalker2398 Mar 15, 2024
f91a147
Added simplecov to project
nwalker2398 Mar 15, 2024
1ef950a
shortened some lines in create_pending_transfer_job_spec
nwalker2398 Mar 15, 2024
1ae2062
specfile bugfix
nwalker2398 Mar 15, 2024
0de6328
Fixes for multi-part checksum calculation
nwalker2398 Mar 15, 2024
2e1ad7a
Shortened line in multipart checksum calculation
nwalker2398 Mar 15, 2024
2fc0fc9
changed refernces to transfer_source to source_object in pending_tran…
nwalker2398 Mar 15, 2024
f6347d4
WIP adding a test on create_pending_transfer_job for files over the m…
nwalker2398 Mar 15, 2024
e208e81
Set tempfile.create to be writing in binary mode
nwalker2398 Mar 15, 2024
fa8aa70
temporarily commented out multipart test to enable CI testing of new …
nwalker2398 Mar 29, 2024
2249374
Added devise and omniauth to repo
nwalker2398 Mar 29, 2024
9c1d8b9
Finished implementing authentication at /users/sign_in, only authenti…
nwalker2398 Apr 1, 2024
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
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,12 @@
/config/master.key

# Config file ignores
/config/database.yml
/config/atc.yml
/config/aws.yml
/config/database.yml
/config/permissions.yml
/config/redis.yml
/config/resque.yml

# simplecov coverage report
/coverage
21 changes: 21 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-03-29 17:05:57 UTC using RuboCop version 1.62.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AutoCorrect.
Lint/UselessAssignment:
Exclude:
- 'app/controllers/users/omniauth_callbacks_controller.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 162
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ gem 'rails', '~> 7.1.3', '>= 7.1.3.2'
gem 'rainbow', '~> 3.0'
# Use Redis adapter to run Action Cable in production
gem 'redis', '>= 4.0.1'
# Resque for queued jobs
gem 'resque', '~> 2.6'
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
Expand All @@ -33,6 +35,11 @@ gem 'turbo-rails'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[windows jruby]

# Use devise and omniauth for authentication
gem 'devise'
gem 'omniauth'
gem 'omniauth-cul', '~> 0.2.0'

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

Expand Down Expand Up @@ -67,6 +74,9 @@ group :development do

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"

# simplecov for test coverage
gem 'simplecov', '~> 0.22', require: false
end

group :test do
Expand Down
90 changes: 70 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,12 @@ GEM
airbrussh (1.5.1)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
aws-crt (0.2.0-aarch64-linux)
ffi
aws-crt (0.2.0-arm64-darwin)
ffi
aws-crt (0.2.0-x86_64-linux)
ffi
aws-eventstream (1.3.0)
aws-partitions (1.894.0)
aws-partitions (1.896.0)
aws-sdk-core (3.191.3)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand All @@ -96,25 +94,26 @@ GEM
aws-sdk-kms (1.77.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.143.0)
aws-sdk-s3 (1.143.1)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
bigdecimal (3.1.6)
bindex (0.8.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.2.4)
capistrano (3.18.0)
capistrano (3.18.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (1.6.0)
capistrano-bundler (2.1.0)
capistrano (~> 3.1)
capistrano-cul (0.1.7)
bcrypt_pbkdf (>= 1.0.1)
Expand Down Expand Up @@ -145,9 +144,16 @@ GEM
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
devise (4.9.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.5.1)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
docile (1.4.0)
drb (2.2.1)
ed25519 (1.3.0)
erubi (1.12.0)
Expand All @@ -159,14 +165,15 @@ GEM
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
hashie (5.0.0)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
importmap-rails (2.0.1)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.7.2)
irb (1.11.2)
irb (1.12.0)
rdoc
reline (>= 0.4.2)
jbuilder (2.11.5)
Expand All @@ -183,11 +190,15 @@ GEM
net-imap
net-pop
net-smtp
marcel (1.0.2)
marcel (1.0.4)
matrix (0.4.2)
mini_mime (1.1.5)
minitest (5.22.2)
mono_logger (1.1.2)
msgpack (1.7.2)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0)
mysql2 (0.5.6)
net-imap (0.4.10)
Expand All @@ -205,12 +216,18 @@ GEM
net-protocol
net-ssh (7.2.1)
nio4r (2.7.0)
nokogiri (1.16.2-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
omniauth (2.1.2)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-cul (0.2.0)
devise (>= 4.9)
omniauth (>= 2.0)
orm_adapter (0.5.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand All @@ -222,6 +239,9 @@ GEM
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.9.1)
rack-protection (4.0.0)
base64 (>= 0.1.0)
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
Expand Down Expand Up @@ -264,11 +284,21 @@ GEM
psych (>= 4.0.0)
redis (5.1.0)
redis-client (>= 0.17.0)
redis-client (0.20.0)
redis-client (0.21.0)
connection_pool
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.9.0)
reline (0.4.2)
reline (0.4.3)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
resque (2.6.0)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.6)
sinatra (>= 0.9.2)
rexml (3.2.6)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
Expand All @@ -286,7 +316,7 @@ GEM
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.13.0)
rspec-support (3.13.1)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand Down Expand Up @@ -328,19 +358,32 @@ GEM
rubocop-rails
rubocop-rspec
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.16.0)
selenium-webdriver (4.18.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (4.0.0)
mustermann (~> 3.0)
rack (>= 3.0.0, < 4)
rack-protection (= 4.0.0)
rack-session (>= 2.0.0, < 3)
tilt (~> 2.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.7.2-aarch64-linux)
sqlite3 (1.7.2-arm64-darwin)
sqlite3 (1.7.2-x86_64-linux)
sshkit (1.22.0)
Expand All @@ -351,15 +394,18 @@ GEM
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
thor (1.3.0)
thor (1.3.1)
tilt (2.3.0)
timeout (0.4.1)
turbo-rails (2.0.3)
turbo-rails (2.0.5)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand All @@ -375,8 +421,7 @@ GEM
zeitwerk (2.6.13)

PLATFORMS
aarch64-linux
arm64-darwin-21
arm64-darwin-22
x86_64-linux

DEPENDENCIES
Expand All @@ -389,18 +434,23 @@ DEPENDENCIES
capistrano-rails (~> 1.4)
capybara
debug
devise
digest-crc (~> 0.6.5)
factory_bot_rails
importmap-rails
jbuilder
mysql2 (~> 0.5.6)
omniauth
omniauth-cul (~> 0.2.0)
puma (~> 6.0)
rails (~> 7.1.3, >= 7.1.3.2)
rainbow (~> 3.0)
redis (>= 4.0.1)
resque (~> 2.6)
rspec-rails
rubocul (~> 4.0.10)
selenium-webdriver
simplecov (~> 0.22)
sprockets-rails
sqlite3 (~> 1.4)
stimulus-rails
Expand All @@ -409,4 +459,4 @@ DEPENDENCIES
web-console

BUNDLED WITH
2.4.10
2.4.22
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# "Air Traffic Control"

DLST app for managing data flights to cloud storage.


**First-Time Setup (for developers)**
Clone the repository.
`git clone [email protected]:cul/atc.git`

Install gem dependencies.
`bundle install`

Set up config files.
`bundle exec rake atc:setup:config_files`

Run database migrations.
`bundle exec rake db:migrate`

Seed the database with necessary values for operation.
`rails db:seed`

Start the application using `rails server`.
`rails s -p 3000`
5 changes: 5 additions & 0 deletions app/controlers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class PagesController < ApplicationController
def home; end
end
21 changes: 21 additions & 0 deletions app/controllers/users/development_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

class Users::DevelopmentController < Devise::SessionsController
# Log in with a development account instead of the default CAS login.
# Used only in the development environment, as a convenience.
def sign_in_developer
return unless Rails.env.development?

unless user_signed_in?
dev_user = User.find_by(
uid: DEVELOPMENT_USER_CONFIG[:uid]
) || User.create!(DEVELOPMENT_USER_CONFIG)

sign_in(dev_user, scope: :user)
end

redirect_to root_path
end

def output_current_user; end
end
Loading
Loading