-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched to Zeitwerk as autoloader. (#17)
Signed-off-by: Hermann Mayer <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# frozen_string_literal: true | ||
|
||
module Grape | ||
module Jwt | ||
module Authentication | ||
module Extensions | ||
# Root-level handling of dependencies. | ||
module Dependencies | ||
# Specifies which configuration keys are shared between keyless | ||
# and grape-jwt-authentication, so that we can easily pass through | ||
# our configuration to keyless. | ||
KEYLESS_CONFIGURATION = %i[ | ||
authenticator rsa_public_key_url rsa_public_key_caching | ||
rsa_public_key_expiration jwt_issuer jwt_beholder jwt_options | ||
jwt_verification_key | ||
].freeze | ||
|
||
# (Re)configure our gem dependencies. We take care of setting up | ||
# +Keyless+, which has been extracted from this gem. | ||
def configure_dependencies | ||
configure_keyless | ||
end | ||
|
||
# Configure the +Keyless+ gem with our configuration. | ||
def configure_keyless | ||
configuration = Grape::Jwt::Authentication.configuration | ||
|
||
Keyless.configure do |keyless| | ||
KEYLESS_CONFIGURATION.each do |option| | ||
keyless.send("#{option}=", configuration.send(option)) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |