Simplify re-encrypt logic

Want to introduce the ability to decrypt with an arbitrary key so we can convert from one v2_key to another.


- separate auth_model_spec and auth_config_model_spec
- consolidate fix_auth#hardcode logic with rencrypt logic
- encrypt_version_{1,2}(str) -> encrypt_version(str, #, key)
- decrypt_version_{0,1,2}(str) -> key.decrypt64(str)
  (it was a partial implementation of decrypt)

https://bugzilla.redhat.com/show_bug.cgi?id=1159009

/cc @jrafanie @Fryguy 
Sounds like you need Module prepend, if I'm understanding correctly.
 On Nov 1, 2014 12:56 AM, "Keenan Brock" <notifications@github.com> wrote:

> In vmdb/tools/fix_auth/auth_config_model.rb:
>
> > @@ -33,29 +32,27 @@ def traverse_column(names, hash)
> >          end
> >        end
> >
> > -      def hardcode(old_value, new_value)
> > -        hash = Vmdb::ConfigurationEncoder.load(old_value, !symbol_keys) do |k, v, h|
> > -          h[k] = new_value if password_field?(k) && v.present?
> > +      # already defined in AuthModel
> > +      # alias_method :old_recrypt, :recrypt
> > +      def recrypt_without_hash(old_value, options = {})
>
> @tenderlove <https://github.com/tenderlove> / @Fryguy
> <https://github.com/Fryguy>
> the concern FixAuth::AuthModel bring in the "hardcode" method.
> Is there a way to override that method. I tried alias_method,
> alias_method_chain and super, but was not able to leverage the existing
> "recrypt" method.
>
> ideas?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ManageIQ/manageiq/pull/962/files#r19701551>.
>