Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/bundler/rexml-3.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Dantemss authored Jan 7, 2025
2 parents 9216891 + e8bb4ba commit 6c043b8
Show file tree
Hide file tree
Showing 31 changed files with 168 additions and 262 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
19 changes: 7 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ gem 'puma_worker_killer'
gem 'knockoutjs-rails'

# Using this branch in pattern library due to multiselect (until it's merged to master)
gem 'pattern-library', git: 'https://github.com/openstax/pattern-library.git', ref: 'c3dd0b2c8ed987f9089b7da302fb02d2fc4cd840'
gem 'pattern-library', github: 'openstax/pattern-library', ref: 'c3dd0b2c8ed987f9089b7da302fb02d2fc4cd840'

# Lev framework
# - introduces two new concepts: Routines and Handlers
gem 'lev', github: 'lml/lev', ref: 'a33c93c83afea63c80b5da6317efec4bfd357df5'
gem 'openstax_transaction_retry', github: 'openstax/transaction_retry', ref: '36e26d0a068756c334b9d1c671d40773bbfc9300'
gem 'openstax_transaction_isolation', github: 'openstax/transaction_isolation', ref: '7387fa091462118704967a7c4b2821cd0f5d9e01'
# Lev framework - introduces two new concepts: Routines and Handlers
gem 'lev'
gem 'openstax_transaction_retry'
gem 'openstax_transaction_isolation'

# SCSS stylesheets
gem 'sass-rails'
Expand Down Expand Up @@ -123,7 +122,7 @@ gem 'representable'
gem 'keyword_search'

# ToS/PP management
gem 'fine_print', github: 'lml/fine_print', ref: '636023f68e95196dffaf295bfad3ad8051c23542'
gem 'fine_print'

# Send users back to the correct page after login
gem 'action_interceptor'
Expand Down Expand Up @@ -170,7 +169,7 @@ gem 'openstax_path_prefixer', github: 'openstax/path_prefixer', ref: 'e3edfc7058
gem 'json-jwt'

# international country codes javascript plugin
gem 'intl-tel-input-rails', git: 'https://github.com/openstax/intl-tel-input-rails.git', branch: 'master'
gem 'intl-tel-input-rails', github: 'openstax/intl-tel-input-rails', branch: 'master'

# internationalization based on the `HTTP_ACCEPT_LANGUAGE` header sent by browsers
gem 'http_accept_language'
Expand Down Expand Up @@ -225,10 +224,6 @@ group :development, :test do
# Codecov integration
gem 'codecov', require: false

# Speedup Rails boot time
gem 'spring'
gem 'spring-commands-rspec'

# Run specs when files change
gem 'guard-rspec'
gem 'guard-livereload', require: false
Expand Down
106 changes: 39 additions & 67 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
GIT
remote: https://github.com/lml/fine_print.git
revision: 636023f68e95196dffaf295bfad3ad8051c23542
ref: 636023f68e95196dffaf295bfad3ad8051c23542
specs:
fine_print (6.0.1)
action_interceptor
jquery-rails
rails (< 7)
responders

GIT
remote: https://github.com/lml/lev.git
revision: a33c93c83afea63c80b5da6317efec4bfd357df5
ref: a33c93c83afea63c80b5da6317efec4bfd357df5
specs:
lev (13.0.0)
actionpack (>= 4.2)
active_attr
activejob
activemodel (>= 6.1)
activerecord (>= 4.2)
hashie
openstax_transaction_isolation
openstax_transaction_retry

GIT
remote: https://github.com/openstax/intl-tel-input-rails.git
revision: 3a63a495822d90bc9ca93e9541ef252fd7a0b50b
Expand All @@ -49,23 +23,6 @@ GIT
specs:
pattern-library (1.1.18)

GIT
remote: https://github.com/openstax/transaction_isolation.git
revision: 7387fa091462118704967a7c4b2821cd0f5d9e01
ref: 7387fa091462118704967a7c4b2821cd0f5d9e01
specs:
openstax_transaction_isolation (2.0.0)
activerecord (>= 6)

GIT
remote: https://github.com/openstax/transaction_retry.git
revision: 36e26d0a068756c334b9d1c671d40773bbfc9300
ref: 36e26d0a068756c334b9d1c671d40773bbfc9300
specs:
openstax_transaction_retry (2.0.0)
activerecord (>= 6)
openstax_transaction_isolation (>= 2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -269,7 +226,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.4)
date (3.4.1)
db-query-matchers (0.13.0)
activesupport (>= 4.0, < 7.3)
rspec (>= 3.0)
Expand Down Expand Up @@ -297,7 +254,7 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
error_page_assets (0.4)
erubi (1.13.0)
erubi (1.13.1)
eventmachine (1.2.7)
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
Expand Down Expand Up @@ -342,6 +299,11 @@ GEM
faraday_middleware (1.2.1)
faraday (~> 1.0)
ffi (1.16.3)
fine_print (6.0.3)
action_interceptor
jquery-rails
rails (< 7)
responders
font-awesome-rails (4.7.0.8)
railties (>= 3.2, < 8.0)
formatador (1.1.0)
Expand Down Expand Up @@ -417,6 +379,15 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lev (13.0.0)
actionpack (>= 4.2)
active_attr
activejob
activemodel (>= 6.1)
activerecord (>= 4.2)
hashie
openstax_transaction_isolation
openstax_transaction_retry
libv8-node (18.19.0.0)
libv8-node (18.19.0.0-x86_64-darwin)
libv8-node (18.19.0.0-x86_64-linux)
Expand All @@ -429,7 +400,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.23.0)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.10)
Expand All @@ -446,16 +417,16 @@ GEM
railties (>= 3.0.0, < 8)
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
mini_portile2 (2.8.8)
mini_racer (0.16.0)
libv8-node (~> 18.19.0.0)
minitest (5.25.1)
minitest (5.25.4)
msgpack (1.7.3)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.4.1)
nenv (0.3.0)
net-imap (0.5.0)
net-imap (0.5.5)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -464,13 +435,13 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.7)
nio4r (2.7.4)
nokogiri (1.18.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.18.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.18.1-x86_64-linux-gnu)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -539,6 +510,11 @@ GEM
openstax_active_force
rails (>= 5.0, < 7.0)
restforce
openstax_transaction_isolation (2.0.0)
activerecord (>= 6)
openstax_transaction_retry (2.0.0)
activerecord (>= 6)
openstax_transaction_isolation (>= 2)
openstax_utilities (5.1.2)
aws-sdk-autoscaling
faraday
Expand Down Expand Up @@ -584,7 +560,7 @@ GEM
rack (>= 2.0.0)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack-test (2.2.0)
rack (>= 1.3)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
Expand Down Expand Up @@ -614,9 +590,9 @@ GEM
activesupport (>= 4.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.6.0)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (~> 1.14)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
Expand Down Expand Up @@ -761,9 +737,6 @@ GEM
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
spring (4.2.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.5)
base64
concurrent-ruby (~> 1.0)
Expand All @@ -780,7 +753,7 @@ GEM
thor (1.3.2)
tilt (2.4.0)
timecop (0.9.10)
timeout (0.4.1)
timeout (0.4.3)
trailblazer-option (0.1.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand All @@ -805,7 +778,8 @@ GEM
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-driver (0.7.7)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
Expand Down Expand Up @@ -858,7 +832,7 @@ DEPENDENCIES
faraday
faraday_middleware
ffi (< 1.17)
fine_print!
fine_print
font-awesome-rails
guard-livereload
guard-rspec
Expand All @@ -872,7 +846,7 @@ DEPENDENCIES
keyword_search
knockoutjs-rails
launchy
lev!
lev
listen
lograge
maruku
Expand All @@ -890,8 +864,8 @@ DEPENDENCIES
openstax_path_prefixer!
openstax_rescue_from
openstax_salesforce
openstax_transaction_isolation!
openstax_transaction_retry!
openstax_transaction_isolation
openstax_transaction_retry
openstax_utilities
p3p
parallel_tests
Expand Down Expand Up @@ -923,8 +897,6 @@ DEPENDENCIES
sentry-ruby
shoulda-matchers
smarter_csv
spring
spring-commands-rspec
timecop
uglifier
vcr
Expand Down
2 changes: 1 addition & 1 deletion app/handlers/create_external_user_credentials.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def handle
password_confirmation: signup_params.password
)

run Newflow::CreateEmailForUser, email: signup_params.email, user: outputs.user
run Newflow::CreateEmailForUser, email: signup_params.email, user: outputs.user, show_pin: false

agree_to_terms if signup_params.terms_accepted
end
Expand Down
5 changes: 3 additions & 2 deletions app/mailers/newflow_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ def reset_password_email(user:, email_address:)
subject: "Reset your OpenStax password"
end

def signup_email_confirmation(email_address:)
@should_show_pin = ConfirmByPin.sequential_failure_for(email_address).attempts_remaining?
def signup_email_confirmation(email_address:, show_pin: true)
@should_show_pin = show_pin != false &&
ConfirmByPin.sequential_failure_for(email_address).attempts_remaining?
@email_value = email_address.value
@confirmation_pin = email_address.confirmation_pin
@confirmation_code = email_address.confirmation_code
Expand Down
13 changes: 3 additions & 10 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ class User < ApplicationRecord
before_validation(:strip_fields)
before_validation(:remove_special_chars)

before_validation(
:generate_uuid, :generate_support_identifier,
on: :create
)
before_validation(:generate_uuid, on: :create)

validate(:ensure_names_continue_to_be_present)
validate(
Expand Down Expand Up @@ -125,7 +122,7 @@ class User < ApplicationRecord

validates(:login_token, uniqueness: { allow_nil: true })

validates(:uuid, :support_identifier, presence: true, uniqueness: true)
validates(:uuid, presence: true, uniqueness: true)

validate :books_used_details_valid

Expand Down Expand Up @@ -160,7 +157,7 @@ class User < ApplicationRecord

delegate_to_routine :destroy

attr_readonly :uuid, :support_identifier
attr_readonly :uuid

attribute :is_not_gdpr_location, :boolean, default: nil

Expand Down Expand Up @@ -450,10 +447,6 @@ def generate_uuid
self.uuid ||= SecureRandom.uuid
end

def generate_support_identifier(length: 4)
self.support_identifier ||= "cs_#{SecureRandom.hex(length)}"
end

protected

def make_first_user_an_admin
Expand Down
5 changes: 0 additions & 5 deletions app/representers/api/v1/find_or_create_user_representer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class FindOrCreateUserRepresenter < Roar::Decorator
readable: true,
writeable: false

property :support_identifier,
type: String,
readable: true,
writeable: false

property :external_id,
type: String,
readable: false,
Expand Down
5 changes: 0 additions & 5 deletions app/representers/api/v1/find_user_representer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ class FindUserRepresenter < Roar::Decorator
readable: true,
writeable: true

property :support_identifier,
type: String,
readable: true,
writeable: false

property :external_id,
type: String,
readable: false,
Expand Down
Loading

0 comments on commit 6c043b8

Please sign in to comment.