Module: ZendeskAppsSupport::Validations::Manifest
- Defined in:
- lib/zendesk_apps_support/validations/manifest.rb
Constant Summary collapse
- RUBY_TO_JSON =
ZendeskAppsSupport::Manifest::RUBY_TO_JSON
- REQUIRED_MANIFEST_FIELDS =
RUBY_TO_JSON.select { |k| %i[author default_locale].include? k }.freeze
- OAUTH_REQUIRED_FIELDS =
%w[client_id client_secret authorize_uri access_token_uri].freeze
- PARAMETER_TYPES =
ZendeskAppsSupport::Manifest::Parameter::TYPES
- OAUTH_MANIFEST_LINK =
'https://developer.zendesk.com/apps/docs/developer-guide/manifest#oauth'- SECURE_PARAM_SCOPES =
%w[header body url jwt_secret_key jwt_claim basic_auth_username basic_auth_password].freeze
Class Method Summary collapse
Class Method Details
.call(package) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/zendesk_apps_support/validations/manifest.rb', line 17 def call(package) unless package.has_file?('manifest.json') nested_manifest = package.files.find { |file| file =~ %r{\A[^/]+?/manifest\.json\Z} } if nested_manifest return [ValidationError.new(:nested_manifest, found_path: nested_manifest.relative_path)] end return [ValidationError.new(:missing_manifest)] end collate_manifest_errors(package) rescue JSON::ParserError => e return [ValidationError.new(:manifest_not_json, errors: e)] rescue ZendeskAppsSupport::Manifest::OverrideError => e return [ValidationError.new(:duplicate_manifest_keys, errors: e.)] end |