aws-auth 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -9,9 +9,9 @@ require 'sinatra'
9
9
  module AWSAuth
10
10
  class Base
11
11
 
12
- VERSION = "0.9.0"
12
+ VERSION = "0.9.1"
13
13
  ROOT_DIR = ENV['AWS_ROOT_DIR'] || File.join(File.dirname(__FILE__),'..')
14
- DEFAULT_PASSWORD = "testp@ss"
14
+ DEFAULT_PASSWORD = "pass@word1"
15
15
 
16
16
  def self.config
17
17
  @@config ||= load_config()
@@ -1,15 +1,14 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
3
  require 'rake/gempackagetask'
4
- require File.join(File.dirname(__FILE__), '../aws-auth')
5
4
 
6
- namespace :auth do
7
- task :environment do
5
+ namespace :db do
6
+ task :auth_environment do
8
7
  ActiveRecord::Base.establish_connection(AWSAuth::Base.config[:auth])
9
8
  end
10
9
 
11
10
  desc "Migrate the database"
12
- task(:migrate => :environment) do
11
+ task(:auth => :auth_environment) do
13
12
  ActiveRecord::Base.logger = Logger.new(STDOUT)
14
13
  ActiveRecord::Migration.verbose = true
15
14
 
@@ -19,10 +18,11 @@ namespace :auth do
19
18
  ActiveRecord::Migrator.migrate(File.join(AWSAuth::Base::ROOT_DIR, 'db', 'migrate'), ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
20
19
  num_users = AWSAuth::User.count || 0
21
20
  if num_users == 0
22
- puts "** No users found, creating the `admin' user."
23
- AWSAuth::User.create :login => "admin", :password => AWSAuth::Base::DEFAULT_PASSWORD,
21
+ puts "** No users found, creating the `admin' user with password `#{AWSAuth::Base::DEFAULT_PASSWORD}'"
22
+ user = AWSAuth::User.new :login => "admin", :password => AWSAuth::Base::DEFAULT_PASSWORD,
24
23
  :email => "admin@parkplace.net", :key => AWSAuth::Base.generate_key(), :secret => AWSAuth::Base.generate_secret(),
25
24
  :activated_at => Time.now, :superuser => 1
25
+ user.save()
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Ricciardi