@@ -21,7 +21,11 @@ module OpenAPI
2121 # * :type -> string
2222 # * :name -> string
2323 # * :in_f -> string
24- # * :flow -> symbol (:implicit_flow_enabled, :direct_access_grants_enabled, :service_accounts_enabled, :standard_flow_enabled)
24+ # * :flows -> hash
25+ # * :implicit_flow_enabled -> bool
26+ # * :direct_access_grants_enabled -> bool
27+ # * :service_accounts_enabled -> bool
28+ # * :standard_flow_enabled -> bool
2529 # * :scopes -> array of string
2630 # * Swagger.service_backend_version -> string ('1','2','oidc')
2731 # * Swagger.set_server_url -> def(spec, url)
@@ -150,7 +154,7 @@ def parse_global_security_reqs
150154 type : sec_def [ 'type' ] ,
151155 name : sec_def [ 'name' ] ,
152156 in_f : sec_def [ 'in' ] ,
153- flow : convert_flow ( sec_def [ 'flow' ] ) ,
157+ flows : parse_flows ( sec_def [ 'flow' ] ) ,
154158 scopes : sec_item
155159 }
156160 end
@@ -171,6 +175,21 @@ def security_definitions
171175 raw [ 'securityDefinitions' ] || { }
172176 end
173177
178+ def parse_flows ( flow_name )
179+ return nil if flow_name . nil?
180+
181+ basic_flows_object . merge! ( { convert_flow ( flow_name ) => true } )
182+ end
183+
184+ def basic_flows_object
185+ {
186+ standard_flow_enabled : false ,
187+ implicit_flow_enabled : false ,
188+ service_accounts_enabled : false ,
189+ direct_access_grants_enabled : false
190+ }
191+ end
192+
174193 def convert_flow ( flow_name )
175194 return nil if flow_name . nil?
176195
0 commit comments