pg_rails 7.6.26 → 7.6.28

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: 4b2c5672f192482e718fb6f12e66e7cfcd376e916c7663f13931aa526d931f42
4
- data.tar.gz: cb427f6f6dd542648c697f53b3ddc688f8506919a809bfff3e32c6119612b1a4
3
+ metadata.gz: 774db48c26f0aeb3fd091956f27d32ccde51494853c6ecd82c61ccdd90dfe5a1
4
+ data.tar.gz: 938d4df455ebfc0e61fe200fd08139914b9da512307d10d0f533741a2a2591d8
5
5
  SHA512:
6
- metadata.gz: e98643fa17d81bcdfa0993cd66dbf532d36a6e1935a0144f88e67f2b54dad6e0ec81795fb9a5be9c35c42f6737e1ff8a51ed77f871104f691e711d8a16a8ffb5
7
- data.tar.gz: df1e9eae5424d3ea481be959d24f33b09a5433ce0660f2bdc55ddda5595926ae753c7489c6ac90cc0956219b0909b0d6dd82cb784b2538d00f80820eb654d7cf
6
+ metadata.gz: 41c6353df109a853aee9f8230efabd2f51383eff814b8631bbb60b501576a0aab5d5d39cda27505506e26a8e44672b00ac1957f4131107eb77f400b06de9ab8e
7
+ data.tar.gz: c8cb6d6d87be289911ff9db57849153db8cb3438088ca8adc2408f38e6aca75d687a5b8334b593d90ba16fb8458fe5026d6a770734b11df03febf65ca2b33e3a
@@ -23,6 +23,11 @@ nav[aria-label=breadcrumb] a {
23
23
  }
24
24
 
25
25
  // FORMS
26
+ // Form floating
27
+ .form-floating > .form-control ~ label::after {
28
+ // Para que cuando es un invalid field no choque el background de la label
29
+ background-color: transparent!important;
30
+ }
26
31
 
27
32
  // Radio buttons
28
33
  .radio_buttons legend {
@@ -1,3 +1,4 @@
1
+ # :nocov:
1
2
  module PgEngine
2
3
  class HealthController < ApplicationController
3
4
  rescue_from(Exception) do |error|
@@ -9,6 +10,9 @@ module PgEngine
9
10
  check_redis
10
11
  check_postgres
11
12
  check_websocket
13
+ PgEngine.config.health_ssl_urls.each do |url|
14
+ check_ssl(url)
15
+ end
12
16
  render_up
13
17
  end
14
18
 
@@ -55,6 +59,43 @@ module PgEngine
55
59
  end
56
60
  # rubocop:enable Metrics/MethodLength
57
61
 
62
+ def check_ssl(url)
63
+ uri = URI.parse(url)
64
+ http_session = Net::HTTP.new(uri.host, uri.port)
65
+
66
+ # Use SSL/TLS
67
+ http_session.use_ssl = true
68
+
69
+ # Create a request
70
+ request = Net::HTTP::Get.new(uri.request_uri)
71
+
72
+ begin
73
+ # Start the HTTP session
74
+ http_session.start do |http|
75
+ http.request(request)
76
+
77
+ # Check the response code
78
+
79
+ # Get the SSL certificate
80
+ cert = http.peer_cert
81
+
82
+ raise PgEngine::Error, "#{url}: No SSL certificate found." unless cert
83
+ # puts "Certificate Subject: #{cert.subject}"
84
+ # puts "Certificate Issuer: #{cert.issuer}"
85
+ # puts "Certificate Valid From: #{cert.not_before}"
86
+ # puts "Certificate Valid Until: #{cert.not_after}"
87
+
88
+ if cert.not_after < 7.days.from_now
89
+ raise PgEngine::Error, "#{url}: The SSL certificate is expired (or about to expire)."
90
+ end
91
+ end
92
+ rescue OpenSSL::SSL::SSLError => e
93
+ raise PgEngine::Error, "#{url}: SSL Error: #{e.message}"
94
+ rescue StandardError => e
95
+ raise PgEngine::Error, "#{url}: An error occurred: #{e.message}"
96
+ end
97
+ end
98
+
58
99
  def render_up
59
100
  render html: html_status(color: '#005500')
60
101
  end
@@ -68,3 +109,4 @@ module PgEngine
68
109
  end
69
110
  end
70
111
  end
112
+ # :nocov:
@@ -123,6 +123,10 @@ class User < ApplicationRecord
123
123
  end
124
124
 
125
125
  def to_s
126
+ nombre_completo_o_email
127
+ end
128
+
129
+ def nombre_completo_o_email
126
130
  nombre_completo.strip.presence || email
127
131
  end
128
132
 
@@ -9,13 +9,6 @@
9
9
  .fs-1
10
10
  = @account
11
11
 
12
- / h6
13
- |> Administrado por:
14
- = @account.owner.nombre_completo
15
- |< (
16
- = @account.owner.email
17
- | )
18
-
19
12
  - if @user_account.membership_status.ms_disabled?
20
13
  p.text-danger Deshabilitado
21
14
 
@@ -4,13 +4,14 @@
4
4
 
5
5
  module PgEngine
6
6
  class Configuracion
7
- attr_accessor :users_controller, :global_domains, :navigators, :user_profiles
7
+ attr_accessor :users_controller, :global_domains, :navigators, :user_profiles, :health_ssl_urls
8
8
 
9
9
  # attr_accessor :profile_groups
10
10
 
11
11
  def initialize
12
12
  @global_domains = ['app.localhost.com', 'test.host', 'localhost']
13
13
  @navigators = [PgEngine::Navigator.new]
14
+ @health_ssl_urls = []
14
15
  # @profile_groups = [:account]
15
16
  @user_profiles = {
16
17
  account__owner: 0
@@ -37,8 +37,8 @@
37
37
 
38
38
  FactoryBot.define do
39
39
  factory :user, class: 'User' do
40
- nombre { Faker::Name.first_name }
41
- apellido { Faker::Name.last_name }
40
+ nombre { '' }
41
+ apellido { '' }
42
42
  email { Faker::Internet.email }
43
43
  password { "password#{rand(99_999)}" }
44
44
  confirmed_at { Faker::Date.backward }
@@ -6,7 +6,7 @@
6
6
 
7
7
  <%= render FlashContainerComponent.new %>
8
8
 
9
- <%= pg_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
9
+ <%= pg_form_for(resource, as: resource_name, url: session_path(resource_name), wrapper: :floating_labels_form) do |f| %>
10
10
  <div class="form-inputs">
11
11
  <%= f.input :email,
12
12
  required: false,
@@ -16,7 +16,13 @@
16
16
  required: false,
17
17
  input_html: { autocomplete: "current-password" } %>
18
18
  <%#= f.input :remember_me, as: :hidden if devise_mapping.rememberable? %>
19
- <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
19
+ <div class="mb-3">
20
+ <%= f.input_field :remember_me, as: :boolean, class: 'form-check-input' if devise_mapping.rememberable? %>
21
+ <label class="mx-1" for="user_remember_me">Recordarme</label>
22
+ <span data-controller="tooltip" data-bs-title="No volver a solicitar credenciales por un mes en este navegador">
23
+ <i class="bi bi-info-circle"></i>
24
+ </span>
25
+ </div>
20
26
  </div>
21
27
 
22
28
  <div class="form-actions">
@@ -1,22 +1,32 @@
1
- <div class="devise-links">
1
+ <div class="devise-links d-flex flex-column justify-content-center gap-3">
2
2
  <%- if controller_name != 'sessions' %>
3
- <%= link_to t(".sign_in"), new_session_path(resource_name) %>
3
+ <div>
4
+ <%= link_to t(".sign_in"), new_session_path(resource_name) %>
5
+ </div>
4
6
  <% end %>
5
7
 
6
8
  <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
- <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
9
+ <div>
10
+ <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
11
+ </div>
8
12
  <% end %>
9
13
 
10
14
  <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11
- <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
15
+ <div>
16
+ <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
17
+ </div>
12
18
  <% end %>
13
19
 
14
20
  <%- if false # devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
- <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
21
+ <div>
22
+ <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
23
+ </div>
16
24
  <% end %>
17
25
 
18
26
  <%- if false # devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
27
+ <div>
19
28
  <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %>
29
+ </div>
20
30
  <% end %>
21
31
 
22
32
  <%- if devise_mapping.omniauthable? %>
@@ -29,8 +39,4 @@
29
39
  .devise-links {
30
40
  margin-top: 3em;
31
41
  }
32
- .devise-links a {
33
- display: block;
34
- margin-top: 1em;
35
- }
36
- </style>
42
+ </style>
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module PgRails
5
- VERSION = '7.6.26'
5
+ VERSION = '7.6.28'
6
6
  end
7
7
  # :nocov:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.26
4
+ version: 7.6.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-10 00:00:00.000000000 Z
11
+ date: 2025-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails