class Yori::Schema::V3::OAuthFlows

OAuthFlows: Allows configuration of the supported OAuth Flows.

Public Instance Methods

required_flow_fields(flow) click to toggle source
# File lib/yori/schema/v3/oauth_flows.rb, line 36
def required_flow_fields(flow)
  case flow
  when 'implicit'
    %w[authorizationUrl]
  when 'clientCredentials'
    %w[tokenUrl]
  when 'authorizationCode'
    %w[authorizationUrl tokenUrl]
  else
    []
  end
end
validate!() click to toggle source
# File lib/yori/schema/v3/oauth_flows.rb, line 25
def validate!
  %w[implicit clientCredentials authorizationCode].each do |field|
    validate_flow!(field)
  end
end
validate_flow!(flow) click to toggle source
# File lib/yori/schema/v3/oauth_flows.rb, line 31
def validate_flow!(flow)
  oauth_flow = self[flow]
  oauth_flow&.validate_require_fields!(*required_flow_fields(flow))
end