DEV: Update linting (#71)
This commit is contained in:
parent
2b6397b6cb
commit
e9981c8906
|
@ -0,0 +1 @@
|
||||||
|
module.exports = require("@discourse/lint-configs/eslint");
|
|
@ -1 +0,0 @@
|
||||||
{}
|
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = require("@discourse/lint-configs/prettier");
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = require("@discourse/lint-configs/template-lint");
|
|
@ -1,4 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
plugins: ["ember-template-lint-plugin-discourse"],
|
|
||||||
extends: "discourse:recommended",
|
|
||||||
};
|
|
36
Gemfile.lock
36
Gemfile.lock
|
@ -2,38 +2,38 @@ GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
json (2.6.3)
|
json (2.7.1)
|
||||||
language_server-protocol (3.17.0.3)
|
language_server-protocol (3.17.0.3)
|
||||||
parallel (1.23.0)
|
parallel (1.24.0)
|
||||||
parser (3.2.2.4)
|
parser (3.3.0.4)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
prettier_print (1.2.1)
|
prettier_print (1.2.1)
|
||||||
racc (1.7.3)
|
racc (1.7.3)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
regexp_parser (2.8.2)
|
regexp_parser (2.9.0)
|
||||||
rexml (3.2.6)
|
rexml (3.2.6)
|
||||||
rubocop (1.57.2)
|
rubocop (1.60.0)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (>= 3.17.0)
|
language_server-protocol (>= 3.17.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.2.2.4)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rexml (>= 3.2.5, < 4.0)
|
||||||
rubocop-ast (>= 1.28.1, < 2.0)
|
rubocop-ast (>= 1.30.0, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 3.0)
|
unicode-display_width (>= 2.4.0, < 3.0)
|
||||||
rubocop-ast (1.30.0)
|
rubocop-ast (1.30.0)
|
||||||
parser (>= 3.2.1.0)
|
parser (>= 3.2.1.0)
|
||||||
rubocop-capybara (2.19.0)
|
rubocop-capybara (2.20.0)
|
||||||
rubocop (~> 1.41)
|
rubocop (~> 1.41)
|
||||||
rubocop-discourse (3.4.1)
|
rubocop-discourse (3.6.0)
|
||||||
rubocop (>= 1.1.0)
|
rubocop (>= 1.59.0)
|
||||||
rubocop-rspec (>= 2.0.0)
|
rubocop-rspec (>= 2.25.0)
|
||||||
rubocop-factory_bot (2.24.0)
|
rubocop-factory_bot (2.25.1)
|
||||||
rubocop (~> 1.33)
|
rubocop (~> 1.41)
|
||||||
rubocop-rspec (2.25.0)
|
rubocop-rspec (2.26.1)
|
||||||
rubocop (~> 1.40)
|
rubocop (~> 1.40)
|
||||||
rubocop-capybara (~> 2.17)
|
rubocop-capybara (~> 2.17)
|
||||||
rubocop-factory_bot (~> 2.22)
|
rubocop-factory_bot (~> 2.22)
|
||||||
|
@ -43,17 +43,11 @@ GEM
|
||||||
unicode-display_width (2.5.0)
|
unicode-display_width (2.5.0)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-20
|
|
||||||
arm64-darwin-22
|
|
||||||
ruby
|
ruby
|
||||||
x86_64-darwin-18
|
|
||||||
x86_64-darwin-19
|
|
||||||
x86_64-darwin-20
|
|
||||||
x86_64-linux
|
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
rubocop-discourse
|
rubocop-discourse
|
||||||
syntax_tree
|
syntax_tree
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.3.10
|
2.5.4
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "faraday/logging/formatter"
|
||||||
class OIDCFaradayFormatter < Faraday::Logging::Formatter
|
class OIDCFaradayFormatter < Faraday::Logging::Formatter
|
||||||
def request(env)
|
def request(env)
|
||||||
warn <<~LOG
|
warn <<~LOG
|
||||||
OIDC Debugging: request #{env.method.upcase} #{env.url.to_s}
|
OIDC Debugging: request #{env.method.upcase} #{env.url}
|
||||||
|
|
||||||
Headers: #{env.request_headers}
|
Headers: #{env.request_headers}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class OIDCFaradayFormatter < Faraday::Logging::Formatter
|
||||||
warn <<~LOG
|
warn <<~LOG
|
||||||
OIDC Debugging: response status #{env.status}
|
OIDC Debugging: response status #{env.status}
|
||||||
|
|
||||||
From #{env.method.upcase} #{env.url.to_s}
|
From #{env.method.upcase} #{env.url}
|
||||||
|
|
||||||
Headers: #{env.response_headers}
|
Headers: #{env.response_headers}
|
||||||
|
|
||||||
|
|
10
package.json
10
package.json
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "discourse-openid-connect",
|
"name": "discourse-openid-connect",
|
||||||
"version": "1.0.0",
|
"private": true,
|
||||||
"repository": "https://github.com/discourse/discourse-openid-connect",
|
|
||||||
"author": "Discourse",
|
|
||||||
"license": "MIT",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-discourse": "^3.4.0"
|
"@discourse/lint-configs": "^1.3.5",
|
||||||
|
"ember-template-lint": "^5.13.0",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
|
"prettier": "^2.8.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# version: 1.0
|
# version: 1.0
|
||||||
# authors: David Taylor
|
# authors: David Taylor
|
||||||
# url: https://github.com/discourse/discourse-openid-connect
|
# url: https://github.com/discourse/discourse-openid-connect
|
||||||
# transpile_js: true
|
|
||||||
|
|
||||||
enabled_site_setting :openid_connect_enabled
|
enabled_site_setting :openid_connect_enabled
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ describe OmniAuth::Strategies::OpenIDConnect do
|
||||||
.returns("error" => true, "error_description" => "User forgot password")
|
.returns("error" => true, "error_description" => "User forgot password")
|
||||||
strategy.options.error_handler =
|
strategy.options.error_handler =
|
||||||
lambda do |error, message|
|
lambda do |error, message|
|
||||||
return "https://example.com/error_redirect" if message.include?("forgot password")
|
"https://example.com/error_redirect" if message.include?("forgot password")
|
||||||
end
|
end
|
||||||
expect(strategy.callback_phase[0]).to eq(302)
|
expect(strategy.callback_phase[0]).to eq(302)
|
||||||
expect(strategy.callback_phase[1]["Location"]).to eq("https://example.com/error_redirect")
|
expect(strategy.callback_phase[1]["Location"]).to eq("https://example.com/error_redirect")
|
||||||
|
|
Loading…
Reference in New Issue