rails_keycloak_authorization 0.0.5 → 0.0.7

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: 249d3e51d6008d55fa812918a6733d68bbd3d146cbe3692ccbf68c402a7693ea
4
- data.tar.gz: d7d6e67c74a6e5eca1ae6f3331edd93875d138e3f859fc53c05d1e79178985ac
3
+ metadata.gz: 9ebcfc258d6383cc4c27d77e5d8cfad7e9a309035b028b5fcfd97b49664f7fc7
4
+ data.tar.gz: 0b815c873a10ee095b7b21dc1f55068a29fa51ea5119de562f2755cff15b14ab
5
5
  SHA512:
6
- metadata.gz: de462bceeb0c91d60a1fd0c92c09f0dff0e62ee83e4d37c5f1e4626bbf61ab2ff1ac9e6edd3b3202811f830cdca911ed59ec0101080010f5e9a538ec67a0eb57
7
- data.tar.gz: a93daccac290208e450be0177644ea73f9e1852a4e6024c597fcbfbad9ed4ee0fc107095cfd5df27f6a76747bd9ac5af90a68e49e7000bf305069f53145fa673
6
+ metadata.gz: 3d456a610fcfa766e8168435ddd98fc58a45a65aaf46c5ee76dfe74ff60e7b8c67a4defca96a81069befd4b0ae86cb3679ba05b5ddd0c06845b42de49025bbc3
7
+ data.tar.gz: 4c890690abe07bc91dc4427a18b773a63cbf4da6453a10f08498b08825fddc09b0b3f4ae00adb25d692f767945ad140e93b027d8e78dfbcb07f066f584c770ff
@@ -4,9 +4,10 @@
4
4
  <title>Rails Keycloak Authorization</title>
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
- <script src="https://unpkg.com/htmx.org@2.0.0/dist/htmx.js" integrity="sha384-Xh+GLLi0SMFPwtHQjT72aPG19QvKB8grnyRbYBNIdHWc2NkCrz65jlU7YrzO6qRp" crossorigin="anonymous"></script>
7
+ <%= javascript_importmap_tags "application", importmap: RailsKeycloakAuthorization.importmap %>
8
8
  <script src="https://cdn.tailwindcss.com"></script>
9
9
  <%= stylesheet_link_tag "rails_keycloak_authorization/application", media: "all" %>
10
+ <script type="module"> import "htmx.org" </script>
10
11
  </head>
11
12
  <body hx-headers='{"X-CSRF-Token": "<%= form_authenticity_token %>"}'>
12
13
  <%= yield %>
@@ -0,0 +1 @@
1
+ pin "htmx.org", to: "https://unpkg.com/htmx.org@2.0.0/dist/htmx.js", preload: true
@@ -1,6 +1,5 @@
1
1
  module RailsKeycloakAuthorization
2
2
  class Engine < ::Rails::Engine
3
- require 'keycloak-admin'
4
3
  isolate_namespace RailsKeycloakAuthorization
5
4
  initializer "rails_keycloak_authorization.middleware" do |app|
6
5
  app.middleware.use RailsKeycloakAuthorization::Middleware
@@ -8,5 +7,15 @@ module RailsKeycloakAuthorization
8
7
  initializer "rails_keycloak_authorization.assets.precompile" do |app|
9
8
  app.config.assets.precompile += %w( rails_keycloak_authorization/application.css )
10
9
  end
10
+
11
+ initializer "rails_keycloak_authorization.importmap", before: "importmap" do |app|
12
+ RailsKeycloakAuthorization.importmap.draw root.join("config/importmap.rb")
13
+ RailsKeycloakAuthorization.importmap.cache_sweeper watches: root.join("app/javascript")
14
+
15
+ ActiveSupport.on_load(:action_controller_base) do
16
+ before_action { RailsKeycloakAuthorization.importmap.cache_sweeper.execute_if_updated }
17
+ end
18
+ end
19
+
11
20
  end
12
21
  end
@@ -1,3 +1,3 @@
1
1
  module RailsKeycloakAuthorization
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -1,5 +1,8 @@
1
1
  require "rails_keycloak_authorization/version"
2
2
  require "rails_keycloak_authorization/engine"
3
+ require 'keycloak-admin'
4
+ require "importmap-rails"
5
+
3
6
 
4
7
  module RailsKeycloakAuthorization
5
8
  mattr_accessor :keycloak_server_url
@@ -10,6 +13,8 @@ module RailsKeycloakAuthorization
10
13
  mattr_accessor :keycloak_auth_client_id
11
14
  mattr_accessor :keycloak_auth_client_realm_name
12
15
  mattr_accessor :match_patterns, default: []
16
+ mattr_accessor :importmap, default: Importmap::Map.new
17
+
13
18
 
14
19
  class Middleware
15
20
  def initialize(app)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_keycloak_authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohammed O. Tillawy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-16 00:00:00.000000000 Z
11
+ date: 2024-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.1'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 7.1.3.4
19
+ version: '8'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '7.1'
26
+ version: '8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: importmap-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
30
38
  - - ">="
31
39
  - !ruby/object:Gem::Version
32
- version: 7.1.3.4
40
+ version: '0'
33
41
  - !ruby/object:Gem::Dependency
34
42
  name: keycloak-admin
35
43
  requirement: !ruby/object:Gem::Requirement
@@ -93,6 +101,7 @@ files:
93
101
  - app/views/rails_keycloak_authorization/routes/show.html.erb
94
102
  - app/views/rails_keycloak_authorization/scopes/index.html.erb
95
103
  - app/views/rails_keycloak_authorization/scopes/show.html.erb
104
+ - config/importmap.rb
96
105
  - config/routes.rb
97
106
  - lib/rails_keycloak_authorization.rb
98
107
  - lib/rails_keycloak_authorization/engine.rb
@@ -121,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
130
  - !ruby/object:Gem::Version
122
131
  version: '0'
123
132
  requirements: []
124
- rubygems_version: 3.5.16
133
+ rubygems_version: 3.5.22
125
134
  signing_key:
126
135
  specification_version: 4
127
136
  summary: RailsKeycloakAuthorization, Rack Based, Policy Enforcement Point (PEP) implementation