Merge branch 'master' of github.com:domify/registry

This commit is contained in:
Priit Tark 2015-07-13 11:13:44 +03:00
commit b0296bd33e
10 changed files with 1814 additions and 878 deletions

View file

@ -138,7 +138,7 @@ class EppController < ApplicationController
# validate legal document's type here because it may be in most of the requests # validate legal document's type here because it may be in most of the requests
@prefix = nil @prefix = nil
if element_count('extdata > legalDocument') > 0 if element_count('extdata > legalDocument') > 0
requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES) requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES, policy: true)
end end
handle_errors and return if epp_errors.any? handle_errors and return if epp_errors.any?
@ -188,12 +188,27 @@ class EppController < ApplicationController
attribute = element[attribute_selector] attribute = element[attribute_selector]
return if attribute && options[:values].include?(attribute) unless attribute
epp_errors << {
code: '2003',
msg: I18n.t('errors.messages.required_parameter_missing', key: attribute_selector)
}
return
end
epp_errors << { return if options[:values].include?(attribute)
code: '2306',
msg: I18n.t('attribute_is_invalid', attribute: attribute_selector) if options[:policy]
} epp_errors << {
code: '2306',
msg: I18n.t('attribute_is_invalid', attribute: attribute_selector)
}
else
epp_errors << {
code: '2004',
msg: I18n.t('parameter_value_range_error', key: attribute_selector)
}
end
end end
def optional_attribute(element_selector, attribute_selector, options) def optional_attribute(element_selector, attribute_selector, options)

View file

@ -1,4 +1,4 @@
= form_for([:admin, @admin_user], html: { class: 'form-horizontal' }) do |f| = form_for([:admin, @admin_user], html: { class: 'form-horizontal', autocomplete: 'off' }) do |f|
= render 'shared/full_errors', object: @admin_user = render 'shared/full_errors', object: @admin_user
.row .row
@ -14,12 +14,12 @@
- not_required = @admin_user.new_record? ? '' : 'not-required' - not_required = @admin_user.new_record? ? '' : 'not-required'
= f.label :password, class: not_required = f.label :password, class: not_required
.col-md-8 .col-md-8
= f.password_field(:password, class: 'form-control') = f.text_field(:password, class: 'form-control')
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :password_confirmation, class: not_required = f.label :password_confirmation, class: not_required
.col-md-8 .col-md-8
= f.password_field(:password_confirmation, class: 'form-control') = f.text_field(:password_confirmation, class: 'form-control')
%hr %hr
.form-group .form-group
@ -36,7 +36,7 @@
.col-md-4.control-label .col-md-4.control-label
= f.label :country_code, t(:country) = f.label :country_code, t(:country)
.col-md-8 .col-md-8
= f.select(:country_code, = f.select(:country_code,
SortedCountry.all_options(f.object.country_code), {}, class: 'form-control') SortedCountry.all_options(f.object.country_code), {}, class: 'form-control')
%hr %hr
.form-group .form-group
@ -48,7 +48,7 @@
%hr %hr
.row .row
.col-md-8.text-right .col-md-8.text-right
= button_tag(t(:save), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-warning')
:coffee :coffee
$("#admin_user_password").removeAttr('required') $("#admin_user_password").removeAttr('required')

View file

@ -867,3 +867,4 @@ en:
invalid_yaml: 'Invalid YAML' invalid_yaml: 'Invalid YAML'
reserved_pw: 'Reserved pw' reserved_pw: 'Reserved pw'
no_transfers_found: 'No transfers found' no_transfers_found: 'No transfers found'
parameter_value_range_error: 'Parameter value range error: %{key}'

View file

@ -935,14 +935,14 @@ ActiveRecord::Schema.define(version: 20150709092549) do
end end
create_table "que_jobs", id: false, force: :cascade do |t| create_table "que_jobs", id: false, force: :cascade do |t|
t.integer "priority", limit: 2, default: 100, null: false t.integer "priority", limit: 2, default: 100, null: false
t.datetime "run_at", default: '2015-06-30 14:16:50', null: false t.datetime "run_at", default: "now()", null: false
t.integer "job_id", limit: 8, default: 0, null: false t.integer "job_id", limit: 8, default: "nextval('que_jobs_job_id_seq'::regclass)", null: false
t.text "job_class", null: false t.text "job_class", null: false
t.json "args", default: [], null: false t.json "args", default: [], null: false
t.integer "error_count", default: 0, null: false t.integer "error_count", default: 0, null: false
t.text "last_error" t.text "last_error"
t.text "queue", default: "", null: false t.text "queue", default: "", null: false
end end
create_table "registrant_verifications", force: :cascade do |t| create_table "registrant_verifications", force: :cascade do |t|

View file

@ -2420,8 +2420,8 @@ ALTER SEQUENCE pricelists_id_seq OWNED BY pricelists.id;
CREATE TABLE que_jobs ( CREATE TABLE que_jobs (
priority smallint DEFAULT 100 NOT NULL, priority smallint DEFAULT 100 NOT NULL,
run_at timestamp without time zone DEFAULT '2015-06-30 14:16:50.905537'::timestamp without time zone NOT NULL, run_at timestamp with time zone DEFAULT now() NOT NULL,
job_id bigint DEFAULT 0 NOT NULL, job_id bigint NOT NULL,
job_class text NOT NULL, job_class text NOT NULL,
args json DEFAULT '[]'::json NOT NULL, args json DEFAULT '[]'::json NOT NULL,
error_count integer DEFAULT 0 NOT NULL, error_count integer DEFAULT 0 NOT NULL,
@ -2430,6 +2430,32 @@ CREATE TABLE que_jobs (
); );
--
-- Name: TABLE que_jobs; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON TABLE que_jobs IS '3';
--
-- Name: que_jobs_job_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE que_jobs_job_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: que_jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE que_jobs_job_id_seq OWNED BY que_jobs.job_id;
-- --
-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace: -- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace:
-- --
@ -3185,6 +3211,13 @@ ALTER TABLE ONLY people ALTER COLUMN id SET DEFAULT nextval('people_id_seq'::reg
ALTER TABLE ONLY pricelists ALTER COLUMN id SET DEFAULT nextval('pricelists_id_seq'::regclass); ALTER TABLE ONLY pricelists ALTER COLUMN id SET DEFAULT nextval('pricelists_id_seq'::regclass);
--
-- Name: job_id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY que_jobs ALTER COLUMN job_id SET DEFAULT nextval('que_jobs_job_id_seq'::regclass);
-- --
-- Name: id; Type: DEFAULT; Schema: public; Owner: - -- Name: id; Type: DEFAULT; Schema: public; Owner: -
-- --
@ -3704,6 +3737,14 @@ ALTER TABLE ONLY pricelists
ADD CONSTRAINT pricelists_pkey PRIMARY KEY (id); ADD CONSTRAINT pricelists_pkey PRIMARY KEY (id);
--
-- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY que_jobs
ADD CONSTRAINT que_jobs_pkey PRIMARY KEY (queue, priority, run_at, job_id);
-- --
-- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
-- --
@ -4808,14 +4849,26 @@ INSERT INTO schema_migrations (version) VALUES ('20150520164507');
INSERT INTO schema_migrations (version) VALUES ('20150521120145'); INSERT INTO schema_migrations (version) VALUES ('20150521120145');
INSERT INTO schema_migrations (version) VALUES ('20150522164020');
INSERT INTO schema_migrations (version) VALUES ('20150525075550');
INSERT INTO schema_migrations (version) VALUES ('20150601083516');
INSERT INTO schema_migrations (version) VALUES ('20150601083800');
INSERT INTO schema_migrations (version) VALUES ('20150603141549'); INSERT INTO schema_migrations (version) VALUES ('20150603141549');
INSERT INTO schema_migrations (version) VALUES ('20150603211318'); INSERT INTO schema_migrations (version) VALUES ('20150603211318');
INSERT INTO schema_migrations (version) VALUES ('20150603212659'); INSERT INTO schema_migrations (version) VALUES ('20150603212659');
INSERT INTO schema_migrations (version) VALUES ('20150609093515');
INSERT INTO schema_migrations (version) VALUES ('20150609103333'); INSERT INTO schema_migrations (version) VALUES ('20150609103333');
INSERT INTO schema_migrations (version) VALUES ('20150610111019');
INSERT INTO schema_migrations (version) VALUES ('20150610112238'); INSERT INTO schema_migrations (version) VALUES ('20150610112238');
INSERT INTO schema_migrations (version) VALUES ('20150610144547'); INSERT INTO schema_migrations (version) VALUES ('20150610144547');
@ -4824,8 +4877,12 @@ INSERT INTO schema_migrations (version) VALUES ('20150611124920');
INSERT INTO schema_migrations (version) VALUES ('20150612123111'); INSERT INTO schema_migrations (version) VALUES ('20150612123111');
INSERT INTO schema_migrations (version) VALUES ('20150612125720');
INSERT INTO schema_migrations (version) VALUES ('20150701074344'); INSERT INTO schema_migrations (version) VALUES ('20150701074344');
INSERT INTO schema_migrations (version) VALUES ('20150703084206');
INSERT INTO schema_migrations (version) VALUES ('20150703084632'); INSERT INTO schema_migrations (version) VALUES ('20150703084632');
INSERT INTO schema_migrations (version) VALUES ('20150706091724'); INSERT INTO schema_migrations (version) VALUES ('20150706091724');

View file

@ -16,6 +16,7 @@ Application build and update
For production you probably would like to create databases to your locale, example: For production you probably would like to create databases to your locale, example:
create database registry_production owner registry encoding 'UTF-8' LC_COLLATE 'et_EE.utf8' LC_CTYPE 'et_EE.utf8' template template0; create database registry_production owner registry encoding 'UTF-8' LC_COLLATE 'et_EE.utf8' LC_CTYPE 'et_EE.utf8' template template0;
create extension hstore;
Deploy overview: (database schema should be loaded and seeds should be present) Deploy overview: (database schema should be loaded and seeds should be present)

File diff suppressed because it is too large Load diff

View file

@ -141,7 +141,7 @@ Domain name mapping protocol short version:
Field name Min-max Field description Field name Min-max Field description
----------------------- ------- ----------------- ----------------------- ------- -----------------
<transfer> 1 <transfer> 1 Attribute: op="request/query/approve/reject/cancel"
<domain:transfer> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd" <domain:transfer> 1 Attribute: xmlns:domain="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd"
<domain:name> 1 Domain name. Can contain unicode characters. <domain:name> 1 Domain name. Can contain unicode characters.
<domain:authInfo> 1 <domain:authInfo> 1

View file

@ -1437,8 +1437,8 @@ describe 'EPP Domain', epp: true do
it 'returns an error for incorrect op attribute' do it 'returns an error for incorrect op attribute' do
response = epp_plain_request(domain_transfer_xml({}, 'bla'), validate_input: false) response = epp_plain_request(domain_transfer_xml({}, 'bla'), validate_input: false)
response[:result_code].should == '2306' response[:msg].should == 'Parameter value range error: op'
response[:msg].should == 'Attribute is invalid: op' response[:result_code].should == '2004'
end end
it 'creates new pw after successful transfer' do it 'creates new pw after successful transfer' do

View file

@ -87,7 +87,8 @@ describe 'EPP Poll', epp: true do
}) })
response = epp_plain_request(xml, validate_input: false) response = epp_plain_request(xml, validate_input: false)
response[:msg].should == 'Attribute is invalid: op' response[:msg].should == 'Parameter value range error: op'
response[:result_code].should == '2004'
end end
it 'dequeues multiple messages' do it 'dequeues multiple messages' do