Skip to content

Commit

Permalink
Merge branch 'prod'
Browse files Browse the repository at this point in the history
  • Loading branch information
mfall3 committed Nov 11, 2024
2 parents 67155ab + 8ac01aa commit e5782dd
Show file tree
Hide file tree
Showing 91 changed files with 390 additions and 1,525 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@


// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bin/setup"
"postCreateCommand": "bin/setup_local"
}
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ gem "valid_email"
# Use boostrap-datepicker-rails for selecting release date
# gem 'bootstrap-datepicker-rails'

# Use identity strategy to create local accounts for testing
gem "omniauth-identity"
# Use shibboleth strategy for omniauth -- NetID login
gem "omniauth-shibboleth"

gem "omniauth-rails_csrf_protection"
Expand Down
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1774,9 +1774,6 @@ GEM
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-identity (3.0.9)
bcrypt
omniauth
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
Expand Down Expand Up @@ -2061,7 +2058,6 @@ DEPENDENCIES
net-ldap (~> 0.16.2)
nokogiri
nokogiri-diff
omniauth-identity
omniauth-rails_csrf_protection
omniauth-shibboleth
open_uri_redirections
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![DOI](https://zenodo.org/badge/12882/medusa-project/databank.svg)](https://zenodo.org/badge/latestdoi/12882/medusa-project/databank)
# Databank

Databank is the Ruby on Rails web application component of Illinois Data Bank, which is a public access repository for research data from the University of Illinois at Urbana-Champaign.
Databank is the Ruby on Rails web application component of Illinois Data Bank, which is a public access repository for research data from the University of Illinois Urbana-Champaign.

Application documentation is hosted in the
[SCARS Wiki](https://wiki.illinois.edu/wiki/display/scrs/SCARS+Home).
8 changes: 4 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ def record_not_found(exception)

private

# @return [User::Shibboleth, User::Identity] the current user
# @return [User] the current user
def current_user
if session[:user_id]
@current_user = User::Shibboleth.find(session[:user_id]) || User::Identity.find(session[:user_id])
@current_user = User.find(session[:user_id])
end
rescue ActiveRecord::RecordNotFound
session[:user_id] = nil
end

##
# sets the current user
# @param [User::Shibboleth, User::Identity] user
# @return [User::Shibboleth, User::Identity] the current user
# @param [User] user
# @return [User] the current user
def set_current_user(user)
@current_user = user
session[:current_user_id] = user.id
Expand Down
71 changes: 0 additions & 71 deletions app/controllers/data_curation_network_controller.rb

This file was deleted.

20 changes: 18 additions & 2 deletions app/controllers/datafiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,24 @@ def download

# Called from download action or to download a file without recording the download for drafts/curators/testing
def download_no_record

if @datafile.current_root.root_type == :filesystem
if Rails.env == "development" || Rails.env == "test"
case @datafile.storage_root
when "draft"
root = StorageManager.instance.draft_root
when "medusa"
root = StorageManager.instance.medusa_root
else
raise "invalid storage root for datafile web_id: #{@datafile.web_id}, id: #{@datafile.id}"
end
expanded_key = "#{root.prefix}#{@datafile.storage_key}"
# DEBUG
Rails.logger.warn "expanded_key: #{expanded_key}"
Rails.logger.warn "binary_name: #{@datafile.binary_name}"
# Use the Application.aws_client to get the object from the bucket found at @datafile.storage_root and the expanded_key, then download it to the browser
object = Application.aws_client.get_object(bucket: root.bucket, key: expanded_key)
send_data object.body.read, filename: @datafile.binary_name, type: safe_content_type(@datafile)
return
elsif @datafile.current_root.root_type == :filesystem
@datafile.with_input_file do |input_file|
path = @datafile.current_root.path_to(@datafile.storage_key, check_path: true)
send_file path, filename: @datafile.binary_name, type: safe_content_type(@datafile)
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/datasets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ def import_from_globus
def index
if current_user
user_role = current_user.role
user = User::Shibboleth.find_by(email: current_user&.email)
user ||= User::Identity.find_by(email: current_user&.email)
user = User.find_by(email: current_user&.email)
else
user_role = Databank::UserRole::GUEST
user = nil
Expand Down
82 changes: 0 additions & 82 deletions app/controllers/identities_controller.rb

This file was deleted.

107 changes: 0 additions & 107 deletions app/controllers/invitees_controller.rb

This file was deleted.

Loading

0 comments on commit e5782dd

Please sign in to comment.