DEV: General cleanup (#34)
This commit is contained in:
parent
dfcdc38d77
commit
e897702139
|
@ -50,7 +50,10 @@ jobs:
|
|||
|
||||
- name: Ember template lint
|
||||
if: ${{ always() }}
|
||||
run: yarn ember-template-lint assets/javascripts
|
||||
run: |
|
||||
if [ 0 -lt $(find assets/javascripts -type f -name "*.hbs" 2> /dev/null | wc -l) ]; then
|
||||
yarn ember-template-lint assets/javascripts
|
||||
fi
|
||||
|
||||
- name: Rubocop
|
||||
if: ${{ always() }}
|
||||
|
|
38
Gemfile.lock
38
Gemfile.lock
|
@ -1,31 +1,31 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
ast (2.4.1)
|
||||
parallel (1.19.2)
|
||||
parser (2.7.2.0)
|
||||
ast (2.4.2)
|
||||
parallel (1.22.1)
|
||||
parser (3.1.1.0)
|
||||
ast (~> 2.4.1)
|
||||
rainbow (3.0.0)
|
||||
regexp_parser (1.8.1)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.2.1)
|
||||
rexml (3.2.5)
|
||||
rubocop (0.93.0)
|
||||
rubocop (1.26.1)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.7.1.5)
|
||||
parser (>= 3.1.0.0)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml
|
||||
rubocop-ast (>= 0.6.0)
|
||||
rubocop-ast (>= 1.16.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 2.0)
|
||||
rubocop-ast (0.7.1)
|
||||
parser (>= 2.7.1.5)
|
||||
rubocop-discourse (2.3.2)
|
||||
rubocop (>= 0.69.0)
|
||||
rubocop-rspec (>= 1.39.0)
|
||||
rubocop-rspec (1.43.2)
|
||||
rubocop (~> 0.87)
|
||||
ruby-progressbar (1.10.1)
|
||||
unicode-display_width (1.7.0)
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.16.0)
|
||||
parser (>= 3.1.1.0)
|
||||
rubocop-discourse (2.5.0)
|
||||
rubocop (>= 1.1.0)
|
||||
rubocop-rspec (>= 2.0.0)
|
||||
rubocop-rspec (2.9.0)
|
||||
rubocop (~> 1.19)
|
||||
ruby-progressbar (1.11.0)
|
||||
unicode-display_width (2.1.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
A plugin to integrate Discourse with an openid-connect login provider
|
||||
|
||||
For information and discussion, see https://meta.discourse.org/t/openid-connect-authentication-plugin/103632
|
||||
For information and discussion, see https://meta.discourse.org/t/openid-connect-authentication-plugin/103632
|
||||
|
|
|
@ -4,4 +4,4 @@ en:
|
|||
oidc:
|
||||
name: "OpenID Connect"
|
||||
title: "with OpenID Connect"
|
||||
message: "Authenticating with OpenID Connect"
|
||||
message: "Authenticating with OpenID Connect"
|
||||
|
|
|
@ -7,7 +7,7 @@ plugins:
|
|||
default: ""
|
||||
openid_connect_client_secret:
|
||||
default: ""
|
||||
openid_connect_rp_initiated_logout:
|
||||
openid_connect_rp_initiated_logout:
|
||||
default: false
|
||||
openid_connect_rp_initiated_logout_redirect:
|
||||
default: ""
|
||||
|
@ -22,13 +22,13 @@ plugins:
|
|||
openid_connect_token_scope:
|
||||
default: ""
|
||||
openid_connect_error_redirects:
|
||||
default: ''
|
||||
default: ""
|
||||
type: list
|
||||
list_type: secret
|
||||
openid_connect_authorize_parameters:
|
||||
default: ''
|
||||
default: ""
|
||||
type: list
|
||||
list_type: compact
|
||||
openid_connect_claims:
|
||||
default: ''
|
||||
default: ""
|
||||
textarea: true
|
||||
|
|
|
@ -206,7 +206,6 @@ module ::OmniAuth
|
|||
response = client.request(:post, options[:client_options][:token_url], body: get_token_options)
|
||||
::OAuth2::AccessToken.from_hash(client, response.parsed)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class OpenIDConnectAuthenticator < Auth::ManagedAuthenticator
|
||||
def name
|
||||
'oidc'
|
||||
|
@ -64,7 +65,6 @@ class OpenIDConnectAuthenticator < Auth::ManagedAuthenticator
|
|||
end
|
||||
|
||||
def register_middleware(omniauth)
|
||||
|
||||
omniauth.provider :openid_connect,
|
||||
name: :oidc,
|
||||
error_handler: lambda { |error, message|
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'faraday/logging/formatter'
|
||||
|
||||
class OIDCFaradayFormatter < Faraday::Logging::Formatter
|
||||
def request(env)
|
||||
warn <<~LOG
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "discourse-openid-connect",
|
||||
"version": "1.0.0",
|
||||
"repository": "git@github.com:discourse/discourse-openid-connect.git",
|
||||
"repository": "https://github.com/discourse/discourse-openid-connect",
|
||||
"author": "Discourse",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint-config-discourse": "^1.1.3"
|
||||
"eslint-config-discourse": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
# version: 1.0
|
||||
# authors: David Taylor
|
||||
# url: https://github.com/discourse/discourse-openid-connect
|
||||
# transpile_js: true
|
||||
|
||||
enabled_site_setting :openid_connect_enabled
|
||||
|
||||
|
|
|
@ -202,5 +202,4 @@ describe OmniAuth::Strategies::OpenIDConnect do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -5,21 +5,23 @@ require_relative '../../lib/omniauth_open_id_connect'
|
|||
|
||||
describe OpenIDConnectAuthenticator do
|
||||
let(:authenticator) { described_class.new }
|
||||
let(:user) { Fabricate(:user) }
|
||||
let(:hash) { OmniAuth::AuthHash.new(
|
||||
provider: "oidc",
|
||||
uid: "123456789",
|
||||
info: {
|
||||
name: "John Doe",
|
||||
email: user.email
|
||||
},
|
||||
extra: {
|
||||
raw_info: {
|
||||
email: user.email,
|
||||
name: "John Doe"
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
let(:hash) do
|
||||
OmniAuth::AuthHash.new(
|
||||
provider: "oidc",
|
||||
uid: "123456789",
|
||||
info: {
|
||||
name: "John Doe",
|
||||
email: user.email
|
||||
},
|
||||
extra: {
|
||||
raw_info: {
|
||||
email: user.email,
|
||||
name: "John Doe"
|
||||
}
|
||||
}
|
||||
}
|
||||
)}
|
||||
)
|
||||
end
|
||||
|
||||
context "when email_verified is not supplied" do
|
||||
# Some IDPs do not supply this information
|
||||
|
@ -109,7 +111,5 @@ describe OpenIDConnectAuthenticator do
|
|||
expect(authenticator.discovery_document).to eq(nil)
|
||||
expect(stub).to have_been_requested.once
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ describe "OIDC RP-Initiated Logout" do
|
|||
"end_session_endpoint": "https://id.example.com/endsession",
|
||||
}
|
||||
end
|
||||
let(:user) { Fabricate(:user) }
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
before do
|
||||
SiteSetting.openid_connect_enabled = true
|
||||
|
@ -96,7 +96,5 @@ describe "OIDC RP-Initiated Logout" do
|
|||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["redirect_url"]).to eq("/")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue