Skip to content

Commit

Permalink
7.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Nov 13, 2024
1 parent 69a33b6 commit 6d00eb3
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 134 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gem 'activeresource'
gem 'json'
gem 'multi_json'
gem 'mysql2'
gem 'rails', '7.0.1'
gem 'rails', '~> 7.1'

gem 'aws-sdk-ec2'
gem 'aws-sdk-ssm'
Expand Down
155 changes: 89 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,90 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actioncable (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
actioncable (7.1.5)
actionpack (= 7.1.5)
activesupport (= 7.1.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5)
actionpack (= 7.1.5)
activejob (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.1)
actionpack (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activesupport (= 7.0.1)
actionmailer (7.1.5)
actionpack (= 7.1.5)
actionview (= 7.1.5)
activejob (= 7.1.5)
activesupport (= 7.1.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.1)
actionview (= 7.0.1)
activesupport (= 7.0.1)
rack (~> 2.0, >= 2.2.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.5)
actionview (= 7.1.5)
activesupport (= 7.1.5)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.1)
actionpack (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5)
actionpack (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.1)
activesupport (= 7.0.1)
actionview (7.1.5)
activesupport (= 7.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.1)
activesupport (= 7.0.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.5)
activesupport (= 7.1.5)
globalid (>= 0.3.6)
activemodel (7.0.1)
activesupport (= 7.0.1)
activemodel (7.1.5)
activesupport (= 7.1.5)
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
activerecord (7.0.1)
activemodel (= 7.0.1)
activesupport (= 7.0.1)
activerecord (7.1.5)
activemodel (= 7.1.5)
activesupport (= 7.1.5)
timeout (>= 0.4.0)
activeresource (6.1.4)
activemodel (>= 6.0)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 6.0)
activestorage (7.0.1)
actionpack (= 7.0.1)
activejob (= 7.0.1)
activerecord (= 7.0.1)
activesupport (= 7.0.1)
activestorage (7.1.5)
actionpack (= 7.1.5)
activejob (= 7.1.5)
activerecord (= 7.1.5)
activesupport (= 7.1.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.1)
activesupport (7.1.5)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
Expand All @@ -104,6 +116,7 @@ GEM
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
bcrypt_pbkdf (1.1.1)
benchmark (0.4.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.4)
Expand Down Expand Up @@ -141,6 +154,7 @@ GEM
coderay (1.1.3)
colorize (1.1.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
Expand All @@ -160,6 +174,7 @@ GEM
diffy (3.4.3)
docile (1.4.1)
domain_name (0.6.20240107)
drb (2.2.1)
ed25519 (1.3.0)
equivalent-xml (0.6.0)
nokogiri (>= 1.4.3)
Expand Down Expand Up @@ -227,6 +242,7 @@ GEM
minitest (5.25.1)
msgpack (1.7.5)
multi_json (1.15.0)
mutex_m (0.2.0)
mysql2 (0.5.6)
net-imap (0.4.18)
date
Expand Down Expand Up @@ -272,36 +288,42 @@ GEM
rack (>= 0.4)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.1)
actioncable (= 7.0.1)
actionmailbox (= 7.0.1)
actionmailer (= 7.0.1)
actionpack (= 7.0.1)
actiontext (= 7.0.1)
actionview (= 7.0.1)
activejob (= 7.0.1)
activemodel (= 7.0.1)
activerecord (= 7.0.1)
activestorage (= 7.0.1)
activesupport (= 7.0.1)
rackup (1.0.1)
rack (< 3)
webrick
rails (7.1.5)
actioncable (= 7.1.5)
actionmailbox (= 7.1.5)
actionmailer (= 7.1.5)
actionpack (= 7.1.5)
actiontext (= 7.1.5)
actionview (= 7.1.5)
activejob (= 7.1.5)
activemodel (= 7.1.5)
activerecord (= 7.1.5)
activestorage (= 7.1.5)
activesupport (= 7.1.5)
bundler (>= 1.15.0)
railties (= 7.0.1)
railties (= 7.1.5)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.1)
actionpack (= 7.0.1)
activesupport (= 7.0.1)
method_source
railties (7.1.5)
actionpack (= 7.1.5)
activesupport (= 7.1.5)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
Expand Down Expand Up @@ -347,11 +369,12 @@ GEM
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.35.0)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
ruby-prof (1.7.1)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
securerandom (0.3.2)
selenium-webdriver (4.26.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand Down Expand Up @@ -459,7 +482,7 @@ DEPENDENCIES
pry-remote
puma
rack-cache
rails (= 7.0.1)
rails (~> 7.1)
rest-client
rspec-rails
rubocop
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
include PaginationMixin
include HttpMixin
include MerrittRetryMixin
require 'streamer'
require_relative '../lib/streamer'

helper_method(
:available_groups,
Expand Down
5 changes: 2 additions & 3 deletions app/lib/group_ldap.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'rubygems'
require 'net/ldap'
require 'noid'
require 'ldap_mixin'
# require 'ldap_mixin'

module GroupLdap

Expand Down Expand Up @@ -34,7 +33,7 @@ def add(groupid, description, permissions = %w[read write], extra_classes = ['me
group_attributes = {
objectclass: ['organizationalUnit'] + extra_classes,
description: description,
arkId: "ark:/13030/#{@minter.mint}"
arkId: 'ark:/13030/12345'
}
true_or_exception(admin_ldap.add(dn: ns_dn(groupid), attributes: group_attributes))

Expand Down
4 changes: 1 addition & 3 deletions app/lib/ldap_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# mixed in modules must define ns_dn(id) and obj_filter(id) methods which differ
# for each (like a Java abstract class) as well as any specific methods for each

# require 'lib/noid'

module LdapMixin

class LdapException < RuntimeError; end
Expand All @@ -22,7 +20,7 @@ def initialize(host:, port:, base:, admin_user:, admin_password:, minter:, conne
# minter: 'http://noid.cdlib.org/nd/noidu_g9'
# connect_timeout: 60

@minter = Noid::Minter.new(minter)
puts "minter #{minter} ignored"
@base = base
@ldap_connect = {
host: host,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/merritt_retry_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def merritt_retry_block
if retries > RETRY_LIMIT
Rails.logger.error('Retries exhausted. Clearing all active connections.')
# ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.clear_all_connections!
ActiveRecord::Base.connection_handler.clear_all_connections!
# yet to try: flush_idle_connections
raise RetryException, e
end
Expand Down
4 changes: 2 additions & 2 deletions app/lib/user_ldap.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rubygems'
require 'net/ldap'
# require 'lib/ldap_mixin'
# require 'ldap_mixin'

module UserLdap
class Server
Expand Down Expand Up @@ -29,7 +29,7 @@ def add(userid, password, firstname, lastname, email)
cn: "#{firstname} #{lastname}",
displayName: "#{firstname} #{lastname}",
userPassword: password,
arkId: "ark:/13030/#{@minter.mint}",
arkId: 'ark:/13030/12345',
mail: email
}
true_or_exception(admin_ldap.add(dn: ns_dn(userid), attributes: attr))
Expand Down
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require "fileutils"
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
system(*args, exception: true)
end

FileUtils.chdir APP_ROOT do
Expand Down
7 changes: 6 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
module MrtDashboard
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.load_defaults 7.1

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])

# Configuration for the application, engines, and railties goes here.
#
Expand Down
8 changes: 7 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
config.enable_reloading = true

# Do not eager load code on boot.
config.eager_load = false
Expand Down Expand Up @@ -56,6 +56,9 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Suppress logger output for asset requests.
config.assets.quiet = true

Expand All @@ -67,4 +70,7 @@

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true

# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = false
end
Loading

0 comments on commit 6d00eb3

Please sign in to comment.