Sha256: 6e1678f1e4f1f858885ae43f0cc1bde6d263cc6b34333c0fee3baa4e430d6381

Contents?: true

Size: 840 Bytes

Versions: 36

Compression:

Stored size: 840 Bytes

Contents

require "cf/cli/user/base"

module CF::User
  class Passwd < Base
    desc "Update the current user's password"
    group :admin, :user
    input :password, :desc => "Current password"
    input :new_password, :desc => "New password"
    input :verify, :desc => "Repeat new password"

    def passwd
      password = input[:password]
      new_password = input[:new_password]

      validate_password! new_password

      with_progress("Changing password") do
        client.current_user.change_password!(new_password, password)
      end
    end

    private

    def ask_password
      ask("Current Password", :echo => "*", :forget => true)
    end

    def ask_new_password
      ask("New Password", :echo => "*", :forget => true)
    end

    def ask_verify
      ask("Verify Password", :echo => "*", :forget => true)
    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
cf-5.4.7 lib/cf/cli/user/passwd.rb
cf-5.4.7.rc1 lib/cf/cli/user/passwd.rb
cf-5.4.5 lib/cf/cli/user/passwd.rb
cf-5.4.4 lib/cf/cli/user/passwd.rb
trucker-cli-0.0.3 lib/cf/cli/user/passwd.rb
cf-5.4.3 lib/cf/cli/user/passwd.rb
cf-5.4.2 lib/cf/cli/user/passwd.rb
trucker-cli-0.0.2 lib/cf/cli/user/passwd.rb
trucker-cli-0.0.1 lib/cf/cli/user/passwd.rb
cf-5.4.1 lib/cf/cli/user/passwd.rb
cf-5.4.1.rc1 lib/cf/cli/user/passwd.rb
cf-5.4.0 lib/cf/cli/user/passwd.rb
cf-5.3.1 lib/cf/cli/user/passwd.rb
cf-5.3.0 lib/cf/cli/user/passwd.rb
cf-5.2.2 lib/cf/cli/user/passwd.rb
cf-5.2.1.rc15 lib/cf/cli/user/passwd.rb
cf-5.2.1.rc14 lib/cf/cli/user/passwd.rb
cf-5.2.1.rc13 lib/cf/cli/user/passwd.rb
cf-5.2.1.rc12 lib/cf/cli/user/passwd.rb
cf-5.2.1.rc11 lib/cf/cli/user/passwd.rb