miau 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/rake.yml +30 -0
- data/.gitignore +6 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.watchr +59 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +110 -0
- data/LICENSE +21 -0
- data/README.md +143 -0
- data/Rakefile +12 -0
- data/lib/miau/error.rb +27 -0
- data/lib/miau/storage.rb +38 -0
- data/lib/miau/version.rb +5 -0
- data/lib/miau.rb +45 -0
- data/miau.gemspec +34 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 260b09e92525eeb312da62c0ef28cb31277f36e120f96915de57a3928498a93d
|
4
|
+
data.tar.gz: 55f3f87be42ebd0ef9faf6e3e1c233da129c4fb6daf958290ceebb129de1a597
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d559ecd15d75b465f041fc559b288bf92a0f396c6d50d362ed18d1c96b53a8632e977f7c5ed1f719e2728fc391e46615320212277b6de08cd73ad5c711a4b4e8
|
7
|
+
data.tar.gz: 0ad1bbf9d9db96321a4e2f131b1c929fba9458afbec43b4577078df8c027cb749e1c35e2ecdcb0e8d7d1a53d6edc256fc7f721de2ce9a196e95a57dac27e3c10
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# see also https://github.com/whitequark/parser/blob/master/.github/workflows/test.yml
|
2
|
+
name: Rake
|
3
|
+
|
4
|
+
#on: [push, pull_request]
|
5
|
+
on: [push]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
# os: [ubuntu-latest, macos-latest]
|
13
|
+
os: [ubuntu-latest]
|
14
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
15
|
+
# ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head, truffleruby, truffleruby-head]
|
16
|
+
ruby: ["2.7.2", "2.7.3", "3.0.2"]
|
17
|
+
test_command: ["bundle exec rake test"]
|
18
|
+
runs-on: ${{ matrix.os }}
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
- name: Bundle install
|
26
|
+
run: |
|
27
|
+
bundle config path /home/runner/bundle
|
28
|
+
bundle install
|
29
|
+
bundle update
|
30
|
+
- run: ${{ matrix.test_command }}
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rails-6.1
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-3.0.2
|
data/.watchr
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
TESTING = %w[test]
|
2
|
+
HH = "#" * 22 unless defined?(HH)
|
3
|
+
H = "#" * 5 unless defined?(H)
|
4
|
+
|
5
|
+
def usage
|
6
|
+
puts <<-EOS
|
7
|
+
Ctrl-\\ or ctrl-4 Running all tests
|
8
|
+
Ctrl-C Exit
|
9
|
+
EOS
|
10
|
+
end
|
11
|
+
|
12
|
+
def run(cmd)
|
13
|
+
puts "#{HH} #{Time.now} #{HH}"
|
14
|
+
puts "#{H} #{cmd}"
|
15
|
+
system "/usr/bin/time --format '#{HH} Elapsed time %E' #{cmd}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_it(type, file)
|
19
|
+
case type
|
20
|
+
when "test" then run %(bundle exec ruby -I test #{file})
|
21
|
+
# when 'spec'; run %(rspec -X #{file})
|
22
|
+
else; puts "#{H} unknown type: #{type}, file: #{file}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def run_all_tests
|
27
|
+
puts "\n#{HH} Running all tests #{HH}\n"
|
28
|
+
TESTING.each { |dir| run "bundle exec rake #{dir}" if File.exist?(dir) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_matching_files(base)
|
32
|
+
base = base.split("_").first
|
33
|
+
TESTING.each { |type|
|
34
|
+
files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
|
35
|
+
run_it type, files.join(" ") unless files.empty?
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
TESTING.each { |type|
|
40
|
+
watch("#{type}/#{type}_helper\.rb") { run_all_tests }
|
41
|
+
watch('lib/.*\.rb') { run_all_tests }
|
42
|
+
watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
|
43
|
+
watch("#{type}/data/(.*)\.rb") { |match|
|
44
|
+
m1 = match[1]
|
45
|
+
run_matching_files("#{type}/#{m1}/#{m1}_#{type}.rb")
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
%w[rb erb haml slim].each { |type|
|
50
|
+
watch(".*/(.*)\.#{type}") { |match|
|
51
|
+
run_matching_files(match[1])
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
# Ctrl-\ or ctrl-4
|
56
|
+
Signal.trap("QUIT") { run_all_tests }
|
57
|
+
# Ctrl-C
|
58
|
+
Signal.trap("INT") { abort("Interrupted\n") }
|
59
|
+
usage
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
miau (0.1.0)
|
5
|
+
activesupport
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actionpack (6.1.4.1)
|
11
|
+
actionview (= 6.1.4.1)
|
12
|
+
activesupport (= 6.1.4.1)
|
13
|
+
rack (~> 2.0, >= 2.0.9)
|
14
|
+
rack-test (>= 0.6.3)
|
15
|
+
rails-dom-testing (~> 2.0)
|
16
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
+
actionview (6.1.4.1)
|
18
|
+
activesupport (= 6.1.4.1)
|
19
|
+
builder (~> 3.1)
|
20
|
+
erubi (~> 1.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
+
activemodel (6.1.4.1)
|
24
|
+
activesupport (= 6.1.4.1)
|
25
|
+
activesupport (6.1.4.1)
|
26
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
|
+
i18n (>= 1.6, < 2)
|
28
|
+
minitest (>= 5.1)
|
29
|
+
tzinfo (~> 2.0)
|
30
|
+
zeitwerk (~> 2.3)
|
31
|
+
ast (2.4.2)
|
32
|
+
benchmark-ips (2.9.1)
|
33
|
+
builder (3.2.4)
|
34
|
+
concurrent-ruby (1.1.9)
|
35
|
+
crass (1.0.6)
|
36
|
+
docile (1.4.0)
|
37
|
+
erubi (1.10.0)
|
38
|
+
i18n (1.8.10)
|
39
|
+
concurrent-ruby (~> 1.0)
|
40
|
+
loofah (2.12.0)
|
41
|
+
crass (~> 1.0.2)
|
42
|
+
nokogiri (>= 1.5.9)
|
43
|
+
minitest (5.14.4)
|
44
|
+
nokogiri (1.12.4-x86_64-linux)
|
45
|
+
racc (~> 1.4)
|
46
|
+
observr (1.0.5)
|
47
|
+
parallel (1.20.1)
|
48
|
+
parser (3.0.2.0)
|
49
|
+
ast (~> 2.4.1)
|
50
|
+
racc (1.5.2)
|
51
|
+
rack (2.2.3)
|
52
|
+
rack-test (1.1.0)
|
53
|
+
rack (>= 1.0, < 3)
|
54
|
+
rails-dom-testing (2.0.3)
|
55
|
+
activesupport (>= 4.2.0)
|
56
|
+
nokogiri (>= 1.6)
|
57
|
+
rails-html-sanitizer (1.4.2)
|
58
|
+
loofah (~> 2.3)
|
59
|
+
rainbow (3.0.0)
|
60
|
+
rake (13.0.6)
|
61
|
+
regexp_parser (2.1.1)
|
62
|
+
rexml (3.2.5)
|
63
|
+
ricecream (0.2.0)
|
64
|
+
rubocop (1.20.0)
|
65
|
+
parallel (~> 1.10)
|
66
|
+
parser (>= 3.0.0.0)
|
67
|
+
rainbow (>= 2.2.2, < 4.0)
|
68
|
+
regexp_parser (>= 1.8, < 3.0)
|
69
|
+
rexml
|
70
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
71
|
+
ruby-progressbar (~> 1.7)
|
72
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
73
|
+
rubocop-ast (1.11.0)
|
74
|
+
parser (>= 3.0.1.1)
|
75
|
+
rubocop-performance (1.11.5)
|
76
|
+
rubocop (>= 1.7.0, < 2.0)
|
77
|
+
rubocop-ast (>= 0.4.0)
|
78
|
+
ruby-progressbar (1.11.0)
|
79
|
+
simplecov (0.21.2)
|
80
|
+
docile (~> 1.1)
|
81
|
+
simplecov-html (~> 0.11)
|
82
|
+
simplecov_json_formatter (~> 0.1)
|
83
|
+
simplecov-html (0.12.3)
|
84
|
+
simplecov_json_formatter (0.1.3)
|
85
|
+
standard (1.3.0)
|
86
|
+
rubocop (= 1.20.0)
|
87
|
+
rubocop-performance (= 1.11.5)
|
88
|
+
tzinfo (2.0.4)
|
89
|
+
concurrent-ruby (~> 1.0)
|
90
|
+
unicode-display_width (2.0.0)
|
91
|
+
zeitwerk (2.4.2)
|
92
|
+
|
93
|
+
PLATFORMS
|
94
|
+
x86_64-linux
|
95
|
+
|
96
|
+
DEPENDENCIES
|
97
|
+
actionpack
|
98
|
+
activemodel
|
99
|
+
benchmark-ips
|
100
|
+
bundler
|
101
|
+
miau!
|
102
|
+
minitest
|
103
|
+
observr
|
104
|
+
rake
|
105
|
+
ricecream
|
106
|
+
simplecov
|
107
|
+
standard
|
108
|
+
|
109
|
+
BUNDLED WITH
|
110
|
+
2.2.22
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Dittmar Krall
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
Miau
|
2
|
+
====
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/miau.png)](http://badge.fury.io/rb/miau)
|
4
|
+
|
5
|
+
Miau (MIcro AUthorization) is a simple authorization library for Rails
|
6
|
+
inspired by Pundit and Banken.
|
7
|
+
Miau provides a set of helpers which restricts what resources
|
8
|
+
a given user is allowed to access.
|
9
|
+
|
10
|
+
Installation
|
11
|
+
------------
|
12
|
+
|
13
|
+
~~~ ruby
|
14
|
+
# Gemfile
|
15
|
+
gem "miau"
|
16
|
+
~~~
|
17
|
+
|
18
|
+
and run "bundle install".
|
19
|
+
|
20
|
+
Usage (as intended)
|
21
|
+
-------------------
|
22
|
+
|
23
|
+
~~~ ruby
|
24
|
+
# app/models/application_controller.rb
|
25
|
+
class ApplicationController < ActionController::Base
|
26
|
+
...
|
27
|
+
include Miau
|
28
|
+
...
|
29
|
+
end
|
30
|
+
~~~
|
31
|
+
|
32
|
+
~~~ ruby
|
33
|
+
# app/controllers/posts_controller.rb # app/views/posts/update.rb
|
34
|
+
class PostsController < ApplicationController <% if authorized? %>
|
35
|
+
... ...
|
36
|
+
def update <% else %>
|
37
|
+
... ...
|
38
|
+
authorize! <% end %>
|
39
|
+
...
|
40
|
+
end
|
41
|
+
...
|
42
|
+
end
|
43
|
+
~~~
|
44
|
+
|
45
|
+
~~~ ruby
|
46
|
+
# app/policies/application_policy.rb # app/policies/posts_policy.rb
|
47
|
+
class ApplicationPolicy class PostsPolicy < ApplicationPolicy
|
48
|
+
attr_reader :user, :resource ...
|
49
|
+
def update
|
50
|
+
def initalize(user, resource) user.admin? && resource.published?
|
51
|
+
@user = user end
|
52
|
+
@resource = resource ...
|
53
|
+
end end
|
54
|
+
...
|
55
|
+
def update
|
56
|
+
false
|
57
|
+
end
|
58
|
+
...
|
59
|
+
end
|
60
|
+
~~~
|
61
|
+
|
62
|
+
"authorize!" will raise an exception (which can be handled by "rescue")
|
63
|
+
in case a policy returns "false" or isn't available.
|
64
|
+
|
65
|
+
"authorized?" will return the value of the policy.
|
66
|
+
|
67
|
+
|
68
|
+
Internals
|
69
|
+
---------
|
70
|
+
|
71
|
+
At the bottom line based on a "policy" and an "action"
|
72
|
+
a corresponding policy method is called.
|
73
|
+
|
74
|
+
The policy method has access to the "user" and the "resource".
|
75
|
+
|
76
|
+
"user" is set by the default method "miau_user" (can be overwritten) as:
|
77
|
+
|
78
|
+
~~~
|
79
|
+
# app/models/application_controller.rb
|
80
|
+
...
|
81
|
+
def miau_user
|
82
|
+
current_user
|
83
|
+
end
|
84
|
+
...
|
85
|
+
~~~
|
86
|
+
|
87
|
+
The default value for "policy" is inferred from "params[:controller]".
|
88
|
+
i.e. "authorize!" called from "PostsController" will
|
89
|
+
set the "policy" to "PostsPolicy".
|
90
|
+
|
91
|
+
The default value for "action" is set by "params[:action]".
|
92
|
+
|
93
|
+
"resource" may be set as a parameter.
|
94
|
+
|
95
|
+
A full blown sample :
|
96
|
+
|
97
|
+
~~~
|
98
|
+
authorize! article, policy: :Comments, action: :extract
|
99
|
+
~~~
|
100
|
+
|
101
|
+
Usage (more elaborated)
|
102
|
+
-----------------------
|
103
|
+
|
104
|
+
~~~ ruby
|
105
|
+
# app/models/application_controller.rb
|
106
|
+
class ApplicationController
|
107
|
+
...
|
108
|
+
include Miau
|
109
|
+
...
|
110
|
+
|
111
|
+
after_action { verify_authorized }
|
112
|
+
|
113
|
+
def miau_user
|
114
|
+
current_user
|
115
|
+
end
|
116
|
+
|
117
|
+
rescue Miau::NotDefinedError
|
118
|
+
# do some logging or whatever
|
119
|
+
|
120
|
+
rescue Miau::NotAuthorizedError
|
121
|
+
# do some logging or whatever
|
122
|
+
|
123
|
+
rescue Miau::AuthorizationNotPerformedError
|
124
|
+
# do some logging or whatever
|
125
|
+
|
126
|
+
...
|
127
|
+
end
|
128
|
+
~~~
|
129
|
+
|
130
|
+
Policies remain as before.
|
131
|
+
Rescue's may be inserted previously in the exception chain.
|
132
|
+
|
133
|
+
"verify_authorized" checks that an "authorize!" has been called.
|
134
|
+
|
135
|
+
|
136
|
+
PORO
|
137
|
+
----
|
138
|
+
Miau is a very small library, it just provides a few helpers.
|
139
|
+
All of the policy classes are just plain Ruby classes,
|
140
|
+
allowing DRY, encapsulation, aliasing and inheritance.
|
141
|
+
|
142
|
+
There is no magic behind the scenes.
|
143
|
+
Just the embedding in Rails required some specific knowledge.
|
data/Rakefile
ADDED
data/lib/miau/error.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
module Miau
|
2
|
+
class Error < StandardError; end
|
3
|
+
|
4
|
+
class NotAuthorizedError < Error
|
5
|
+
attr_reader :controller, :query, :policy
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
if options.is_a? String
|
9
|
+
message = options
|
10
|
+
else
|
11
|
+
@controller = options[:controller]
|
12
|
+
@query = options[:query]
|
13
|
+
@policy = options[:policy]
|
14
|
+
|
15
|
+
message = options.fetch(:message) { "not allowed to #{query} of #{controller} by #{policy.inspect}" }
|
16
|
+
end
|
17
|
+
|
18
|
+
super(message)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class NotDefinedError < Error
|
23
|
+
end
|
24
|
+
|
25
|
+
class AuthorizationNotPerformedError < Error
|
26
|
+
end
|
27
|
+
end
|
data/lib/miau/storage.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "singleton"
|
2
|
+
|
3
|
+
module Miau
|
4
|
+
class PolicyStorage
|
5
|
+
include Singleton
|
6
|
+
|
7
|
+
attr_reader :policies
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@policies = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def run(klass, action, user, resource)
|
14
|
+
policy = policy(klass, user, resource)
|
15
|
+
raise Miau::NotDefinedError unless policy.respond_to?(action)
|
16
|
+
policy.send(action)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def policy(klass, user, resource)
|
22
|
+
result = @policies[klass]
|
23
|
+
if result
|
24
|
+
result.user = user
|
25
|
+
result.resource = resource
|
26
|
+
return result
|
27
|
+
end
|
28
|
+
|
29
|
+
create_policy(klass, user, resource)
|
30
|
+
end
|
31
|
+
|
32
|
+
def create_policy(klass, user, resource)
|
33
|
+
str = "#{klass}Policy"
|
34
|
+
result = str.constantize.new(user, resource)
|
35
|
+
@policies[klass] = result
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/miau/version.rb
ADDED
data/lib/miau.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require "active_support/concern"
|
2
|
+
require "miau/version"
|
3
|
+
require "miau/error"
|
4
|
+
require "miau/storage"
|
5
|
+
|
6
|
+
module Miau
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
included do
|
10
|
+
if respond_to?(:helper_method)
|
11
|
+
helper_method :authorized?
|
12
|
+
helper_method :miau_user
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def authorize!(resource = nil, hsh = {})
|
17
|
+
@_miau_authorization_performed = true
|
18
|
+
result = authorized?(resource, hsh)
|
19
|
+
raise Miau::NotAuthorizedError unless result == true
|
20
|
+
end
|
21
|
+
|
22
|
+
def authorized?(resource = nil, hsh = {})
|
23
|
+
klass = hsh[:class]
|
24
|
+
klass ||= params[:controller].camelize
|
25
|
+
action = hsh[:action]
|
26
|
+
action ||= params[:action]
|
27
|
+
Miau::PolicyStorage.instance.run(klass, action, miau_user, resource)
|
28
|
+
end
|
29
|
+
|
30
|
+
def miau_user
|
31
|
+
current_user
|
32
|
+
end
|
33
|
+
|
34
|
+
def skip_authorization
|
35
|
+
@_miau_authorization_performed = true
|
36
|
+
end
|
37
|
+
|
38
|
+
def verify_authorized
|
39
|
+
raise AuthorizationNotPerformedError unless miau_authorization_performed?
|
40
|
+
end
|
41
|
+
|
42
|
+
def miau_authorization_performed?
|
43
|
+
!!@_miau_authorization_performed
|
44
|
+
end
|
45
|
+
end
|
data/miau.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "miau/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "miau"
|
7
|
+
s.version = Miau::VERSION
|
8
|
+
s.authors = ["Dittmar Krall"]
|
9
|
+
s.email = ["dittmar.krall@matique.com"]
|
10
|
+
|
11
|
+
s.summary = %(Simple and lightweight authorization solution for Rails.)
|
12
|
+
s.description = <<~EOS
|
13
|
+
Miau provides a set of helpers which restricts what
|
14
|
+
resources a given user is allowed to access.
|
15
|
+
EOS
|
16
|
+
s.homepage = "https://github.com/matique/miau"
|
17
|
+
s.license = "MIT"
|
18
|
+
|
19
|
+
s.metadata["source_code_uri"] = "https://github.com/matique/miau"
|
20
|
+
|
21
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|features)/}) }
|
22
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
s.require_paths = ["lib"]
|
24
|
+
|
25
|
+
s.add_runtime_dependency "activesupport"
|
26
|
+
|
27
|
+
s.add_development_dependency "activemodel"
|
28
|
+
s.add_development_dependency "actionpack"
|
29
|
+
s.add_development_dependency "bundler"
|
30
|
+
s.add_development_dependency "rake"
|
31
|
+
|
32
|
+
s.add_development_dependency "minitest"
|
33
|
+
s.add_development_dependency "ricecream"
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: miau
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dittmar Krall
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activemodel
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: actionpack
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: ricecream
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: |
|
112
|
+
Miau provides a set of helpers which restricts what
|
113
|
+
resources a given user is allowed to access.
|
114
|
+
email:
|
115
|
+
- dittmar.krall@matique.com
|
116
|
+
executables: []
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".github/workflows/rake.yml"
|
121
|
+
- ".gitignore"
|
122
|
+
- ".ruby-gemset"
|
123
|
+
- ".ruby-version"
|
124
|
+
- ".watchr"
|
125
|
+
- Gemfile
|
126
|
+
- Gemfile.lock
|
127
|
+
- LICENSE
|
128
|
+
- README.md
|
129
|
+
- Rakefile
|
130
|
+
- lib/miau.rb
|
131
|
+
- lib/miau/error.rb
|
132
|
+
- lib/miau/storage.rb
|
133
|
+
- lib/miau/version.rb
|
134
|
+
- miau.gemspec
|
135
|
+
homepage: https://github.com/matique/miau
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
metadata:
|
139
|
+
source_code_uri: https://github.com/matique/miau
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options: []
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '0'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubygems_version: 3.2.22
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: Simple and lightweight authorization solution for Rails.
|
159
|
+
test_files: []
|