class Attio::OAuth::ScopeValidator

def validate(scopes)

Raises:
  • (InvalidScopeError) - If any scope is invalid

Returns:
  • (Array) - Validated scopes

Parameters:
  • scopes (Array, String) -- Scopes to validate
def validate(scopes)
  scopes = Array(scopes).map(&:to_s)
  invalid_scopes = scopes - VALID_SCOPES
  unless invalid_scopes.empty?
    raise InvalidScopeError, "Invalid scopes: #{invalid_scopes.join(", ")}"
  end
  scopes
end