ssomg 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +27 -1
- data/lib/ssomg/engine.rb +0 -4
- data/lib/ssomg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c73a7366e9f5dae3c70fb5a95ba525d41850eea
|
4
|
+
data.tar.gz: a631f6c89afe712bd099ad99dc89bb5ad6d50601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c98f9eb4cd0229a0d4ea1fc1f7bbd2a5ce5313d8a6b84c4b127210a0f5c1b8599876477c723004ed649f7e1ce8375f4b0278174a97fae2f334d557b6ae27d1a0
|
7
|
+
data.tar.gz: 9162d3248aa9b11aa94aa39a63f998920b234049627dd21be81a8b0febada5e14fcb5c3d4bf2d15b2e5463fd8731e028140b817e494e7ed13452fec77b72c983
|
data/README.md
CHANGED
@@ -92,7 +92,7 @@ If a user JWT is set, @user will be set like this:
|
|
92
92
|
### Environment ###
|
93
93
|
|
94
94
|
When you register the app and the users in the main SSOMG admin, you'll be issued with an app id and the public key used to verify tokens.
|
95
|
-
You'll need to add the public key to your project, and then add the following attributes to your environment
|
95
|
+
You'll need to add the public key to your project, and then add the following attributes to your environment variables to ensure it works correctly:
|
96
96
|
|
97
97
|
```
|
98
98
|
PUB_KEY_PATH=./keys/sso
|
@@ -100,6 +100,32 @@ APP_ID=xxxxxxxxxxxxxxxxxxxxxxxx
|
|
100
100
|
SSO_HOST=https://auth.mysite.com
|
101
101
|
```
|
102
102
|
|
103
|
+
You can set these with docker, or here's a boilerplate:
|
104
|
+
`/config/application.rb`
|
105
|
+
```
|
106
|
+
module RoarAuthTesterRails
|
107
|
+
class Application < Rails::Application
|
108
|
+
.
|
109
|
+
.
|
110
|
+
.
|
111
|
+
|
112
|
+
env_file = File.join(Rails.root, 'config', 'local_env.yml')
|
113
|
+
YAML.load(File.open(env_file)).each do |key, value|
|
114
|
+
ENV[key.to_s] = value
|
115
|
+
end if File.exists?(env_file)
|
116
|
+
|
117
|
+
Ssomg.configure
|
118
|
+
end
|
119
|
+
end
|
120
|
+
```
|
121
|
+
|
122
|
+
`/config/local_env.rb`
|
123
|
+
```
|
124
|
+
APP_ID: xxxxxxxxxxxxxxxxxxxxxx
|
125
|
+
PUB_KEY_PATH: ./config/public_key
|
126
|
+
SSO_HOST: http://auth.myhost.com
|
127
|
+
```
|
128
|
+
|
103
129
|
In production, the app will automatically use secure and http-only cookies.
|
104
130
|
|
105
131
|
## Gotchas
|
data/lib/ssomg/engine.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Ssomg
|
2
|
-
puts "TEst"
|
3
2
|
@@PUB_KEY = ""
|
4
3
|
class Engine < Rails::Engine
|
5
4
|
|
@@ -9,9 +8,6 @@ module Ssomg
|
|
9
8
|
end
|
10
9
|
|
11
10
|
def self.configure
|
12
|
-
puts "TEst 2"
|
13
|
-
puts ENV["PUB_KEY_PATH"]
|
14
|
-
puts File.read( ENV["PUB_KEY_PATH"] )
|
15
11
|
@@PUB_KEY = OpenSSL::PKey::RSA.new( File.read( ENV["PUB_KEY_PATH"] ) )
|
16
12
|
end
|
17
13
|
|
data/lib/ssomg/version.rb
CHANGED