Skip to content

Commit

Permalink
Merge branch 'release/6.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Sep 26, 2022
2 parents 9ac2981 + 25dfcd6 commit 14c434c
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 267 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts next release notes as Pull Requests are merged into "develop"
- uses: toolmantim/release-drafter@v5.20.1
- uses: toolmantim/release-drafter@v5.21.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ gem 'devise', '~>4.8.1'
gem 'ruby-saml', '~> 1.14.0'

# omniauth
gem 'omniauth-google-oauth2', '~> 1.1.1'
gem 'omniauth-oauth2', '~> 1.8.0'
gem 'omniauth-google-oauth2', '~> 0.8.2'
gem 'omniauth-oauth2', '~> 1.7.2'
gem 'omniauth_openid_connect', '~> 0.4.0'
gem 'omniauth-rails_csrf_protection', '~> 1.0.1'

# Json webtokens
gem 'jwt', '~> 2.5.0'
Expand Down Expand Up @@ -136,7 +135,7 @@ gem 'memory_profiler', '~> 1.0.0'
gem 'rack-mini-profiler', '~> 3.0.0'
gem 'stackprof', '~> 0.2.21'

gem 'ddtrace', '~> 1.4.0'
gem 'ddtrace', '~> 1.4.1'

# Make sure filesystem changes only happen at the end of a transaction
gem 'after_commit_everywhere', '~> 1.2.2'
Expand Down Expand Up @@ -178,7 +177,7 @@ group :development do
gem 'web-console', '~> 4.2.0'

gem 'rb-readline', '~> 0.5.5' # require for irb
gem 'rubocop-rails', '~> 2.16.0'
gem 'rubocop-rails', '~> 2.16.1'

# for opening letters
gem 'letter_opener', '~> 1.8.1'
Expand Down
66 changes: 29 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ GEM
after_commit_everywhere (1.2.2)
activerecord (>= 4.2)
activesupport
airbrussh (1.4.0)
airbrussh (1.4.1)
sshkit (>= 1.6.1, != 1.7.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
Expand All @@ -91,7 +91,7 @@ GEM
bootstrap_tokenfield_rails (0.12.1)
builder (3.2.4)
byebug (11.1.3)
capistrano (3.17.0)
capistrano (3.17.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -133,7 +133,7 @@ GEM
railties (>= 6.0.0)
daemons (1.4.1)
dalli (3.2.2)
ddtrace (1.4.0)
ddtrace (1.4.1)
debase-ruby_core_source (= 0.10.16)
libdatadog (~> 0.7.0.1.1)
libddwaf (~> 1.3.0.2.0)
Expand Down Expand Up @@ -166,7 +166,7 @@ GEM
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
excon (0.92.3)
excon (0.92.4)
execjs (2.8.1)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
Expand All @@ -181,7 +181,7 @@ GEM
faraday-net_http (3.0.0)
ffi (1.15.5)
flamegraph (0.9.5)
glob (0.3.0)
glob (0.3.1)
globalid (1.0.0)
activesupport (>= 5.0)
has_scope (0.8.0)
Expand Down Expand Up @@ -213,10 +213,11 @@ GEM
jsbundling-rails (1.0.3)
railties (>= 6.0.0)
json (2.6.2)
json-jwt (1.14.0)
json-jwt (1.15.3)
activesupport (>= 4.2)
aes_key_wrap
bindata
httpclient
json-schema (3.0.0)
addressable (>= 2.8)
jwt (2.5.0)
Expand Down Expand Up @@ -283,36 +284,32 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
oauth2 (2.0.8)
oauth2 (1.4.10)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (2.1.0)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
omniauth-google-oauth2 (1.1.1)
rack (>= 1.6.2, < 3)
omniauth-google-oauth2 (0.8.2)
jwt (>= 2.0)
oauth2 (~> 2.0.6)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8.0)
omniauth-oauth2 (1.8.0)
oauth2 (~> 1.1)
omniauth (~> 1.1)
omniauth-oauth2 (>= 1.6)
omniauth-oauth2 (1.7.3)
oauth2 (>= 1.4, < 3)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth (>= 1.9, < 3)
omniauth_openid_connect (0.4.0)
addressable (~> 2.5)
omniauth (>= 1.9, < 3)
openid_connect (~> 1.1)
openid_connect (1.3.0)
openid_connect (1.3.1)
activemodel
attr_required (>= 1.0.0)
json-jwt (>= 1.5.0)
net-smtp
rack-oauth2 (>= 1.6.1)
swd (>= 1.0.0)
tzinfo
Expand Down Expand Up @@ -341,7 +338,7 @@ GEM
rack (2.2.4)
rack-mini-profiler (3.0.0)
rack (>= 1.2.0)
rack-oauth2 (1.19.0)
rack-oauth2 (1.21.2)
activesupport
attr_required
httpclient
Expand Down Expand Up @@ -386,7 +383,7 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-readline (0.5.5)
Expand All @@ -408,7 +405,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
rubocop-rails (2.16.0)
rubocop-rails (2.16.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand Down Expand Up @@ -437,17 +434,14 @@ GEM
rack-protection (= 2.2.2)
tilt (~> 2.0)
slack-notifier (2.4.0)
snaky_hash (2.0.0)
hashie
version_gem (~> 1.1)
sprockets (4.1.0)
sprockets (4.1.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.2)
sshkit (1.21.3)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.21)
Expand All @@ -464,14 +458,13 @@ GEM
timeout (0.3.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (2.2.0)
unicode-display_width (2.3.0)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
version_gem (1.1.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.0)
Expand Down Expand Up @@ -517,7 +510,7 @@ DEPENDENCIES
codecov (~> 0.6.0)
cssbundling-rails (~> 1.1.1)
dalli (~> 3.2.2)
ddtrace (~> 1.4.0)
ddtrace (~> 1.4.1)
delayed_job_active_record (~> 4.1.7)
delayed_job_web (~> 1.4.4)
devise (~> 4.8.1)
Expand Down Expand Up @@ -549,9 +542,8 @@ DEPENDENCIES
mocha (~> 1.14.0)
mysql2 (~> 0.5.4)
nokogiri (~> 1.13.8)
omniauth-google-oauth2 (~> 1.1.1)
omniauth-oauth2 (~> 1.8.0)
omniauth-rails_csrf_protection (~> 1.0.1)
omniauth-google-oauth2 (~> 0.8.2)
omniauth-oauth2 (~> 1.7.2)
omniauth_openid_connect (~> 0.4.0)
premailer-rails (~> 1.11.1)
pretender (~> 0.4.0)
Expand All @@ -563,7 +555,7 @@ DEPENDENCIES
rails-i18n (~> 7.0.5)
rb-readline (~> 0.5.5)
rouge (= 4.0.0)
rubocop-rails (~> 2.16.0)
rubocop-rails (~> 2.16.1)
ruby-saml (~> 1.14.0)
rubyzip (~> 2.3.2)
selenium-webdriver (~> 4.4.0)
Expand Down
11 changes: 10 additions & 1 deletion app/controllers/auth/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def privacy_prompt
end

def accept_privacy_policy
# If we end up on this page without the relevant session info, redirect to root
return redirect_to root_path if auth_hash.blank?

identity = create_new_user_and_identity!

sign_in!(identity)
Expand All @@ -64,6 +67,9 @@ def accept_privacy_policy
# Confirm duplicate email before new user creation

def confirm_new_user
# If we end up on this page without the relevant session info, redirect to root
return redirect_to root_path if auth_hash.blank?

@institution = provider.institution
@users = User.where(email: auth_email)
@email = auth_email
Expand All @@ -72,6 +78,9 @@ def confirm_new_user
end

def accept_confirm_new_user
# If we end up on this page without the relevant session info, redirect to root
return redirect_to root_path if auth_hash.blank?

# Redirect to privacy prompt before we create a new private user
return redirect_to_privacy_prompt if provider&.institution.nil?

Expand Down Expand Up @@ -202,7 +211,7 @@ def create_identity_from_session!(user)

# Set a flash message.
set_flash_message :notice, :identity_created, provider: original_provider.readable_name
if session[:hide_flash].blank? && original_provider.issuer == 'https://ufora.ugent.be'
if session[:hide_flash].blank? && (original_provider.issuer == 'https://ufora.ugent.be' || original_provider.issuer == 'https://uforatest.ugent.be')
# Set a Ufora/UGent specific flash message.
set_flash_message :notice, :linked
end
Expand Down
6 changes: 3 additions & 3 deletions app/views/auth/_provider_button.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% institution = provider.institution %>

<% if provider.type == "Provider::Saml" %>
<%= link_to omniauth_authorize_path(:user, Provider::Saml.sym, provider: provider), method: :post, class: 'institution-sign-in col-md-6 col-xl-4' do %>
<%= link_to omniauth_authorize_path(:user, Provider::Saml.sym, provider: provider), class: 'institution-sign-in col-md-6 col-xl-4' do %>
<div class="option-btn">
<div class="option-btn-img">
<%= image_tag institution_logo(institution.logo), class: "img-fluid" %>
Expand All @@ -15,7 +15,7 @@
</div>
<% end %>
<% elsif provider.type == "Provider::Oidc" %>
<%= link_to omniauth_authorize_path(:user, Provider::Oidc.sym, provider: provider), method: :post, class: 'institution-sign-in col-md-6 col-xl-4' do %>
<%= link_to omniauth_authorize_path(:user, Provider::Oidc.sym, provider: provider), class: 'institution-sign-in col-md-6 col-xl-4' do %>
<div class="option-btn">
<div class="option-btn-img">
<%= image_tag institution_logo(institution.logo), class: "img-fluid" %>
Expand All @@ -29,7 +29,7 @@
</div>
<% end %>
<% else %>
<%= link_to omniauth_authorize_path(:user, provider.class.sym), method: :post, class: 'institution-sign-in col-md-6 col-xl-4' do %>
<%= link_to omniauth_authorize_path(:user, provider.class.sym), class: 'institution-sign-in col-md-6 col-xl-4' do %>
<div class="option-btn">
<div class="option-btn-img">
<%= image_tag institution_logo(institution&.logo || provider.logo), class: "img-fluid" %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/auth/sign_in.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
<div class="sign-in-dialog-institutions row">
<% @generic_providers.each do |provider| %>
<%= link_to omniauth_authorize_path(:user, provider.sym), method: :post, class: 'institution-sign-in col-md-6 col-xl-4' do %>
<%= link_to omniauth_authorize_path(:user, provider.sym), class: 'institution-sign-in col-md-6 col-xl-4' do %>
<div class="option-btn">
<div class="option-btn-img">
<%= image_tag "idp/#{provider.logo}", class: "img-fluid" %>
Expand Down Expand Up @@ -68,7 +68,7 @@
</div>
<div class="sign-in-dialog-institutions row">
<% @private_providers.each do |provider| %>
<%= link_to omniauth_authorize_path(:user, provider.class.sym), method: :post, class: 'institution-sign-in col-md-6 col-xl-4' do %>
<%= link_to omniauth_authorize_path(:user, provider.class.sym), class: 'institution-sign-in col-md-6 col-xl-4' do %>
<div class="option-btn">
<div class="option-btn-img">
<%= image_tag "idp/#{provider.logo}", class: "img-fluid" %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/feedbacks/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% end %>

<div class="row" id="feedback-page">
<div class="col-12 order-lg-1 col-lg-3 feedback-metadata">
<div class="col-12 order-lg-1 col-lg-4 col-xxl-3 feedback-metadata">
<div class="card" id="feedback-actions-holder">
<%= render partial: 'feedback_actions', locals: { evaluation: @feedback.evaluation, feedback: @feedback } %>
</div>
Expand All @@ -20,7 +20,7 @@
></d-saved-annotations-sidecard>
<% end %>
</div>
<div class="col-12 order-lg-0 col-lg-9 feedback-submission">
<div class="col-12 order-lg-0 col-lg-8 col-xxl-9 feedback-submission">
<div class="card feedback-show">
<div class="card-title card-title-colored">
<h2 class="card-title-text"><span>
Expand Down
4 changes: 2 additions & 2 deletions app/views/submissions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= render 'navbar_links' %>
<div class="row justify-content-center">
<div class="col-lg-9 col-12">
<div class="col-lg-8 col-xxl-9 col-12">
<div class="card">
<div class="card-title card-title-colored">
<h2 class="card-title-text"><%= t ".submission_results" %></h2>
Expand Down Expand Up @@ -34,7 +34,7 @@
<d-saved-annotations-sidecard course-id="<%= @submission.course&.id %>"
exercise-id="<%= @submission.exercise&.id %>"
user-id="<%= current_user.id %>"
class="col-12 col-lg-3"
class="col-12 col-lg-4 col-xxl-3"
></d-saved-annotations-sidecard>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/00_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Application
module Version
MAJOR = 6
MINOR = 1
PATCH = 0
PATCH = 1

STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/LTI/auth/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def provider_settings(provider)
},
issuer: provider.issuer
}
hash[:scope] = [:openid] if (provider.issuer == "https://ufora.ugent.be")
hash[:scope] = [:openid] if (provider.issuer == "https://ufora.ugent.be" || provider.issuer == "https://uforatest.ugent.be")
hash
end
end
Expand Down
Loading

0 comments on commit 14c434c

Please sign in to comment.