heimdall_auth 1.9.0 → 1.11.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 466c0b795400dea15ed3c781399d101fd3b9cb062a491668e0740c09efdcd160
|
|
4
|
+
data.tar.gz: 18372a72593c92ecf587e00e5f5fd3a43528ef7d0bb10d94530b9b4416dd7564
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5adca37fbe181e0aa9cd0e7d70104febd0ed59274a69decd0287e2bbcd11aec51f8d97d9455a95d81dec87ce6684f1ec81e70df34488dde67b685449adecf88e
|
|
7
|
+
data.tar.gz: 885b2c0663f823fc9f0619359159f27f22cfbdd64f02eda471bf9ba55b418c53be250542f379669238a19f0acff060e7bc5cd15f5129e720e915ab693003443e
|
data/README.md
CHANGED
|
@@ -34,6 +34,7 @@ Options:
|
|
|
34
34
|
- PATH - where to mount the engine
|
|
35
35
|
- ACTION & RESOURCE - like any action and resource in cancancan
|
|
36
36
|
- :accessible_via_token -> Defines paths that are available via a particular token. e.g. for Watchdog services like Datadog
|
|
37
|
+
- URL needs then to have the token as `?token=secretpassword` in the query params. Like: `https://webhook.vesputi-abc.de/sidekiq/stats?token=secretpassword`
|
|
37
38
|
|
|
38
39
|
## Installation and Usage
|
|
39
40
|
|
|
@@ -114,3 +115,26 @@ RSpec.describe "/foobar", type: :request do
|
|
|
114
115
|
before { allow_any_instance_of(ApplicationController).to receive(:current_user) { HeimdallAuth::User.new(is_editor: true) } }
|
|
115
116
|
end
|
|
116
117
|
```
|
|
118
|
+
|
|
119
|
+
# Usage with RSpec
|
|
120
|
+
## Simulate an Admin user
|
|
121
|
+
|
|
122
|
+
See the example:
|
|
123
|
+
```ruby
|
|
124
|
+
require 'rails_helper'
|
|
125
|
+
|
|
126
|
+
RSpec.describe "/cards", type: :request do
|
|
127
|
+
|
|
128
|
+
let(:admin_user) {
|
|
129
|
+
HeimdallAuth::User.new(email: "foo@bar.com", is_admin: true)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
describe "GET /index" do
|
|
133
|
+
before(:each) do
|
|
134
|
+
allow_any_instance_of( HeimdallAuth::ControllerAdditions ).to receive(:current_user).and_return(admin_user)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
it "renders a successful response" do
|
|
138
|
+
Card.create! valid_attributes
|
|
139
|
+
get cards_url
|
|
140
|
+
```
|
|
@@ -14,7 +14,7 @@ class HeimdallAuth::SessionsController < ApplicationController
|
|
|
14
14
|
|
|
15
15
|
def create
|
|
16
16
|
auth = request.env["omniauth.auth"]
|
|
17
|
-
session[:access_token] = auth
|
|
17
|
+
session[:access_token] = auth&.credentials&.token
|
|
18
18
|
redirect_to( session[:last_url] || request.base_url, allow_other_host: true)
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ module HeimdallAuth
|
|
|
29
29
|
|
|
30
30
|
def current_environment
|
|
31
31
|
begin
|
|
32
|
-
@current_environment ||= current_user.
|
|
32
|
+
@current_environment ||= current_user.app_environment || params[:environment]
|
|
33
33
|
rescue NoMethodError, Exception => e
|
|
34
34
|
nil
|
|
35
35
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: heimdall_auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.11.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- René Meye
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -19,7 +18,7 @@ dependencies:
|
|
|
19
18
|
version: '5.0'
|
|
20
19
|
- - "<"
|
|
21
20
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
21
|
+
version: '9.0'
|
|
23
22
|
type: :runtime
|
|
24
23
|
prerelease: false
|
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +28,7 @@ dependencies:
|
|
|
29
28
|
version: '5.0'
|
|
30
29
|
- - "<"
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
31
|
+
version: '9.0'
|
|
33
32
|
- !ruby/object:Gem::Dependency
|
|
34
33
|
name: omniauth
|
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -124,7 +123,6 @@ homepage: https://vesputi.com
|
|
|
124
123
|
licenses:
|
|
125
124
|
- MIT
|
|
126
125
|
metadata: {}
|
|
127
|
-
post_install_message:
|
|
128
126
|
rdoc_options: []
|
|
129
127
|
require_paths:
|
|
130
128
|
- lib
|
|
@@ -139,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
139
137
|
- !ruby/object:Gem::Version
|
|
140
138
|
version: '0'
|
|
141
139
|
requirements: []
|
|
142
|
-
rubygems_version: 3.
|
|
143
|
-
signing_key:
|
|
140
|
+
rubygems_version: 3.6.9
|
|
144
141
|
specification_version: 4
|
|
145
142
|
summary: Summary of HeimdallAuth.
|
|
146
143
|
test_files: []
|