diff --git a/.rubocop.yml b/.rubocop.yml index bdfa98c..82d5f8b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,34 +6,9 @@ AllCops: - 'lib/models/update_otp_auth_method.rb' - 'lib/models/update_passkeys_auth_method.rb' -Naming/AccessorMethodName: - Enabled: false - -Style/GlobalVars: - Enabled: false - Metrics/ClassLength: Max: 300 - -Metrics/MethodLength: - Enabled: false - -Metrics/AbcSize: - Enabled: false Layout/LineLength: - Exclude: - - 'passageidentity.gemspec' - -ParameterLists: - Exclude: - - 'lib/passageidentity/client.rb' - -Metrics/CyclomaticComplexity: - Exclude: - - 'lib/passageidentity/client.rb' - -Metrics/PerceivedComplexity: - Exclude: - - 'lib/passageidentity/client.rb' + Max: 120 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a9b1fcf..befacd7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,13 +27,6 @@ ruby tests/all.rb ruby tests/*_test.rb ``` -Run Formatting: - -``` -gem install rubocop -rubocop --format github -``` - Run Linter: ``` diff --git a/lib/passageidentity/auth.rb b/lib/passageidentity/auth.rb index eeea9d4..a6720a6 100644 --- a/lib/passageidentity/auth.rb +++ b/lib/passageidentity/auth.rb @@ -8,9 +8,6 @@ module Passage # The Passage::Auth class provides methods for authenticating requests and tokens - # using the Passage authentication service. It supports fetching and caching - # JSON Web Keys (JWKS) for token verification, and provides methods for - # validating JWTs and revoking user refresh tokens. class Auth def initialize(app_id, auth_strategy) @app_cache = {} @@ -20,14 +17,6 @@ def initialize(app_id, auth_strategy) fetch_jwks end - def get_cache(key) - @app_cache[key] - end - - def set_cache(key, value) - @app_cache[key] = value - end - def fetch_app client = OpenapiClient::AppsApi.new response = client.get_app(@app_id) @@ -145,5 +134,15 @@ def revoke_user_refresh_tokens(user_id) body: e.response[:body] ) end + + private + + def get_cache(key) + @app_cache[key] + end + + def set_cache(key, value) + @app_cache[key] = value + end end end diff --git a/lib/passageidentity/client.rb b/lib/passageidentity/client.rb index 9a4b8e7..f2b583d 100644 --- a/lib/passageidentity/client.rb +++ b/lib/passageidentity/client.rb @@ -14,7 +14,7 @@ module Passage EMAIL_CHANNEL = 'email' PHONE_CHANNEL = 'phone' - # The Passage::Client class provides methods for interacting with the Passage + # The Passage::Client class provides methods for interacting with Passage class Client attr_reader :auth, :user diff --git a/lib/passageidentity/error.rb b/lib/passageidentity/error.rb index e13e5a6..1fe1b29 100644 --- a/lib/passageidentity/error.rb +++ b/lib/passageidentity/error.rb @@ -3,7 +3,7 @@ require 'net/http' module Passage - # PassageError is a custom error class for handling errors in the PassageIdentity gem. + # PassageError is a custom error class for handling errors class PassageError < StandardError attr_reader :status_code, :status_text, :message, :error