balrog 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +37 -0
- data/LICENSE.txt +21 -0
- data/README.md +84 -0
- data/Rakefile +6 -0
- data/app/assets/images/balrog/logo.png +0 -0
- data/app/assets/stylesheets/balrog/gate.css +57 -0
- data/app/views/balrog/gate.html.erb +26 -0
- data/balrog.gemspec +31 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/balrog.rb +7 -0
- data/lib/balrog/engine.rb +18 -0
- data/lib/balrog/generators.rb +6 -0
- data/lib/balrog/generators/install_generator.rb +15 -0
- data/lib/balrog/helpers.rb +8 -0
- data/lib/balrog/middleware.rb +66 -0
- data/lib/balrog/password_hasher.rb +18 -0
- data/lib/balrog/rake_tasks.rb +6 -0
- data/lib/balrog/tasks/generate_hash.rake +6 -0
- data/lib/balrog/version.rb +3 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d547df9399a56595525e88ceedc04c00d5cb8f85cee27416207936a073c7dd1a
|
4
|
+
data.tar.gz: '075180b9db86f64cc1f158d03e9b7207979b9cf0641af2d849f1cdc64b7117b8'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8b2232fc4ef9d7f6f520e6b38f9d495d192258429451fe664ba526f49859f089682219b998dcc0ae5f1d3170cb3943a048a5638475d7869162f2ed63b44f3612
|
7
|
+
data.tar.gz: b7a2f314a0b1cd7afd0ff667c2d6799f760ac0c91be8e1f204c108a2a10ffb09df9f99aa594e161168782f03926c95ae012f02b508c1e2fe62bd88e2b8169fc3
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at dev@pixielabs.io. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
balrog (0.1.0)
|
5
|
+
bcrypt (~> 3.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
bcrypt (3.1.12)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
rake (10.5.0)
|
13
|
+
rspec (3.8.0)
|
14
|
+
rspec-core (~> 3.8.0)
|
15
|
+
rspec-expectations (~> 3.8.0)
|
16
|
+
rspec-mocks (~> 3.8.0)
|
17
|
+
rspec-core (3.8.0)
|
18
|
+
rspec-support (~> 3.8.0)
|
19
|
+
rspec-expectations (3.8.2)
|
20
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
21
|
+
rspec-support (~> 3.8.0)
|
22
|
+
rspec-mocks (3.8.0)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.8.0)
|
25
|
+
rspec-support (3.8.0)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
balrog!
|
32
|
+
bundler (~> 2.0)
|
33
|
+
rake (~> 10.0)
|
34
|
+
rspec (~> 3.0)
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Pixie Labs
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Balrog
|
2
|
+
|
3
|
+

|
4
|
+
|
5
|
+
Balrog is a lightweight authorization library for Ruby on Rails that can
|
6
|
+
protect your routes with a single username & password combination.
|
7
|
+
|
8
|
+
Balrog is an alternative to `http_basic_authentication_with` that provides some
|
9
|
+
advantages:
|
10
|
+
|
11
|
+
* Uses a password hash instead of a plaintext password.
|
12
|
+
* Provides a lightweight HTML form instead of inconsistent basic
|
13
|
+
authentication.
|
14
|
+
* Better support for password managers (which often don't support basic
|
15
|
+
authentication dialog boxes).
|
16
|
+
|
17
|
+
## Requirements
|
18
|
+
|
19
|
+
Balrog is designed to be used with Ruby on Rails applications, and has been
|
20
|
+
tested against Ruby on Rails 5.
|
21
|
+
|
22
|
+
## Installation
|
23
|
+
|
24
|
+
Add the gem to your Gemfile:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
gem 'balrog'
|
28
|
+
```
|
29
|
+
|
30
|
+
Run the installer to generate an initializer:
|
31
|
+
|
32
|
+
```
|
33
|
+
$ bundle exec rails generate balrog:install
|
34
|
+
Enter New Password:
|
35
|
+
Confirm New Password:
|
36
|
+
create config/initializers/balrog.rb
|
37
|
+
$
|
38
|
+
```
|
39
|
+
|
40
|
+
## Regenerating a password hash
|
41
|
+
|
42
|
+
If you need to create a new password, modify the hash in the Balrog initializer.
|
43
|
+
You can generate a new hash with the provided Rake task:
|
44
|
+
|
45
|
+
```
|
46
|
+
$ bundle exec rails balrog:generate_hash
|
47
|
+
New password: *******
|
48
|
+
Type again: *******
|
49
|
+
|
50
|
+
$2a$04$8U/Yun3MZ5..FuT9yUJNK.F2uUuHagtvsD.CNc5lSZegzq9eJjwqu
|
51
|
+
|
52
|
+
Copy this hash into config/initializers/balrog.rb
|
53
|
+
```
|
54
|
+
|
55
|
+
## Restricting access in a controller
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
class AdminController < ApplicationController
|
59
|
+
before_action :authenticate_with_balrog!
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md).
|
66
|
+
- Check out the latest master to make sure the feature hasn't been implemented
|
67
|
+
or the bug hasn't been fixed yet.
|
68
|
+
- Check out the issue tracker to make sure someone already hasn't requested it
|
69
|
+
and/or contributed it.
|
70
|
+
- Fork the project.
|
71
|
+
- Start a feature/bugfix branch.
|
72
|
+
- Commit and push until you are happy with your contribution.
|
73
|
+
- Please try not to mess with the package.json, version, or history. If you
|
74
|
+
want to have your own version, or is otherwise necessary, that is fine, but
|
75
|
+
please isolate to its own commit so we can cherry-pick around it.
|
76
|
+
|
77
|
+
|
78
|
+
## TODO
|
79
|
+
|
80
|
+
* Restricting access via `routes.rb`
|
81
|
+
* Logout
|
82
|
+
* Test coverage
|
83
|
+
* Check it's OK with Ruby on Rails 6
|
84
|
+
* Expire sessions
|
data/Rakefile
ADDED
Binary file
|
@@ -0,0 +1,57 @@
|
|
1
|
+
section {
|
2
|
+
text-align: center;
|
3
|
+
position: fixed;
|
4
|
+
top: 40%;
|
5
|
+
left: 50%;
|
6
|
+
transform: translate(-50%, -50%);
|
7
|
+
padding: 5%;
|
8
|
+
background-color: white;
|
9
|
+
box-shadow: 0px 0px 20px darkslategrey;
|
10
|
+
}
|
11
|
+
|
12
|
+
body {
|
13
|
+
background-color: slategray;
|
14
|
+
font-family: 'Helvetica Neue', 'Helvetica', Calibri, 'Trebuchet MS', sans-serif;
|
15
|
+
}
|
16
|
+
|
17
|
+
footer {
|
18
|
+
display: flex;
|
19
|
+
position: fixed;
|
20
|
+
right: 0;
|
21
|
+
bottom: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
.logo {
|
25
|
+
max-width: 100px;
|
26
|
+
padding: 20px;
|
27
|
+
align-self: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
button {
|
31
|
+
-webkit-appearance: button;
|
32
|
+
overflow: visible;
|
33
|
+
text-transform: none;
|
34
|
+
-webkit-transition-duration: 0.4s;
|
35
|
+
transition-duration: 0.4s;
|
36
|
+
transition-property: background-color;
|
37
|
+
background-color: rgb(241, 81, 81);
|
38
|
+
color: white;
|
39
|
+
font-size: 20px;
|
40
|
+
font-family: 'Helvetica Neue', 'Helvetica', Calibri, 'Trebuchet MS', sans-serif;
|
41
|
+
cursor: pointer;
|
42
|
+
padding: 8px 10px;
|
43
|
+
border: 0;
|
44
|
+
font-weight: 100;
|
45
|
+
letter-spacing: 1px;
|
46
|
+
}
|
47
|
+
|
48
|
+
button:hover {
|
49
|
+
background-color: rgb(201, 41, 41);
|
50
|
+
}
|
51
|
+
|
52
|
+
input {
|
53
|
+
font-size: 20px;
|
54
|
+
padding: 5px 10px;
|
55
|
+
font-family: 'Helvetica Neue', 'Helvetica', Calibri, 'Trebuchet MS', sans-serif;
|
56
|
+
}
|
57
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html lang=en>
|
3
|
+
<head>
|
4
|
+
<meta charset=utf-8>
|
5
|
+
<title>Login</title>
|
6
|
+
<%= stylesheet_link_tag "balrog/gate" %>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<section>
|
12
|
+
<form action='/balrog/signin' method='POST'>
|
13
|
+
<input autofocus type='password' name='password' placeholder='Password'>
|
14
|
+
<button type='submit'>Login</button>
|
15
|
+
</form>
|
16
|
+
</section>
|
17
|
+
|
18
|
+
<footer>
|
19
|
+
<a href="https://github.com/pixielabs/balrog" target="_blank">
|
20
|
+
<%= image_tag "balrog/logo.png", class: 'logo' %>
|
21
|
+
</a>
|
22
|
+
</footer>
|
23
|
+
|
24
|
+
</body>
|
25
|
+
|
26
|
+
</html>
|
data/balrog.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "balrog/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "balrog"
|
8
|
+
spec.version = Balrog::VERSION
|
9
|
+
spec.authors = ["Pixie Labs"]
|
10
|
+
spec.email = ["dev@pixielabs.io"]
|
11
|
+
|
12
|
+
spec.summary = %q{An alternative to HTTP basic auth}
|
13
|
+
spec.description = %q{Balrog is a lightweight authorization library for Ruby on Rails that can protect your routes with a single password.}
|
14
|
+
spec.homepage = "https://github.com/pixielabs/balrog"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_dependency "bcrypt", "~> 3.0"
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "balrog"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/balrog.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require_relative 'helpers'
|
2
|
+
|
3
|
+
class Balrog::Engine < Rails::Engine
|
4
|
+
# Make the Balrog helpers available in any controller.
|
5
|
+
initializer "balrog.configure_rails_initialization" do
|
6
|
+
ActiveSupport.on_load(:action_controller) do
|
7
|
+
include Balrog::Helpers
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# Precompile the Balrog assets
|
12
|
+
initializer "balrog.assets.precompile" do |app|
|
13
|
+
app.config.assets.precompile += %w(
|
14
|
+
balrog/gate.css
|
15
|
+
balrog/logo.png
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative '../password_hasher'
|
2
|
+
|
3
|
+
class Balrog::InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
desc "Creates a balrog initializer and configures it with the provided password (you'll be prompted for it)."
|
6
|
+
def create_initializer_file
|
7
|
+
password_hash = PasswordHasher.encrypt_password
|
8
|
+
contents = <<~EOF
|
9
|
+
Rails.application.config.middleware.use Balrog::Middleware do
|
10
|
+
password_hash '#{password_hash}'
|
11
|
+
end
|
12
|
+
EOF
|
13
|
+
create_file "config/initializers/balrog.rb", contents
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'bcrypt'
|
2
|
+
|
3
|
+
# Public: Balrog middleware that handles form submissions, checking the
|
4
|
+
# password against the configured hash, and setting a session variable if
|
5
|
+
# they match.
|
6
|
+
#
|
7
|
+
# This is typically set up in an initialize when you run
|
8
|
+
# `rails g balrog:install`, and looks a bit like this:
|
9
|
+
#
|
10
|
+
# Rails.application.config.middleware.use Balrog::Middleware do
|
11
|
+
# password_hash '<bcrypt hash>'
|
12
|
+
# end
|
13
|
+
class Balrog::Middleware
|
14
|
+
def initialize(app, &block)
|
15
|
+
@app = app
|
16
|
+
instance_eval(&block) if block_given?
|
17
|
+
end
|
18
|
+
|
19
|
+
def call(env)
|
20
|
+
path = env["PATH_INFO"]
|
21
|
+
method = env["REQUEST_METHOD"]
|
22
|
+
if method == 'POST' && path == '/balrog/signin'
|
23
|
+
handle_login(env)
|
24
|
+
else
|
25
|
+
@app.call(env)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def password_hash(input)
|
32
|
+
@password_hash = BCrypt::Password.new(input)
|
33
|
+
end
|
34
|
+
|
35
|
+
def handle_login(env)
|
36
|
+
if env['rack.request.form_hash']
|
37
|
+
submitted_password = env['rack.request.form_hash']['password']
|
38
|
+
end
|
39
|
+
|
40
|
+
unless submitted_password
|
41
|
+
return [302, {"Location" => referer}, [""]]
|
42
|
+
end
|
43
|
+
|
44
|
+
unless @password_hash
|
45
|
+
warn <<~EOF
|
46
|
+
|
47
|
+
!! Balrog has not been configured with a password_hash. You shall not
|
48
|
+
!! pass! When adding Balrog::Middleware to your middleware stack, pass
|
49
|
+
!! in a block and call `password_hash` passing in a bcrypt hash.
|
50
|
+
!!
|
51
|
+
!! Check out https://github.com/pixielabs/balrog for more information.
|
52
|
+
|
53
|
+
EOF
|
54
|
+
end
|
55
|
+
|
56
|
+
if @password_hash == submitted_password
|
57
|
+
env['rack.session'][:balrog] = 'authenticated'
|
58
|
+
end
|
59
|
+
|
60
|
+
referer = env["HTTP_REFERER"] || '/'
|
61
|
+
|
62
|
+
[302, {"Location" => referer}, [""]]
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'bcrypt'
|
2
|
+
require 'io/console'
|
3
|
+
|
4
|
+
class PasswordHasher
|
5
|
+
def self.encrypt_password
|
6
|
+
print "Enter New Password: "
|
7
|
+
password = STDIN.noecho(&:gets).chomp
|
8
|
+
print "\nConfirm New Password: "
|
9
|
+
if password == STDIN.noecho(&:gets).chomp then
|
10
|
+
password_hash = BCrypt::Password.create(password)
|
11
|
+
puts "\n"
|
12
|
+
password_hash
|
13
|
+
else
|
14
|
+
puts "\n"
|
15
|
+
warn 'Passwords did not match :('
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: balrog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pixie Labs
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bcrypt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
description: Balrog is a lightweight authorization library for Ruby on Rails that
|
70
|
+
can protect your routes with a single password.
|
71
|
+
email:
|
72
|
+
- dev@pixielabs.io
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".travis.yml"
|
80
|
+
- CODE_OF_CONDUCT.md
|
81
|
+
- Gemfile
|
82
|
+
- Gemfile.lock
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- app/assets/images/balrog/logo.png
|
87
|
+
- app/assets/stylesheets/balrog/gate.css
|
88
|
+
- app/views/balrog/gate.html.erb
|
89
|
+
- balrog.gemspec
|
90
|
+
- bin/console
|
91
|
+
- bin/setup
|
92
|
+
- lib/balrog.rb
|
93
|
+
- lib/balrog/engine.rb
|
94
|
+
- lib/balrog/generators.rb
|
95
|
+
- lib/balrog/generators/install_generator.rb
|
96
|
+
- lib/balrog/helpers.rb
|
97
|
+
- lib/balrog/middleware.rb
|
98
|
+
- lib/balrog/password_hasher.rb
|
99
|
+
- lib/balrog/rake_tasks.rb
|
100
|
+
- lib/balrog/tasks/generate_hash.rake
|
101
|
+
- lib/balrog/version.rb
|
102
|
+
homepage: https://github.com/pixielabs/balrog
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubygems_version: 3.0.2
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: An alternative to HTTP basic auth
|
125
|
+
test_files: []
|