Module: ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::Step
- Included in:
- CreateActiveDocsStep, CreateBackendMappingRulesStep, CreateBackendMethodsStep, CreateBackendStep, CreateMappingRulesStep, CreateMethodsStep, CreateServiceStep, ImportBackendStep, ImportProductStep, UpdatePoliciesStep, UpdateServiceOidcConfStep, UpdateServiceProxyStep
- Defined in:
- lib/3scale_toolbox/commands/import_command/openapi/step.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #api_spec ⇒ Object
- #backend ⇒ Object
- #backend=(backend_obj) ⇒ Object
- #backend_api_host_header ⇒ Object
- #backend_api_secret_token ⇒ Object
- #base_path ⇒ Object
- #build_3scale_operations ⇒ Object
- #default_credentials_userkey ⇒ Object
- #host ⇒ Object
- #initialize(context) ⇒ Object
- #logger ⇒ Object
- #oidc_issuer_endpoint ⇒ Object
- #oidc_issuer_type ⇒ Object
- #operations ⇒ Object
- #override_private_base_url ⇒ Object
- #override_private_basepath ⇒ Object
- #override_public_basepath ⇒ Object
- #prefix_matching ⇒ Object
- #private_base_path ⇒ Object
- #private_endpoint ⇒ Object
- #production_public_base_url ⇒ Object
- #public_base_path ⇒ Object
- #report ⇒ Object
- #resource ⇒ Object
-
#service ⇒ Object
Can be nil on initialization time and not nil afterwards method to fetch from context required.
- #service=(service) ⇒ Object
- #staging_public_base_url ⇒ Object
- #target_system_name ⇒ Object
- #threescale_client ⇒ Object
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 6 def context @context end |
Instance Method Details
#api_spec ⇒ Object
34 35 36 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 34 def api_spec context[:api_spec] end |
#backend ⇒ Object
16 17 18 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 16 def backend context[:backend_target] end |
#backend=(backend_obj) ⇒ Object
20 21 22 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 20 def backend=(backend_obj) context[:backend_target] = backend_obj end |
#backend_api_host_header ⇒ Object
108 109 110 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 108 def backend_api_host_header context[:backend_api_host_header] end |
#backend_api_secret_token ⇒ Object
104 105 106 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 104 def backend_api_secret_token context[:backend_api_secret_token] end |
#base_path ⇒ Object
126 127 128 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 126 def base_path api_spec.base_path || '/' end |
#build_3scale_operations ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 49 def build_3scale_operations api_spec.operations.map do |op| Operation.new( base_path: base_path, public_base_path: public_base_path, path: op[:path], verb: op[:verb], operation_id: op[:operation_id], description: op[:description], prefix_matching: prefix_matching, ) end end |
#default_credentials_userkey ⇒ Object
80 81 82 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 80 def default_credentials_userkey context[:default_credentials_userkey] end |
#host ⇒ Object
120 121 122 123 124 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 120 def host return if api_spec.host.nil? "#{api_spec.scheme || 'https'}://#{api_spec.host}" end |
#initialize(context) ⇒ Object
8 9 10 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 8 def initialize(context) @context = context end |
#logger ⇒ Object
138 139 140 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 138 def logger context[:logger] end |
#oidc_issuer_endpoint ⇒ Object
76 77 78 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 76 def oidc_issuer_endpoint context[:oidc_issuer_endpoint] end |
#oidc_issuer_type ⇒ Object
72 73 74 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 72 def oidc_issuer_type context[:oidc_issuer_type] end |
#operations ⇒ Object
42 43 44 45 46 47 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 42 def operations # api_spec.operations are readonly # store operations in context # each operation can be extended with extra information to be used later context[:operations] ||= build_3scale_operations end |
#override_private_base_url ⇒ Object
100 101 102 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 100 def override_private_base_url context[:override_private_base_url] end |
#override_private_basepath ⇒ Object
84 85 86 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 84 def override_private_basepath context[:override_private_basepath] end |
#override_public_basepath ⇒ Object
88 89 90 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 88 def override_public_basepath context[:override_public_basepath] end |
#prefix_matching ⇒ Object
112 113 114 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 112 def prefix_matching context[:prefix_matching] end |
#private_base_path ⇒ Object
134 135 136 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 134 def private_base_path override_private_basepath || base_path end |
#private_endpoint ⇒ Object
116 117 118 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 116 def private_endpoint override_private_base_url || host end |
#production_public_base_url ⇒ Object
92 93 94 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 92 def production_public_base_url context[:production_public_base_url] end |
#public_base_path ⇒ Object
130 131 132 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 130 def public_base_path override_public_basepath || base_path end |
#report ⇒ Object
12 13 14 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 12 def report context[:report] ||= {} end |
#resource ⇒ Object
68 69 70 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 68 def resource context[:api_spec_resource] end |
#service ⇒ Object
Can be nil on initialization time and not nil afterwards method to fetch from context required
26 27 28 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 26 def service context[:target] end |
#service=(service) ⇒ Object
30 31 32 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 30 def service=(service) context[:target] = service end |
#staging_public_base_url ⇒ Object
96 97 98 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 96 def staging_public_base_url context[:staging_public_base_url] end |
#target_system_name ⇒ Object
63 64 65 66 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 63 def target_system_name # could be nil context[:target_system_name] end |
#threescale_client ⇒ Object
38 39 40 |
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 38 def threescale_client context[:threescale_client] end |