Merge pull request #335 from internetee/registry-248

Registry 248
This commit is contained in:
Timo Võhmar 2017-01-24 14:31:20 +02:00 committed by GitHub
commit bd1d056b3d
15 changed files with 204 additions and 7 deletions

View file

@ -11,12 +11,16 @@ class ApiUser < User
}
end
def self.min_password_length # Must precede .validates
6
end
# TODO: should have max request limit per day?
belongs_to :registrar
has_many :certificates
validates :username, :password, :registrar, :roles, presence: true
validates :password, length: { minimum: 6 }
validates :password, length: { minimum: min_password_length }
validates :username, uniqueness: true
# TODO: probably cache, because it's requested on every EPP