Sha256: 0837e08f5534ef4331ba62a92bcb0d83c127e639affccf66c0abc7a132f55661

Contents?: true

Size: 964 Bytes

Versions: 2

Compression:

Stored size: 964 Bytes

Contents

#!/usr/bin/env ruby

require 'aws/pws'

command = ARGV.shift

case command
when 'init'
  pws = AWS::PWS::Client.new
  pws.cli.add('AWS_ACCESS_KEY_ID')
  pws.cli.add('AWS_SECRET_ACCESS_KEY')

when 'cat'
  pws = AWS::PWS::StealthClient.new
  puts "AWS_ACCESS_KEY_ID=#{pws.read('AWS_ACCESS_KEY_ID')}"
  puts "AWS_SECRET_ACCESS_KEY=#{pws.read('AWS_SECRET_ACCESS_KEY')}"

when 'reset'
  pws = AWS::PWS::Client.new
  pws.cli.remove('AWS_ACCESS_KEY_ID')
  pws.cli.remove('AWS_SECRET_ACCESS_KEY')

when 'env'
  pws = AWS::PWS::StealthClient.new
  access_key_id = pws.read('AWS_ACCESS_KEY_ID')
  secret_access_key = pws.read('AWS_SECRET_ACCESS_KEY')

  puts "export AWS_ACCESS_KEY_ID=\"#{access_key_id}\""
  puts "export AWS_ACCESS_KEY=\"#{access_key_id}\""
  puts "export AWS_SECRET_ACCESS_KEY=\"#{secret_access_key}\""
  puts "export AWS_SECRET_KEY=\"#{secret_access_key}\""

else
  puts "Usage: #{$PROGRAM_NAME} <command>"
  puts '  Commands: init, cat, env, reset'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws-pws-0.1.1 bin/aws-pws
aws-pws-0.1.0 bin/aws-pws