rls_multi_tenant 0.1.9 → 0.2.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: b45cd6b953bae2321b231e78d3883eba2432803c44e036e4d6845269aef3633b
4
- data.tar.gz: cf4f8900c3577c532fb82638a4064b239dd99611136b282560d06c6ba2e396bf
3
+ metadata.gz: 49b6d40d5e29350f1911f16aa361beaad5b1ad28dfab6da452260cd535ff6dd1
4
+ data.tar.gz: ba39dd57c6690a60b5d8e1ed466d7b42e25b745920ff5016030a405d89360f88
5
5
  SHA512:
6
- metadata.gz: eacdf26741563c4a9d4a25f6db59d55e1ebc8035f6804d4f19695178f9cf9da3bdd49e04f09173b33c4641a2ef3024987091250b4fc0d32a6736720ff56c1feb
7
- data.tar.gz: 82257c569f87e8beff78a914ecfc0948a281835a10306e71ff8238ca71e403b25c32845ed7e710a2ef890eaa68ec9f525f130811c4c1a1bca6e1d4a3948028bd
6
+ metadata.gz: 7f8c83ceedec1aa0dfee0bb9ab01c8123ce6bf58a1b75a5f6b6ea5ec083803ec917d526504c9f5897a274f40bf3eb2dd6ccd856b7f9ecee69b36c0ac2d90642a
7
+ data.tar.gz: 6e673789ff292c0258411c9e46cf3a7a899f862771b760651acdc9c8662540fb9b1674650238a3472ac80275004f910f673ca516099b86eddc26c2151929ed23
@@ -4,4 +4,5 @@ class <%= RlsMultiTenant.tenant_class_name %> < ApplicationRecord
4
4
  include RlsMultiTenant::Concerns::TenantContext
5
5
 
6
6
  validates :name, presence: true
7
+ validates :subdomain, presence: true, uniqueness: true
7
8
  end
@@ -19,7 +19,8 @@ module RlsMultiTenant
19
19
 
20
20
  if superuser_check && superuser_check['rolsuper']
21
21
  raise SecurityError, "Database user '#{username}' has SUPERUSER privileges. " \
22
- "In order to use RLS Multi-tenant, you must use a non-privileged user without SUPERUSER rights."
22
+ "In order to use RLS Multi-tenant, you must use a non-privileged user without SUPERUSER rights." \
23
+ "Did you remember to edit database.yml in order to use the POSTGRES_APP_USER and POSTGRES_APP_PASSWORD?"
23
24
  end
24
25
 
25
26
  # Log the security check result
@@ -41,7 +42,8 @@ module RlsMultiTenant
41
42
  raise ConfigurationError, "#{RlsMultiTenant.app_user_env_var} environment variable must be set"
42
43
  elsif ["postgres", "root"].include?(app_user)
43
44
  raise SecurityError, "Cannot use privileged PostgreSQL user '#{app_user}'. " \
44
- "In order to use RLS Multi-tenant, you must use a non-privileged user without SUPERUSER rights."
45
+ "In order to use RLS Multi-tenant, you must use a non-privileged user without SUPERUSER rights." \
46
+ "Did you remember to edit database.yml in order to use the POSTGRES_APP_USER and POSTGRES_APP_PASSWORD?"
45
47
  end
46
48
  end
47
49
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RlsMultiTenant
4
- VERSION = "0.1.9"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rls_multi_tenant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coding Ways