heimdall_auth 1.1.0 → 1.2.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: 4e3721e30f22989c4876279dc3fcebb5882c2fa362d4f8216262f71f4f34049f
4
- data.tar.gz: 60846d0138bc2d23728fa359a441a181e8d689beb45331ce0348c43436a15cd1
3
+ metadata.gz: 742947664e984d95bc5826204abc96c26772675b25454ec2969381981ebff693
4
+ data.tar.gz: cc454c59ae75aa688d1326c8b86d84123836e8fdeefd6f18426827361f7ec9a4
5
5
  SHA512:
6
- metadata.gz: 5dc68c45755eecb2ada5e51358e1d211c2f40e9ae8751973c0a9d9b39d05c98e4356e12fe86c586a2a645ac0a59385d6b6fac3059b69f123d31ba1947f45d293
7
- data.tar.gz: c211021081fff2c8219fcccd9dcd5ab95c3ab78a72d088692cefed9dee0459a334fbd22645124ea8aecf511a565a5620432255fa9da76a7498b50ef51af6b758
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
+ ```
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module HeimdallAuth
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heimdall_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
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: 2020-04-02 00:00:00.000000000 Z
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.0.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: []