Module: Jets::Router::Route::Authorization
- Extended by:
- ActiveSupport::Concern
- Included in:
- Jets::Router::Route
- Defined in:
- lib/jets/router/route/authorization.rb
Instance Method Summary collapse
- #api_key_required ⇒ Object
- #authorization_type ⇒ Object
- #authorizer ⇒ Object
-
#authorizer_id(prefix_class: true) ⇒ Object
IE: main#protect => MainProtectAuthorizer.
-
#authorizer_metadata ⇒ Object
Metadata about the authorizer class that can be used later.
Instance Method Details
#api_key_required ⇒ Object
38 39 40 |
# File 'lib/jets/router/route/authorization.rb', line 38 def api_key_required @options[:api_key_required] end |
#authorization_type ⇒ Object
34 35 36 |
# File 'lib/jets/router/route/authorization.rb', line 34 def @options[:authorization_type] || end |
#authorizer ⇒ Object
30 31 32 |
# File 'lib/jets/router/route/authorization.rb', line 30 def @options[:authorizer] end |
#authorizer_id(prefix_class: true) ⇒ Object
IE: main#protect => MainProtectAuthorizer
16 17 18 19 |
# File 'lib/jets/router/route/authorization.rb', line 16 def (prefix_class: true) return unless self.class.(, prefix_class: prefix_class) end |
#authorizer_metadata ⇒ Object
Metadata about the authorizer class that can be used later. Stored in the Authorizer template parameters. In app_class.rb ‘def controller_params` it is used to build the input parameters for controller templates.
23 24 25 26 27 28 |
# File 'lib/jets/router/route/authorization.rb', line 23 def klass = .split("#").first = "#{klass}_authorizer".camelize logical_id = (prefix_class: false) "#{}.#{logical_id}" end |