pg-aws_rds_iam 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d53df3b169ccf67632243b2988b27c9877926d2dc8633d03b8a86c1bd8fd0a2
4
- data.tar.gz: 26a706ea26b9980d71d9f9dd3bad216b6b7b0900d7b3fb6ce5ac808b63291e0b
3
+ metadata.gz: 7894b340911ed1dd4bf4ade1a3a93830f34a353107036f0bf974b098b332ad04
4
+ data.tar.gz: 7387170d637e6f5a57cb4e39146c03496595d7fd2bc785eae4dacd1dc7978a90
5
5
  SHA512:
6
- metadata.gz: 52580d0b4cde8bb0137b3c9d8f8a051407b012c84cb2eb23c808d1a87b5e1403e829a13a21e8b0023d7cccc4bc8251ed1d8641f4806a92d10543cb38757f6fe3
7
- data.tar.gz: f017a695a8a3e2afa79dfe0eace2cb93f071beb4dfa92b29d8fc731b75e861b2036062990f4948d08c11b61ca2429a1f23f546f5cbeaaeae290814b3ae797602
6
+ metadata.gz: 7ed4c84823ac809c74ac63358df8a31aebaa8ba09572cd8a8343a47c41768f5bb226b6ce99fb8ec052e90c37575e296538680ba1a3ab03bb4d100120fc0e044d
7
+ data.tar.gz: 1575d6f6e008a311edd01fb62cd9d3bf4615a14b41d0ed2f5163812999661180da5010252cf8013c82abcfc46c4d680d6dc995a21e8c02d3164949f929887b14
@@ -17,7 +17,7 @@ jobs:
17
17
  run: apk add git
18
18
 
19
19
  - name: Check out source code
20
- uses: actions/checkout@v2
20
+ uses: actions/checkout@v3
21
21
 
22
22
  - name: Install Bundler
23
23
  run: bin/install-bundler
@@ -40,7 +40,7 @@ jobs:
40
40
  run: test -n "${{ secrets.AVAILABLE }}"
41
41
 
42
42
  - name: Check out source code
43
- uses: actions/checkout@v2
43
+ uses: actions/checkout@v3
44
44
 
45
45
  - name: Generate version matrix
46
46
  id: version-matrix
@@ -69,7 +69,7 @@ jobs:
69
69
  run: apk add build-base git postgresql-dev tar
70
70
 
71
71
  - name: Check out source code
72
- uses: actions/checkout@v2
72
+ uses: actions/checkout@v3
73
73
 
74
74
  - name: Install Bundler
75
75
  run: bin/install-bundler
@@ -89,7 +89,7 @@ jobs:
89
89
  "${postgresql_version}"
90
90
 
91
91
  - name: Cache gems
92
- uses: actions/cache@v2
92
+ uses: actions/cache@v3
93
93
  with:
94
94
  key: ${{ steps.cache-key.outputs.cache-key }}-gems-${{ hashFiles('Gemfile.lock') }}
95
95
  path: vendor/bundle
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ require:
3
3
  - rubocop-rake
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.6
6
+ TargetRubyVersion: 2.7
7
7
  NewCops: enable
8
8
  Exclude:
9
9
  - bin/bundle
@@ -26,6 +26,9 @@ Minitest/MultipleAssertions:
26
26
  Naming/ClassAndModuleCamelCase:
27
27
  Enabled: false
28
28
 
29
+ Naming/VariableNumber:
30
+ EnforcedStyle: snake_case
31
+
29
32
  Style/Documentation:
30
33
  Exclude:
31
34
  - lib/pg/aws_rds_iam/auth_token_injector.rb
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.0.2
1
+ ruby-3.1.2
data/.yardopts CHANGED
@@ -1,4 +1,5 @@
1
1
  --markup markdown
2
+ --markup-provider commonmarker
2
3
  --no-private
3
4
  -
4
5
  *.md
data/CHANGELOG.md CHANGED
@@ -8,6 +8,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
 
9
9
  No notable changes.
10
10
 
11
+ ## [0.4.0] - 2022-06-22
12
+
13
+ ### Changed
14
+ * Test against Ruby 3.1 ([#305](https://github.com/haines/pg-aws_rds_iam/pull/305))
15
+ * Require Ruby ≥ 2.6 and Active Record ≥ 6.0 ([#360](https://github.com/haines/pg-aws_rds_iam/pull/360))
16
+
17
+ ### Fixed
18
+ * Compatibility with `pg` ≥ 1.4 ([#356](https://github.com/haines/pg-aws_rds_iam/pull/356))
19
+
20
+ ## [0.3.2] - 2021-11-15
21
+
22
+ ### Changed
23
+ * Require MFA to publish gem ([#278](https://github.com/haines/pg-aws_rds_iam/pull/278))
24
+
25
+ ## [0.3.1] - 2021-11-10
26
+
27
+ ### Fixed
28
+ * Make code snippets in README valid Ruby to fix syntax highlighting ([#274](https://github.com/haines/pg-aws_rds_iam/pull/274))
29
+
11
30
  ## [0.3.0] - 2021-11-10
12
31
 
13
32
  ### Changed
@@ -33,7 +52,10 @@ No notable changes.
33
52
  * A plugin for the [`pg` gem](https://rubygems.org/gems/pg) that adds support for [IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) when connecting to PostgreSQL databases hosted in Amazon RDS. ([#1](https://github.com/haines/pg-aws_rds_iam/pull/1))
34
53
  * ActiveRecord support. ([#3](https://github.com/haines/pg-aws_rds_iam/pull/3))
35
54
 
36
- [Unreleased]: https://github.com/haines/pg-aws_rds_iam/compare/v0.3.0...HEAD
55
+ [Unreleased]: https://github.com/haines/pg-aws_rds_iam/compare/v0.4.0...HEAD
56
+ [0.4.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.3.2...v0.4.0
57
+ [0.3.2]: https://github.com/haines/pg-aws_rds_iam/compare/v0.3.1...v0.3.2
58
+ [0.3.1]: https://github.com/haines/pg-aws_rds_iam/compare/v0.3.0...v0.3.1
37
59
  [0.3.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.2.0...v0.3.0
38
60
  [0.2.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.1.1...v0.2.0
39
61
  [0.1.1]: https://github.com/haines/pg-aws_rds_iam/compare/v0.1.0...v0.1.1
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ gemspec
5
5
 
6
6
  gem "aws-sdk-ec2"
7
7
  gem "bundler"
8
+ gem "commonmarker"
8
9
  gem "minitest"
9
10
  gem "minitest-reporters"
10
11
  gem "pry"
@@ -16,5 +17,5 @@ gem "timecop"
16
17
  gem "yard"
17
18
 
18
19
  ["activerecord", "pg"].each do |gem_name|
19
- gem gem_name, *ENV["#{gem_name.upcase}_VERSION"]&.yield_self { |gem_version| "~> #{gem_version}.0" }
20
+ gem gem_name, *ENV["#{gem_name.upcase}_VERSION"]&.then { |gem_version| "~> #{gem_version}.0" }
20
21
  end
data/Gemfile.lock CHANGED
@@ -1,87 +1,88 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg-aws_rds_iam (0.3.0)
4
+ pg-aws_rds_iam (0.4.0)
5
5
  aws-sdk-rds (~> 1.0)
6
6
  pg (>= 0.18, < 2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.1.3)
12
- activesupport (= 6.1.3)
13
- activerecord (6.1.3)
14
- activemodel (= 6.1.3)
15
- activesupport (= 6.1.3)
16
- activesupport (6.1.3)
11
+ activemodel (7.0.3)
12
+ activesupport (= 7.0.3)
13
+ activerecord (7.0.3)
14
+ activemodel (= 7.0.3)
15
+ activesupport (= 7.0.3)
16
+ activesupport (7.0.3)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
- zeitwerk (~> 2.3)
22
21
  ansi (1.5.0)
23
22
  ast (2.4.2)
24
23
  aws-eventstream (1.2.0)
25
- aws-partitions (1.525.0)
26
- aws-sdk-core (3.122.0)
24
+ aws-partitions (1.600.0)
25
+ aws-sdk-core (3.131.2)
27
26
  aws-eventstream (~> 1, >= 1.0.2)
28
27
  aws-partitions (~> 1, >= 1.525.0)
29
28
  aws-sigv4 (~> 1.1)
30
- jmespath (~> 1.0)
31
- aws-sdk-ec2 (1.277.0)
32
- aws-sdk-core (~> 3, >= 3.122.0)
29
+ jmespath (~> 1, >= 1.6.1)
30
+ aws-sdk-ec2 (1.319.0)
31
+ aws-sdk-core (~> 3, >= 3.127.0)
33
32
  aws-sigv4 (~> 1.1)
34
- aws-sdk-rds (1.130.0)
35
- aws-sdk-core (~> 3, >= 3.122.0)
33
+ aws-sdk-rds (1.146.0)
34
+ aws-sdk-core (~> 3, >= 3.127.0)
36
35
  aws-sigv4 (~> 1.1)
37
- aws-sigv4 (1.4.0)
36
+ aws-sigv4 (1.5.0)
38
37
  aws-eventstream (~> 1, >= 1.0.2)
39
38
  builder (3.2.4)
40
39
  coderay (1.1.3)
41
- concurrent-ruby (1.1.8)
42
- i18n (1.8.9)
40
+ commonmarker (0.23.5)
41
+ concurrent-ruby (1.1.10)
42
+ i18n (1.10.0)
43
43
  concurrent-ruby (~> 1.0)
44
- jmespath (1.4.0)
44
+ jmespath (1.6.1)
45
45
  method_source (1.0.0)
46
- minitest (5.14.4)
47
- minitest-reporters (1.4.3)
46
+ minitest (5.16.1)
47
+ minitest-reporters (1.5.0)
48
48
  ansi
49
49
  builder
50
50
  minitest (>= 5.0)
51
51
  ruby-progressbar
52
- parallel (1.21.0)
53
- parser (3.0.2.0)
52
+ parallel (1.22.1)
53
+ parser (3.1.2.0)
54
54
  ast (~> 2.4.1)
55
- pg (1.2.3)
55
+ pg (1.4.0)
56
56
  pry (0.14.1)
57
57
  coderay (~> 1.1)
58
58
  method_source (~> 1.0)
59
- rainbow (3.0.0)
59
+ rainbow (3.1.1)
60
60
  rake (13.0.6)
61
- regexp_parser (2.1.1)
61
+ regexp_parser (2.5.0)
62
62
  rexml (3.2.5)
63
- rubocop (1.22.3)
63
+ rubocop (1.30.1)
64
64
  parallel (~> 1.10)
65
- parser (>= 3.0.0.0)
65
+ parser (>= 3.1.0.0)
66
66
  rainbow (>= 2.2.2, < 4.0)
67
67
  regexp_parser (>= 1.8, < 3.0)
68
- rexml
69
- rubocop-ast (>= 1.12.0, < 2.0)
68
+ rexml (>= 3.2.5, < 4.0)
69
+ rubocop-ast (>= 1.18.0, < 2.0)
70
70
  ruby-progressbar (~> 1.7)
71
71
  unicode-display_width (>= 1.4.0, < 3.0)
72
- rubocop-ast (1.12.0)
73
- parser (>= 3.0.1.1)
74
- rubocop-minitest (0.15.2)
72
+ rubocop-ast (1.18.0)
73
+ parser (>= 3.1.1.0)
74
+ rubocop-minitest (0.20.1)
75
75
  rubocop (>= 0.90, < 2.0)
76
76
  rubocop-rake (0.6.0)
77
77
  rubocop (~> 1.0)
78
78
  ruby-progressbar (1.11.0)
79
- timecop (0.9.4)
79
+ timecop (0.9.5)
80
80
  tzinfo (2.0.4)
81
81
  concurrent-ruby (~> 1.0)
82
82
  unicode-display_width (2.1.0)
83
- yard (0.9.26)
84
- zeitwerk (2.4.2)
83
+ webrick (1.7.0)
84
+ yard (0.9.28)
85
+ webrick (~> 1.7.0)
85
86
 
86
87
  PLATFORMS
87
88
  ruby
@@ -90,6 +91,7 @@ DEPENDENCIES
90
91
  activerecord
91
92
  aws-sdk-ec2
92
93
  bundler
94
+ commonmarker
93
95
  minitest
94
96
  minitest-reporters
95
97
  pg
@@ -103,4 +105,4 @@ DEPENDENCIES
103
105
  yard
104
106
 
105
107
  BUNDLED WITH
106
- 2.2.21
108
+ 2.3.16
data/README.md CHANGED
@@ -103,7 +103,7 @@ If the default authentication token generator doesn't meet your needs, you can r
103
103
 
104
104
  ```ruby
105
105
  PG::AWS_RDS_IAM.auth_token_generators.add :custom do
106
- PG::AWS_RDS_IAM::AuthTokenGenerator.new(credentials: ..., region: ...)
106
+ PG::AWS_RDS_IAM::AuthTokenGenerator.new(credentials: "...", region: "...")
107
107
  end
108
108
  ```
109
109
 
data/bin/version-matrix CHANGED
@@ -9,15 +9,15 @@ def minor_versions(name, requirement)
9
9
  end
10
10
 
11
11
  ruby_activerecord_requirements = {
12
- "2.6" => ">= 5.2",
13
- "2.7" => ">= 5.2",
14
- "3.0" => ">= 6.0"
12
+ "2.7" => ">= 6.0",
13
+ "3.0" => ">= 6.0",
14
+ "3.1" => ">= 6.0"
15
15
  }
16
16
 
17
17
  activerecord_pg_requirements = {
18
- "5.2" => [">= 0.18", "< 2.0"],
19
18
  "6.0" => [">= 0.18", "< 2.0"],
20
- "6.1" => "~> 1.1"
19
+ "6.1" => "~> 1.1",
20
+ "7.0" => "~> 1.1"
21
21
  }
22
22
 
23
23
  versions = ruby_activerecord_requirements.flat_map do |ruby_version, activerecord_requirement|
@@ -4,7 +4,25 @@ module PG
4
4
  module AWS_RDS_IAM
5
5
  module Connection
6
6
  def conndefaults
7
- super + [{
7
+ super + [conndefault_aws_rds_iam_auth_token_generator]
8
+ end
9
+
10
+ def conninfo_parse(connection_string)
11
+ connection_info = ConnectionInfo.new(connection_string)
12
+
13
+ super(connection_info.to_s).tap do |result|
14
+ result << conndefault_aws_rds_iam_auth_token_generator.merge(val: connection_info.auth_token_generator_name) if connection_info.auth_token_generator_name
15
+ end
16
+ end
17
+
18
+ def parse_connect_args(*args)
19
+ AuthTokenInjector.call(super)
20
+ end
21
+
22
+ private
23
+
24
+ def conndefault_aws_rds_iam_auth_token_generator
25
+ {
8
26
  keyword: "aws_rds_iam_auth_token_generator",
9
27
  envvar: nil,
10
28
  compiled: nil,
@@ -12,11 +30,7 @@ module PG
12
30
  label: "AWS-RDS-IAM-auth-token-generator",
13
31
  dispchar: "",
14
32
  dispsize: 64
15
- }]
16
- end
17
-
18
- def parse_connect_args(*)
19
- AuthTokenInjector.call(super)
33
+ }
20
34
  end
21
35
  end
22
36
 
@@ -12,7 +12,7 @@ module PG
12
12
 
13
13
  def initialize(connection_string)
14
14
  @uri = ::URI.parse(connection_string)
15
- @query = ::URI.decode_www_form(@uri.query).to_h
15
+ @query = @uri.query ? ::URI.decode_www_form(@uri.query).to_h : {}
16
16
  @auth_token_generator_name = @query.delete("aws_rds_iam_auth_token_generator")
17
17
  end
18
18
 
@@ -3,6 +3,6 @@
3
3
  module PG
4
4
  module AWS_RDS_IAM
5
5
  # The current version of the gem.
6
- VERSION = "0.3.0"
6
+ VERSION = "0.4.0"
7
7
  end
8
8
  end
@@ -21,11 +21,13 @@ Gem::Specification.new do |spec|
21
21
  spec.metadata["homepage_uri"] = spec.homepage
22
22
  spec.metadata["source_code_uri"] = spec.homepage
23
23
 
24
+ spec.metadata["rubygems_mfa_required"] = "true"
25
+
24
26
  spec.files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0").reject { |path| path.start_with?("test/") } }
25
27
 
26
28
  spec.require_paths = ["lib"]
27
29
 
28
- spec.required_ruby_version = ">= 2.6"
30
+ spec.required_ruby_version = ">= 2.7"
29
31
 
30
32
  spec.add_dependency "aws-sdk-rds", "~> 1.0"
31
33
  spec.add_dependency "pg", ">= 0.18", "< 2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg-aws_rds_iam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Haines
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-10 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-rds
@@ -90,9 +90,10 @@ licenses:
90
90
  metadata:
91
91
  bug_tracker_uri: https://github.com/haines/pg-aws_rds_iam/issues
92
92
  changelog_uri: https://github.com/haines/pg-aws_rds_iam/blob/main/CHANGELOG.md
93
- documentation_uri: https://rubydoc.info/gems/pg-aws_rds_iam/0.3.0
93
+ documentation_uri: https://rubydoc.info/gems/pg-aws_rds_iam/0.4.0
94
94
  homepage_uri: https://github.com/haines/pg-aws_rds_iam
95
95
  source_code_uri: https://github.com/haines/pg-aws_rds_iam
96
+ rubygems_mfa_required: 'true'
96
97
  post_install_message:
97
98
  rdoc_options: []
98
99
  require_paths:
@@ -101,14 +102,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
102
  requirements:
102
103
  - - ">="
103
104
  - !ruby/object:Gem::Version
104
- version: '2.6'
105
+ version: '2.7'
105
106
  required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  requirements:
107
108
  - - ">="
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
110
111
  requirements: []
111
- rubygems_version: 3.2.31
112
+ rubygems_version: 3.3.16
112
113
  signing_key:
113
114
  specification_version: 4
114
115
  summary: IAM authentication for PostgreSQL on Amazon RDS