heimdall_auth 1.0.6 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c634abe54e41e340790d559ea8c3217612cb2528d4793df494ba9102272db16
4
- data.tar.gz: 59c738465ac79738a5f0dabf68b4bdea762b56e277bff0c66aefd6eb51727317
3
+ metadata.gz: 4274ae024aaafdfed06a07d367a84d6791c3371fea392642ee0472925b52805c
4
+ data.tar.gz: 2ceea6e5acb7a85c18c126e81c44613a924b4698e7c11e087e28faf514db1059
5
5
  SHA512:
6
- metadata.gz: 1fc1806a83b88680831baf7c15ec0bb31e16bc9fb33c27f6505c35cbbbe12903f7242843d2b9b8eaea69beb85da3d46dee3bb4d3b39224bbd54b6421ad89fa11
7
- data.tar.gz: 17ef8d7102ea817c96ccef442ce344b04259220ee08f7032c8df0dcafa26bea28da4fb13e1a62eeb368c06368cdec6ae98ae57da5719516624cc31ab56786f39
6
+ metadata.gz: a5da2bbf6ea4141f3461ddd4ac57cff7deda52ac2af2abf38fe3ccadae8700e8e1efb3e217f1917945962e6f4093aee25ab6014802507f414a0047ff98bc1ab4
7
+ data.tar.gz: 206d5df045f59a22bc9739024bf19d75334f1ee21f814db019eccdbcd1989f4163ec2838312962e354b5c0ba6fbfae73b0cfa8fb818cfb88489902286b68fa95
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
+ ```
@@ -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, :is_ride_on_demand_accounting
7
7
 
8
8
  def initialize(attributes = {})
9
9
  attributes.each do |name, value|
@@ -1,3 +1,3 @@
1
1
  module HeimdallAuth
2
- VERSION = '1.0.6'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -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
 
@@ -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,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heimdall_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.3.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: 2019-12-24 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '7.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '5.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '7.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: omniauth
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +122,7 @@ homepage: https://vesputi.com
116
122
  licenses:
117
123
  - MIT
118
124
  metadata: {}
119
- post_install_message:
125
+ post_install_message:
120
126
  rdoc_options: []
121
127
  require_paths:
122
128
  - lib
@@ -131,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
137
  - !ruby/object:Gem::Version
132
138
  version: '0'
133
139
  requirements: []
134
- rubygems_version: 3.0.3
135
- signing_key:
140
+ rubygems_version: 3.1.6
141
+ signing_key:
136
142
  specification_version: 4
137
143
  summary: Summary of HeimdallAuth.
138
144
  test_files: []