Module: ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::Step

Included in:
CreateActiveDocsStep, CreateMappingRulesStep, CreateMethodsStep, CreateServiceStep, UpdatePoliciesStep, UpdateServiceOidcConfStep, UpdateServiceProxyStep
Defined in:
lib/3scale_toolbox/commands/import_command/openapi/step.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (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_specObject



22
23
24
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 22

def api_spec
  context[:api_spec]
end

#backend_api_host_headerObject



92
93
94
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 92

def backend_api_host_header
  context[:backend_api_host_header]
end

#backend_api_secret_tokenObject



88
89
90
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 88

def backend_api_secret_token
  context[:backend_api_secret_token]
end

#base_pathObject



100
101
102
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 100

def base_path
  api_spec.base_path || '/'
end

#build_3scale_operationsObject



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 37

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],
      operationId: op[:operation_id],
      description: op[:description],
      prefix_matching: prefix_matching,
    )
  end
end

#default_credentials_userkeyObject



64
65
66
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 64

def default_credentials_userkey
  context[:default_credentials_userkey]
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

#oidc_issuer_endpointObject



60
61
62
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 60

def oidc_issuer_endpoint
  context[:oidc_issuer_endpoint]
end

#operationsObject



30
31
32
33
34
35
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 30

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_urlObject



84
85
86
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 84

def override_private_base_url
  context[:override_private_base_url]
end

#override_private_basepathObject



68
69
70
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 68

def override_private_basepath
  context[:override_private_basepath]
end

#override_public_basepathObject



72
73
74
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 72

def override_public_basepath
  context[:override_public_basepath]
end

#prefix_matchingObject



96
97
98
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 96

def prefix_matching
  context[:prefix_matching]
end

#private_base_pathObject



108
109
110
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 108

def private_base_path
  override_private_basepath || base_path
end

#production_public_base_urlObject



76
77
78
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 76

def production_public_base_url
  context[:production_public_base_url]
end

#public_base_pathObject



104
105
106
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 104

def public_base_path
  override_public_basepath || base_path
end

#resourceObject



56
57
58
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 56

def resource
  context[:api_spec_resource]
end

#serviceObject

Can be nil on initialization time and not nil afterwards method to fetch from context required



14
15
16
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 14

def service
  context[:target]
end

#service=(service) ⇒ Object



18
19
20
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 18

def service=(service)
  context[:target] = service
end

#staging_public_base_urlObject



80
81
82
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 80

def staging_public_base_url
  context[:staging_public_base_url]
end

#target_system_nameObject



51
52
53
54
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 51

def target_system_name
  # could be nil
  context[:target_system_name]
end

#threescale_clientObject



26
27
28
# File 'lib/3scale_toolbox/commands/import_command/openapi/step.rb', line 26

def threescale_client
  context[:threescale_client]
end