heimdall_auth 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/lib/heimdall_auth/user.rb +1 -1
- data/lib/heimdall_auth/version.rb +1 -1
- data/lib/tasks/puma_dev_link.rake +1 -1
- data/lib/tasks/register.rake +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 742947664e984d95bc5826204abc96c26772675b25454ec2969381981ebff693
|
4
|
+
data.tar.gz: cc454c59ae75aa688d1326c8b86d84123836e8fdeefd6f18426827361f7ec9a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f1f5f7e585eb8df02c7b8401d28e339d5dc04798f7381d132be8abebc850df9bc0a198a656ac2921389a6b6d3f4316d585f0aa97e4b08f322c4484c748efd66
|
7
|
+
data.tar.gz: 7f37c2d5d077dd2a600b8c023bbb5f4e1e8ddf2f271a4ae7867099a089978de7d6f25f23ebdda02e44f8c26faadde94ef18e0b61fce206dd6206f0287351a713
|
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
This makes it easy to equip an empty rails application with our Heimdall Auth features.
|
3
3
|
|
4
4
|
## Installation and Usage
|
5
|
+
|
6
|
+
Example: https://gitlab.vesputi.com/netzmap/nanna
|
7
|
+
|
5
8
|
0) Commit the empty rails application (and mention the command you used for generating the app)
|
6
9
|
|
7
10
|
1) Add this line to your application's Gemfile:
|
@@ -67,3 +70,13 @@ Parameters:
|
|
67
70
|
-h"https://heimdall.vesp" (Optional) - Protocol and Domain the heimdall is found at
|
68
71
|
-s"https://foo.vesputi-abc.de" # (Optional) - Protocol and Domain the Service is found at
|
69
72
|
```
|
73
|
+
|
74
|
+
## RSpec
|
75
|
+
If you want to test your Applications controller than you have to give it a User
|
76
|
+
You do so by mocking `current_user` in ApplicationController
|
77
|
+
|
78
|
+
```
|
79
|
+
RSpec.describe "/foobar", type: :request do
|
80
|
+
before { allow_any_instance_of(ApplicationController).to receive(:current_user) { HeimdallAuth::User.new(is_editor: true) } }
|
81
|
+
end
|
82
|
+
```
|
data/lib/heimdall_auth/user.rb
CHANGED
@@ -3,7 +3,7 @@ class HeimdallAuth::User
|
|
3
3
|
extend ActiveModel::Naming
|
4
4
|
|
5
5
|
attr_accessor :is_invalid
|
6
|
-
attr_accessor :id, :name, :email, :is_editor, :is_operator, :is_admin, :is_user_admin
|
6
|
+
attr_accessor :id, :name, :email, :is_editor, :is_operator, :is_admin, :is_user_admin, :is_police, :is_ride_on_demand_provider
|
7
7
|
|
8
8
|
def initialize(attributes = {})
|
9
9
|
attributes.each do |name, value|
|
@@ -2,7 +2,7 @@ namespace :puma_dev do
|
|
2
2
|
desc 'Fast linking to puma dev'
|
3
3
|
task :link do
|
4
4
|
|
5
|
-
application_name = Rails.application.class.parent_name
|
5
|
+
application_name = Rails.application.class.try(:parent_name) || Rails.application.class.try(:module_parent_name)
|
6
6
|
puma_dev_app_name = "#{application_name.underscore.dasherize}.vesputi-abc"
|
7
7
|
command = "ln -s #{Rails.root} ~/.puma-dev/#{puma_dev_app_name}"
|
8
8
|
|
data/lib/tasks/register.rake
CHANGED
@@ -7,7 +7,7 @@ namespace :heimdall do
|
|
7
7
|
desc 'Register application at a Heimdall Application'
|
8
8
|
task :register do
|
9
9
|
|
10
|
-
application_name = Rails.application.class.parent_name
|
10
|
+
application_name = Rails.application.class.try(:parent_name) || Rails.application.class.try(:module_parent_name)
|
11
11
|
|
12
12
|
options = {
|
13
13
|
application_name: application_name,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heimdall_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- René Meye
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -122,7 +122,7 @@ homepage: https://vesputi.com
|
|
122
122
|
licenses:
|
123
123
|
- MIT
|
124
124
|
metadata: {}
|
125
|
-
post_install_message:
|
125
|
+
post_install_message:
|
126
126
|
rdoc_options: []
|
127
127
|
require_paths:
|
128
128
|
- lib
|
@@ -137,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
141
|
-
signing_key:
|
140
|
+
rubygems_version: 3.1.6
|
141
|
+
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Summary of HeimdallAuth.
|
144
144
|
test_files: []
|