Skip to content

Commit 8aa1203

Browse files
refactor: change authsamlhelper class to module
Change authsamlhelper class to module, mark as helper for and prefix correctly Remove import authsamlhelper since helpers are imported by default
1 parent 0d6f7c2 commit 8aa1203

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/api/authentication_api.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require 'json/jwt'
33
require 'onelogin/ruby-saml'
44
require 'entities/user_entity'
5-
require 'helpers/auth/auth_saml_helper.rb'
65
#
76
# Provides the authentication API for Doubtfire.
87
# Users can sign in via email and password and receive an auth token
@@ -11,6 +10,7 @@
1110
class AuthenticationApi < Grape::API
1211
helpers LogHelper
1312
helpers AuthenticationHelpers
13+
helpers Auth::AuthSamlHelper
1414

1515
#
1616
# Sign in - only mounted if AAF auth is NOT used
@@ -86,10 +86,10 @@ class AuthenticationApi < Grape::API
8686
end
8787
post '/auth/jwt' do
8888
# this endpoint is being deprecated and will be removed
89-
AuthSAMLHelper.auth_saml2 params[:SAMLResponse]
89+
AuthSamlHelper.auth_saml2 params[:SAMLResponse]
9090
end
9191
post '/auth/saml2' do
92-
AuthSAMLHelper.auth_saml2 params[:SAMLResponse]
92+
AuthSamlHelper.auth_saml2 params[:SAMLResponse]
9393
end
9494
end
9595

app/helpers/auth/auth_saml_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'json/jwt'
22
require 'onelogin/ruby-saml'
33

4-
class AuthSamlHelper
4+
module Auth::AuthSamlHelper
55
def auth_saml2 (respSAML)
66
response = OneLogin::RubySaml::Response.new(respSAML, allowed_clock_drift: 1.second,
77
settings: AuthenticationHelpers.saml_settings)

0 commit comments

Comments
 (0)