aws-auth 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/db/aws-users.db +0 -0
- data/lib/aws-auth.rb +2 -2
- data/lib/aws-auth/tasks.rb +6 -6
- metadata +3 -3
data/db/aws-users.db
CHANGED
Binary file
|
data/lib/aws-auth.rb
CHANGED
@@ -9,9 +9,9 @@ require 'sinatra'
|
|
9
9
|
module AWSAuth
|
10
10
|
class Base
|
11
11
|
|
12
|
-
VERSION = "0.9.
|
12
|
+
VERSION = "0.9.1"
|
13
13
|
ROOT_DIR = ENV['AWS_ROOT_DIR'] || File.join(File.dirname(__FILE__),'..')
|
14
|
-
DEFAULT_PASSWORD = "
|
14
|
+
DEFAULT_PASSWORD = "pass@word1"
|
15
15
|
|
16
16
|
def self.config
|
17
17
|
@@config ||= load_config()
|
data/lib/aws-auth/tasks.rb
CHANGED
@@ -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 :
|
7
|
-
task :
|
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(:
|
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.
|
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:
|
4
|
+
hash: 57
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 1
|
10
|
+
version: 0.9.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Ricciardi
|