strongmind-auth 1.0.1 → 1.0.3

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: e98b43c5f33e496befb6df72f2aaa559132d7827fc4e5c5c0e38a032a16184c1
4
- data.tar.gz: b7e6517e30acc303c5031aea42ae079459d54735a93c1ea05a756af30a6055dd
3
+ metadata.gz: fa3b415850df2aa96fc700cdd6f9062a2b08bd45013b3cf0eed7daface29b249
4
+ data.tar.gz: f5b2460f7b9647a5ca78a077cb15fdd4ada4deec9283f4b13c25baee8cf4d1a1
5
5
  SHA512:
6
- metadata.gz: 2603d879de7134e7463418009d45667a0d3f39412d7ff27cb370de7af61a5fc964553577fcd76b81047f81ad107e862ea5cfc29227be41c6335574b6e20f8813
7
- data.tar.gz: a5706db7a96ce11092b20f17df3f85a0dc816ce335b91d2dc85d67ad29236976a0719cb2a6fec68c500329d8172ff14420eba1197eba851b6a3bf23b418bfe30
6
+ metadata.gz: a1e37eb6d57253077830cf3d34364708b3ea823272ed095ae54e348e51ecc3c1b868977c1e3e53afc2670cd98f526d8faa835e69c8f2ae25c864bf32239b0ac0
7
+ data.tar.gz: 65f17555dd2cad8787ab9855f424495311a9b289a87732a508f4e2b3d3a5a4384d05a9d6f03cb371a527e9087c55f80ae94f7370fcaaa284d8e4f2146e8ea700
data/README.md CHANGED
@@ -4,15 +4,16 @@ Ruby gem for authentication in a rails app
4
4
 
5
5
  ## Usage
6
6
 
7
- How to use my plugin.
8
-
9
- ## Installation
10
-
11
- 1. `rails new app_name --tailwind`
12
- 1. Add strongmind-auth to gem file and bundle
7
+ 1. `rails new app --css tailwind`
8
+ 1. `cd app`
9
+ 1. `bundle add strongmind-auth`
13
10
  1. `rails g strongmind:install`
14
- 1. Move app root to authenticated root in routes
15
- 1. Add IDENTITY_CLIENT_ID and IDENTITY_CLIENT_SECRET values to .env
16
- 1. `bundle`
11
+ 1. Move app root to authenticated root in routes. Should look like this:
12
+ ```ruby
13
+ authenticated :user do
14
+ root to: 'home#index' # or whatever makes sense for your app
15
+ end
16
+ ```
17
+ 1. Create a new client in identity server and `IDENTITY_CLIENT_ID` and `IDENTITY_CLIENT_SECRET` values to .env file.
17
18
  1. `rails dev:cache`
18
- 1. `bin/dev`
19
+ 1. `bin/dev`
@@ -276,9 +276,11 @@ Devise.setup do |config|
276
276
  # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
277
277
  identity_base_url = ENV['IDENTITY_BASE_URL'] || "https://devlogin.strongmind.com"
278
278
  app_base_url = ENV['APP_BASE_URL'] || "http://localhost:3000"
279
+ scopes = %i[openid profile offline_access]
280
+ scopes = scopes + ENV['IDENTITY_SCOPES'].split(' ').map(&:to_sym) if ENV['IDENTITY_SCOPES'].present?
279
281
  config.omniauth :openid_connect, {
280
282
  name: :strongmind,
281
- scope: %i[openid profile],
283
+ scope: scopes,
282
284
  response_type: :code,
283
285
  issuer: identity_base_url,
284
286
  discovery: true,
@@ -49,7 +49,7 @@ devise_scope :user do
49
49
  end
50
50
 
51
51
  def add_dotenv_file
52
- copy_file ".env", ".env"
52
+ copy_file "env", ".env"
53
53
  end
54
54
  end
55
55
 
@@ -0,0 +1,8 @@
1
+ IDENTITY_CLIENT_ID=
2
+ IDENTITY_CLIENT_SECRET=
3
+
4
+ # Space delimited list of scopes
5
+ IDENTITY_SCOPES=
6
+
7
+ IDENTITY_BASE_URL=https://devlogin.strongmind.com
8
+ APP_BASE_URL=http://localhost:3000
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongmind-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Belding
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-12 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -118,6 +118,7 @@ files:
118
118
  - lib/generators/strongmind/USAGE
119
119
  - lib/generators/strongmind/install_generator.rb
120
120
  - lib/generators/strongmind/templates/add_uid_to_user.rb
121
+ - lib/generators/strongmind/templates/env
121
122
  - lib/generators/strongmind/templates/user.rb
122
123
  - lib/strongmind/auth.rb
123
124
  - lib/strongmind/auth/engine.rb