Actions
Bug #30064
closedRootRepository password length too short
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Description
The upstream_password in the root repository table was created to hold auto generated keys of 760 characters and above 1024. However check the code here
[1] pry(main)> a = Katello::RootRepository.last => #<Katello::RootRepository:0x0000000010baad50 id: 5, .... .... http_proxy_id: nil> [4] pry(main)> a.upstream_password = "A"*500 => "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" [5] pry(main)> a.save! ActiveRecord::ValueTooLong: PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024) from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params' Caused by PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024) from /home/vagrant/foreman/.vendor/ruby/2.5.0/gems/activerecord-6.0.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
- Create a root repository and give it an upstream password > 500 characters.
Expected:
Works well
Actual:
Fails with "value too long for type character varying(1024)" error
Note:
password in the http_proxies table does not have a limit
password | character varying | | |
While root repository does.
upstream_password | character varying(1024) | | |
h
Actions