pg-aws_rds_iam 0.4.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -1
- data/lib/pg/aws_rds_iam/active_record_postgresql_adapter.rb +14 -0
- data/lib/pg/aws_rds_iam/active_record_postgresql_database_tasks/set_psql_env.rb +1 -2
- data/lib/pg/aws_rds_iam/auth_token_generator.rb +1 -1
- data/lib/pg/aws_rds_iam/auth_token_generator_registry.rb +2 -2
- data/lib/pg/aws_rds_iam/rails_dbconsole.rb +16 -0
- data/lib/pg/aws_rds_iam/version.rb +1 -1
- data/lib/pg/aws_rds_iam.rb +14 -0
- data/pg-aws_rds_iam.gemspec +10 -3
- metadata +11 -32
- data/.github/dependabot.yml +0 -16
- data/.github/workflows/ci.yml +0 -97
- data/.gitignore +0 -14
- data/.rubocop.yml +0 -53
- data/.ruby-version +0 -1
- data/CODE_OF_CONDUCT.md +0 -87
- data/Gemfile +0 -21
- data/Gemfile.lock +0 -110
- data/Rakefile +0 -39
- data/bin/bundle +0 -105
- data/bin/console +0 -8
- data/bin/install-bundler +0 -4
- data/bin/rake +0 -29
- data/bin/setup +0 -6
- data/bin/upgrade-terraform-providers +0 -14
- data/bin/version-matrix +0 -53
- data/bin/yard +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94635722d8000b0961d12c63c2860cc45cf980f501dd98fd2e19873a7109b0a0
|
4
|
+
data.tar.gz: abc349b32a7318ae752d3d07e4fb51cd6c06b9c07e5863a8ca5d87c0906b6489
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3049603b1e2b604d099befce44ea754a14724581e33841067d00461d51ef07a19c2276e9d88a386bba886f0ae89d93287a23c100535160f8ab4a0753d2377a7
|
7
|
+
data.tar.gz: 6fe8c3dcc525fb048bb652b9db21e9fb2855bed0a527965a2c2ffb42c36e652586668af37c92ef4dbd9900e9a8f1bfaea64d99d1aeebdadcf60f886dd90ab658
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,22 @@ 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.6.0] - 2024-10-30
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
* Require Ruby ≥ 3.1 ([#653](https://github.com/haines/pg-aws_rds_iam/pull/653))
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
* Generate auth token for `rails dbconsole` command ([#678](https://github.com/haines/pg-aws_rds_iam/pull/678))
|
18
|
+
|
19
|
+
## [0.5.0] - 2023-05-04
|
20
|
+
|
21
|
+
### Changed
|
22
|
+
* Require Ruby ≥ 3.0, Active Record ≥ 6.1, and PG ≥ 1.1 ([#492](https://github.com/haines/pg-aws_rds_iam/pull/492))
|
23
|
+
|
24
|
+
### Removed
|
25
|
+
* Development files that were unnecessarily included in the gem ([#498](https://github.com/haines/pg-aws_rds_iam/pull/498))
|
26
|
+
|
11
27
|
## [0.4.2] - 2023-01-10
|
12
28
|
|
13
29
|
### Changed
|
@@ -65,7 +81,9 @@ No notable changes.
|
|
65
81
|
* 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))
|
66
82
|
* ActiveRecord support. ([#3](https://github.com/haines/pg-aws_rds_iam/pull/3))
|
67
83
|
|
68
|
-
[Unreleased]: https://github.com/haines/pg-aws_rds_iam/compare/v0.
|
84
|
+
[Unreleased]: https://github.com/haines/pg-aws_rds_iam/compare/v0.6.0...HEAD
|
85
|
+
[0.6.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.5.0...v0.6.0
|
86
|
+
[0.5.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.4.2...v0.5.0
|
69
87
|
[0.4.2]: https://github.com/haines/pg-aws_rds_iam/compare/v0.4.1...v0.4.2
|
70
88
|
[0.4.1]: https://github.com/haines/pg-aws_rds_iam/compare/v0.4.0...v0.4.1
|
71
89
|
[0.4.0]: https://github.com/haines/pg-aws_rds_iam/compare/v0.3.2...v0.4.0
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PG
|
4
|
+
module AWS_RDS_IAM
|
5
|
+
module ActiveRecordPostgreSQLAdapter
|
6
|
+
def dbconsole(config, *)
|
7
|
+
AuthTokenInjector.new.inject_into_psql_env! config.configuration_hash, ENV
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
private_constant :ActiveRecordPostgreSQLAdapter
|
13
|
+
end
|
14
|
+
end
|
@@ -7,8 +7,7 @@ module PG
|
|
7
7
|
|
8
8
|
def set_psql_env
|
9
9
|
super
|
10
|
-
|
11
|
-
AuthTokenInjector.new.inject_into_psql_env! hash, ENV
|
10
|
+
AuthTokenInjector.new.inject_into_psql_env! configuration_hash, ENV
|
12
11
|
end
|
13
12
|
end
|
14
13
|
end
|
@@ -11,7 +11,7 @@ module PG
|
|
11
11
|
# @param credentials [Aws::CredentialProvider] the IAM credentials with which to sign the token
|
12
12
|
# @param region [String] the AWS region in which the RDS instances are running
|
13
13
|
def initialize(credentials:, region:)
|
14
|
-
@generator = Aws::RDS::AuthTokenGenerator.new(credentials:
|
14
|
+
@generator = Aws::RDS::AuthTokenGenerator.new(credentials:)
|
15
15
|
@region = region
|
16
16
|
end
|
17
17
|
|
@@ -18,8 +18,8 @@ module PG
|
|
18
18
|
# @param name [String, Symbol]
|
19
19
|
# @return [void]
|
20
20
|
# @yieldreturn [AuthTokenGenerator]
|
21
|
-
def add(name, &
|
22
|
-
@registry[name.to_s] = Memoizer.new(&
|
21
|
+
def add(name, &)
|
22
|
+
@registry[name.to_s] = Memoizer.new(&)
|
23
23
|
end
|
24
24
|
|
25
25
|
# Looks up an {AuthTokenGenerator} by name.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PG
|
4
|
+
module AWS_RDS_IAM
|
5
|
+
module RailsDBConsole
|
6
|
+
private
|
7
|
+
|
8
|
+
def find_cmd_and_exec(*)
|
9
|
+
AuthTokenInjector.new.inject_into_psql_env! db_config.configuration_hash, ENV
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
private_constant :RailsDBConsole
|
15
|
+
end
|
16
|
+
end
|
data/lib/pg/aws_rds_iam.rb
CHANGED
@@ -28,9 +28,23 @@ module PG
|
|
28
28
|
PG::Connection.singleton_class.prepend Connection
|
29
29
|
|
30
30
|
if defined?(ActiveRecord)
|
31
|
+
require "active_record/connection_adapters/postgresql_adapter"
|
32
|
+
|
33
|
+
if ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.respond_to?(:dbconsole)
|
34
|
+
require_relative "aws_rds_iam/active_record_postgresql_adapter"
|
35
|
+
|
36
|
+
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.singleton_class.prepend ActiveRecordPostgreSQLAdapter
|
37
|
+
end
|
38
|
+
|
31
39
|
require_relative "aws_rds_iam/active_record_postgresql_database_tasks"
|
32
40
|
|
33
41
|
ActiveRecord::Tasks::PostgreSQLDatabaseTasks.prepend ActiveRecordPostgreSQLDatabaseTasks
|
34
42
|
end
|
43
|
+
|
44
|
+
if defined?(Rails::DBConsole) && Rails::DBConsole.private_instance_methods.include?(:find_cmd_and_exec)
|
45
|
+
require_relative "aws_rds_iam/rails_dbconsole"
|
46
|
+
|
47
|
+
Rails::DBConsole.prepend RailsDBConsole
|
48
|
+
end
|
35
49
|
end
|
36
50
|
end
|
data/pg-aws_rds_iam.gemspec
CHANGED
@@ -23,12 +23,19 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.metadata["rubygems_mfa_required"] = "true"
|
25
25
|
|
26
|
-
spec.files = Dir
|
26
|
+
spec.files = Dir[
|
27
|
+
"lib/**/*.rb",
|
28
|
+
".yardopts",
|
29
|
+
"CHANGELOG.md",
|
30
|
+
"LICENSE.txt",
|
31
|
+
"pg-aws_rds_iam.gemspec",
|
32
|
+
"README.md"
|
33
|
+
]
|
27
34
|
|
28
35
|
spec.require_paths = ["lib"]
|
29
36
|
|
30
|
-
spec.required_ruby_version = ">=
|
37
|
+
spec.required_ruby_version = ">= 3.1"
|
31
38
|
|
32
39
|
spec.add_dependency "aws-sdk-rds", "~> 1.0"
|
33
|
-
spec.add_dependency "pg", "
|
40
|
+
spec.add_dependency "pg", "~> 1.1"
|
34
41
|
end
|
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.
|
4
|
+
version: 0.6.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:
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-rds
|
@@ -28,22 +28,16 @@ dependencies:
|
|
28
28
|
name: pg
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.18'
|
34
|
-
- - "<"
|
31
|
+
- - "~>"
|
35
32
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
33
|
+
version: '1.1'
|
37
34
|
type: :runtime
|
38
35
|
prerelease: false
|
39
36
|
version_requirements: !ruby/object:Gem::Requirement
|
40
37
|
requirements:
|
41
|
-
- - "
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0.18'
|
44
|
-
- - "<"
|
38
|
+
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '1.1'
|
47
41
|
description: PG::AWS_RDS_IAM is a plugin for the pg gem that adds support for IAM
|
48
42
|
authentication when connecting to PostgreSQL databases hosted in Amazon RDS.
|
49
43
|
email:
|
@@ -52,28 +46,12 @@ executables: []
|
|
52
46
|
extensions: []
|
53
47
|
extra_rdoc_files: []
|
54
48
|
files:
|
55
|
-
- ".github/dependabot.yml"
|
56
|
-
- ".github/workflows/ci.yml"
|
57
|
-
- ".gitignore"
|
58
|
-
- ".rubocop.yml"
|
59
|
-
- ".ruby-version"
|
60
49
|
- ".yardopts"
|
61
50
|
- CHANGELOG.md
|
62
|
-
- CODE_OF_CONDUCT.md
|
63
|
-
- Gemfile
|
64
|
-
- Gemfile.lock
|
65
51
|
- LICENSE.txt
|
66
52
|
- README.md
|
67
|
-
- Rakefile
|
68
|
-
- bin/bundle
|
69
|
-
- bin/console
|
70
|
-
- bin/install-bundler
|
71
|
-
- bin/rake
|
72
|
-
- bin/setup
|
73
|
-
- bin/upgrade-terraform-providers
|
74
|
-
- bin/version-matrix
|
75
|
-
- bin/yard
|
76
53
|
- lib/pg/aws_rds_iam.rb
|
54
|
+
- lib/pg/aws_rds_iam/active_record_postgresql_adapter.rb
|
77
55
|
- lib/pg/aws_rds_iam/active_record_postgresql_database_tasks.rb
|
78
56
|
- lib/pg/aws_rds_iam/active_record_postgresql_database_tasks/psql_env.rb
|
79
57
|
- lib/pg/aws_rds_iam/active_record_postgresql_database_tasks/set_psql_env.rb
|
@@ -86,6 +64,7 @@ files:
|
|
86
64
|
- lib/pg/aws_rds_iam/connection_info/keyword_value_string.rb
|
87
65
|
- lib/pg/aws_rds_iam/connection_info/parse_error.rb
|
88
66
|
- lib/pg/aws_rds_iam/connection_info/uri.rb
|
67
|
+
- lib/pg/aws_rds_iam/rails_dbconsole.rb
|
89
68
|
- lib/pg/aws_rds_iam/version.rb
|
90
69
|
- pg-aws_rds_iam.gemspec
|
91
70
|
homepage: https://github.com/haines/pg-aws_rds_iam
|
@@ -94,7 +73,7 @@ licenses:
|
|
94
73
|
metadata:
|
95
74
|
bug_tracker_uri: https://github.com/haines/pg-aws_rds_iam/issues
|
96
75
|
changelog_uri: https://github.com/haines/pg-aws_rds_iam/blob/main/CHANGELOG.md
|
97
|
-
documentation_uri: https://rubydoc.info/gems/pg-aws_rds_iam/0.
|
76
|
+
documentation_uri: https://rubydoc.info/gems/pg-aws_rds_iam/0.6.0
|
98
77
|
homepage_uri: https://github.com/haines/pg-aws_rds_iam
|
99
78
|
source_code_uri: https://github.com/haines/pg-aws_rds_iam
|
100
79
|
rubygems_mfa_required: 'true'
|
@@ -106,14 +85,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
106
85
|
requirements:
|
107
86
|
- - ">="
|
108
87
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
88
|
+
version: '3.1'
|
110
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
90
|
requirements:
|
112
91
|
- - ">="
|
113
92
|
- !ruby/object:Gem::Version
|
114
93
|
version: '0'
|
115
94
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
95
|
+
rubygems_version: 3.5.22
|
117
96
|
signing_key:
|
118
97
|
specification_version: 4
|
119
98
|
summary: IAM authentication for PostgreSQL on Amazon RDS
|
data/.github/dependabot.yml
DELETED
data/.github/workflows/ci.yml
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
|
3
|
-
on: pull_request
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
lint:
|
7
|
-
name: Lint
|
8
|
-
|
9
|
-
runs-on: ubuntu-latest
|
10
|
-
|
11
|
-
steps:
|
12
|
-
- name: Check out source code
|
13
|
-
uses: actions/checkout@v3
|
14
|
-
|
15
|
-
- name: Install Ruby and gems
|
16
|
-
uses: ruby/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
bundler-cache: true
|
19
|
-
|
20
|
-
- name: Run RuboCop
|
21
|
-
run: bin/rake rubocop
|
22
|
-
|
23
|
-
version-matrix:
|
24
|
-
name: Generate version matrix
|
25
|
-
|
26
|
-
runs-on: ubuntu-latest
|
27
|
-
|
28
|
-
outputs:
|
29
|
-
matrix: ${{ steps.version-matrix.outputs.matrix }}
|
30
|
-
|
31
|
-
steps:
|
32
|
-
- name: Check out source code
|
33
|
-
uses: actions/checkout@v3
|
34
|
-
|
35
|
-
- name: Generate version matrix
|
36
|
-
id: version-matrix
|
37
|
-
run: bin/version-matrix
|
38
|
-
|
39
|
-
test:
|
40
|
-
needs: version-matrix
|
41
|
-
|
42
|
-
strategy:
|
43
|
-
matrix: ${{ fromJSON(needs.version-matrix.outputs.matrix) }}
|
44
|
-
|
45
|
-
name: Ruby ${{ matrix.ruby }} | PG ${{ matrix.pg }} | ActiveRecord ${{ matrix.activerecord }}
|
46
|
-
|
47
|
-
runs-on: ubuntu-latest
|
48
|
-
|
49
|
-
env:
|
50
|
-
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
|
51
|
-
ACTIVERECORD_VERSION: ${{ matrix.activerecord }}
|
52
|
-
PG_VERSION: ${{ matrix.pg }}
|
53
|
-
|
54
|
-
steps:
|
55
|
-
- name: Check out source code
|
56
|
-
uses: actions/checkout@v3
|
57
|
-
|
58
|
-
- name: Install Ruby
|
59
|
-
uses: ruby/setup-ruby@v1
|
60
|
-
with:
|
61
|
-
ruby-version: ${{ matrix.ruby }}
|
62
|
-
|
63
|
-
- name: Update Gemfile.lock
|
64
|
-
run: bin/bundle lock --update activerecord pg
|
65
|
-
|
66
|
-
- name: Install gems
|
67
|
-
uses: ruby/setup-ruby@v1
|
68
|
-
with:
|
69
|
-
ruby-version: ${{ matrix.ruby }}
|
70
|
-
bundler-cache: true
|
71
|
-
|
72
|
-
- name: Run unit tests
|
73
|
-
run: bin/rake test:unit
|
74
|
-
|
75
|
-
- name: Run acceptance tests
|
76
|
-
run: bin/rake test:acceptance
|
77
|
-
env:
|
78
|
-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
79
|
-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
80
|
-
AWS_REGION: ${{ secrets.AWS_REGION }}
|
81
|
-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
82
|
-
SECURITY_GROUP_ID: ${{ secrets.SECURITY_GROUP_ID }}
|
83
|
-
|
84
|
-
test-results:
|
85
|
-
name: Check test results
|
86
|
-
|
87
|
-
if: always()
|
88
|
-
|
89
|
-
needs:
|
90
|
-
- version-matrix
|
91
|
-
- test
|
92
|
-
|
93
|
-
runs-on: ubuntu-latest
|
94
|
-
|
95
|
-
steps:
|
96
|
-
- name: Check test results
|
97
|
-
run: test "${{ needs.test.result }}" = "success"
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-minitest
|
3
|
-
- rubocop-rake
|
4
|
-
|
5
|
-
AllCops:
|
6
|
-
TargetRubyVersion: 2.7
|
7
|
-
NewCops: enable
|
8
|
-
Exclude:
|
9
|
-
- bin/bundle
|
10
|
-
- bin/rake
|
11
|
-
- bin/yard
|
12
|
-
- vendor/**/*
|
13
|
-
|
14
|
-
Layout/LineLength:
|
15
|
-
Enabled: false
|
16
|
-
|
17
|
-
Metrics/AbcSize:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Metrics/MethodLength:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
Minitest/MultipleAssertions:
|
24
|
-
Enabled: false
|
25
|
-
|
26
|
-
Naming/ClassAndModuleCamelCase:
|
27
|
-
Enabled: false
|
28
|
-
|
29
|
-
Naming/VariableNumber:
|
30
|
-
EnforcedStyle: snake_case
|
31
|
-
|
32
|
-
Style/Documentation:
|
33
|
-
Exclude:
|
34
|
-
- lib/pg/aws_rds_iam/active_record_postgresql_database_tasks.rb
|
35
|
-
- lib/pg/aws_rds_iam/active_record_postgresql_database_tasks/**/*.rb
|
36
|
-
- lib/pg/aws_rds_iam/auth_token_injector.rb
|
37
|
-
- lib/pg/aws_rds_iam/connection_info.rb
|
38
|
-
- lib/pg/aws_rds_iam/connection_info/**/*.rb
|
39
|
-
- lib/pg/aws_rds_iam/connection.rb
|
40
|
-
- test/**/*.rb
|
41
|
-
|
42
|
-
Style/HashSyntax:
|
43
|
-
Exclude:
|
44
|
-
- Rakefile
|
45
|
-
|
46
|
-
Style/StringLiterals:
|
47
|
-
EnforcedStyle: double_quotes
|
48
|
-
|
49
|
-
Style/SymbolArray:
|
50
|
-
EnforcedStyle: brackets
|
51
|
-
|
52
|
-
Style/WordArray:
|
53
|
-
EnforcedStyle: brackets
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-3.2.0
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
-
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
-
|
9
|
-
## Our Standards
|
10
|
-
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
-
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
-
|
19
|
-
Examples of unacceptable behavior include:
|
20
|
-
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
22
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
23
|
-
* Public or private harassment
|
24
|
-
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
25
|
-
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
26
|
-
|
27
|
-
## Enforcement Responsibilities
|
28
|
-
|
29
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
30
|
-
|
31
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
32
|
-
|
33
|
-
## Scope
|
34
|
-
|
35
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
|
36
|
-
Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
37
|
-
|
38
|
-
## Enforcement
|
39
|
-
|
40
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at andrew@haines.org.nz.
|
41
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
42
|
-
|
43
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
44
|
-
|
45
|
-
## Enforcement Guidelines
|
46
|
-
|
47
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
48
|
-
|
49
|
-
### 1. Correction
|
50
|
-
|
51
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
52
|
-
|
53
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate.
|
54
|
-
A public apology may be requested.
|
55
|
-
|
56
|
-
### 2. Warning
|
57
|
-
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
-
|
60
|
-
**Consequence**: A warning with consequences for continued behavior.
|
61
|
-
No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time.
|
62
|
-
This includes avoiding interactions in community spaces as well as external channels like social media.
|
63
|
-
Violating these terms may lead to a temporary or permanent ban.
|
64
|
-
|
65
|
-
### 3. Temporary Ban
|
66
|
-
|
67
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
68
|
-
|
69
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time.
|
70
|
-
No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period.
|
71
|
-
Violating these terms may lead to a permanent ban.
|
72
|
-
|
73
|
-
### 4. Permanent Ban
|
74
|
-
|
75
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
76
|
-
|
77
|
-
**Consequence**: A permanent ban from any sort of public interaction within the project community.
|
78
|
-
|
79
|
-
## Attribution
|
80
|
-
|
81
|
-
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
82
|
-
|
83
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
84
|
-
|
85
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
86
|
-
https://www.contributor-covenant.org/faq.
|
87
|
-
Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
gem "aws-sdk-ec2"
|
7
|
-
gem "bundler"
|
8
|
-
gem "commonmarker"
|
9
|
-
gem "minitest"
|
10
|
-
gem "minitest-reporters"
|
11
|
-
gem "pry"
|
12
|
-
gem "rake"
|
13
|
-
gem "rubocop"
|
14
|
-
gem "rubocop-minitest"
|
15
|
-
gem "rubocop-rake"
|
16
|
-
gem "timecop"
|
17
|
-
gem "yard"
|
18
|
-
|
19
|
-
["activerecord", "pg"].each do |gem_name|
|
20
|
-
gem gem_name, *ENV["#{gem_name.upcase}_VERSION"]&.then { |gem_version| "~> #{gem_version}.0" }
|
21
|
-
end
|
data/Gemfile.lock
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
pg-aws_rds_iam (0.4.2)
|
5
|
-
aws-sdk-rds (~> 1.0)
|
6
|
-
pg (>= 0.18, < 2.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
activemodel (7.0.3.1)
|
12
|
-
activesupport (= 7.0.3.1)
|
13
|
-
activerecord (7.0.3.1)
|
14
|
-
activemodel (= 7.0.3.1)
|
15
|
-
activesupport (= 7.0.3.1)
|
16
|
-
activesupport (7.0.3.1)
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (>= 1.6, < 2)
|
19
|
-
minitest (>= 5.1)
|
20
|
-
tzinfo (~> 2.0)
|
21
|
-
ansi (1.5.0)
|
22
|
-
ast (2.4.2)
|
23
|
-
aws-eventstream (1.2.0)
|
24
|
-
aws-partitions (1.689.0)
|
25
|
-
aws-sdk-core (3.168.4)
|
26
|
-
aws-eventstream (~> 1, >= 1.0.2)
|
27
|
-
aws-partitions (~> 1, >= 1.651.0)
|
28
|
-
aws-sigv4 (~> 1.5)
|
29
|
-
jmespath (~> 1, >= 1.6.1)
|
30
|
-
aws-sdk-ec2 (1.356.0)
|
31
|
-
aws-sdk-core (~> 3, >= 3.165.0)
|
32
|
-
aws-sigv4 (~> 1.1)
|
33
|
-
aws-sdk-rds (1.169.0)
|
34
|
-
aws-sdk-core (~> 3, >= 3.165.0)
|
35
|
-
aws-sigv4 (~> 1.1)
|
36
|
-
aws-sigv4 (1.5.2)
|
37
|
-
aws-eventstream (~> 1, >= 1.0.2)
|
38
|
-
builder (3.2.4)
|
39
|
-
coderay (1.1.3)
|
40
|
-
commonmarker (0.23.6)
|
41
|
-
concurrent-ruby (1.1.10)
|
42
|
-
i18n (1.11.0)
|
43
|
-
concurrent-ruby (~> 1.0)
|
44
|
-
jmespath (1.6.2)
|
45
|
-
json (2.6.3)
|
46
|
-
method_source (1.0.0)
|
47
|
-
minitest (5.17.0)
|
48
|
-
minitest-reporters (1.5.0)
|
49
|
-
ansi
|
50
|
-
builder
|
51
|
-
minitest (>= 5.0)
|
52
|
-
ruby-progressbar
|
53
|
-
parallel (1.22.1)
|
54
|
-
parser (3.1.3.0)
|
55
|
-
ast (~> 2.4.1)
|
56
|
-
pg (1.4.5)
|
57
|
-
pry (0.14.1)
|
58
|
-
coderay (~> 1.1)
|
59
|
-
method_source (~> 1.0)
|
60
|
-
rainbow (3.1.1)
|
61
|
-
rake (13.0.6)
|
62
|
-
regexp_parser (2.6.1)
|
63
|
-
rexml (3.2.5)
|
64
|
-
rubocop (1.42.0)
|
65
|
-
json (~> 2.3)
|
66
|
-
parallel (~> 1.10)
|
67
|
-
parser (>= 3.1.2.1)
|
68
|
-
rainbow (>= 2.2.2, < 4.0)
|
69
|
-
regexp_parser (>= 1.8, < 3.0)
|
70
|
-
rexml (>= 3.2.5, < 4.0)
|
71
|
-
rubocop-ast (>= 1.24.1, < 2.0)
|
72
|
-
ruby-progressbar (~> 1.7)
|
73
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
74
|
-
rubocop-ast (1.24.1)
|
75
|
-
parser (>= 3.1.1.0)
|
76
|
-
rubocop-minitest (0.25.1)
|
77
|
-
rubocop (>= 0.90, < 2.0)
|
78
|
-
rubocop-rake (0.6.0)
|
79
|
-
rubocop (~> 1.0)
|
80
|
-
ruby-progressbar (1.11.0)
|
81
|
-
timecop (0.9.6)
|
82
|
-
tzinfo (2.0.4)
|
83
|
-
concurrent-ruby (~> 1.0)
|
84
|
-
unicode-display_width (2.3.0)
|
85
|
-
webrick (1.7.0)
|
86
|
-
yard (0.9.28)
|
87
|
-
webrick (~> 1.7.0)
|
88
|
-
|
89
|
-
PLATFORMS
|
90
|
-
ruby
|
91
|
-
|
92
|
-
DEPENDENCIES
|
93
|
-
activerecord
|
94
|
-
aws-sdk-ec2
|
95
|
-
bundler
|
96
|
-
commonmarker
|
97
|
-
minitest
|
98
|
-
minitest-reporters
|
99
|
-
pg
|
100
|
-
pg-aws_rds_iam!
|
101
|
-
pry
|
102
|
-
rake
|
103
|
-
rubocop
|
104
|
-
rubocop-minitest
|
105
|
-
rubocop-rake
|
106
|
-
timecop
|
107
|
-
yard
|
108
|
-
|
109
|
-
BUNDLED WITH
|
110
|
-
2.4.3
|
data/Rakefile
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rake/testtask"
|
5
|
-
require "rubocop/rake_task"
|
6
|
-
require "yard"
|
7
|
-
|
8
|
-
namespace :test do
|
9
|
-
Rake::TestTask.new :acceptance do |t|
|
10
|
-
t.description = "Run acceptance tests"
|
11
|
-
t.libs << "test"
|
12
|
-
t.test_files = ["test/acceptance/test.rb"]
|
13
|
-
end
|
14
|
-
|
15
|
-
Rake::TestTask.new :unit do |t|
|
16
|
-
t.description = "Run unit tests"
|
17
|
-
t.libs << "test"
|
18
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "Run all tests"
|
23
|
-
task :test => ["test:unit", "test:acceptance"]
|
24
|
-
|
25
|
-
RuboCop::RakeTask.new do |t|
|
26
|
-
t.formatters = ["fuubar"]
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Generate documentation"
|
30
|
-
YARD::Rake::YardocTask.new
|
31
|
-
|
32
|
-
namespace :yard do
|
33
|
-
desc "Run documentation server"
|
34
|
-
task :server do
|
35
|
-
exec "bin/yard", "server", "--reload"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
task :default => ["test:unit", :rubocop]
|
data/bin/bundle
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'bundle' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "rubygems"
|
12
|
-
|
13
|
-
m = Module.new do
|
14
|
-
module_function
|
15
|
-
|
16
|
-
def invoked_as_script?
|
17
|
-
File.expand_path($0) == File.expand_path(__FILE__)
|
18
|
-
end
|
19
|
-
|
20
|
-
def env_var_version
|
21
|
-
ENV["BUNDLER_VERSION"]
|
22
|
-
end
|
23
|
-
|
24
|
-
def cli_arg_version
|
25
|
-
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
|
-
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
|
-
bundler_version = nil
|
28
|
-
update_index = nil
|
29
|
-
ARGV.each_with_index do |a, i|
|
30
|
-
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
31
|
-
bundler_version = a
|
32
|
-
end
|
33
|
-
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
34
|
-
bundler_version = $1 || ">= 0.a"
|
35
|
-
update_index = i
|
36
|
-
end
|
37
|
-
bundler_version
|
38
|
-
end
|
39
|
-
|
40
|
-
def gemfile
|
41
|
-
gemfile = ENV["BUNDLE_GEMFILE"]
|
42
|
-
return gemfile if gemfile && !gemfile.empty?
|
43
|
-
|
44
|
-
File.expand_path("../../Gemfile", __FILE__)
|
45
|
-
end
|
46
|
-
|
47
|
-
def lockfile
|
48
|
-
lockfile =
|
49
|
-
case File.basename(gemfile)
|
50
|
-
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
|
51
|
-
else "#{gemfile}.lock"
|
52
|
-
end
|
53
|
-
File.expand_path(lockfile)
|
54
|
-
end
|
55
|
-
|
56
|
-
def lockfile_version
|
57
|
-
return unless File.file?(lockfile)
|
58
|
-
lockfile_contents = File.read(lockfile)
|
59
|
-
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
60
|
-
Regexp.last_match(1)
|
61
|
-
end
|
62
|
-
|
63
|
-
def bundler_version
|
64
|
-
@bundler_version ||= begin
|
65
|
-
env_var_version || cli_arg_version ||
|
66
|
-
lockfile_version || "#{Gem::Requirement.default}.a"
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def load_bundler!
|
71
|
-
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
72
|
-
|
73
|
-
# must dup string for RG < 1.8 compatibility
|
74
|
-
activate_bundler(bundler_version.dup)
|
75
|
-
end
|
76
|
-
|
77
|
-
def activate_bundler(bundler_version)
|
78
|
-
if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
|
79
|
-
bundler_version = "< 2"
|
80
|
-
end
|
81
|
-
gem_error = activation_error_handling do
|
82
|
-
gem "bundler", bundler_version
|
83
|
-
end
|
84
|
-
return if gem_error.nil?
|
85
|
-
require_error = activation_error_handling do
|
86
|
-
require "bundler/version"
|
87
|
-
end
|
88
|
-
return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
89
|
-
warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
|
90
|
-
exit 42
|
91
|
-
end
|
92
|
-
|
93
|
-
def activation_error_handling
|
94
|
-
yield
|
95
|
-
nil
|
96
|
-
rescue StandardError, LoadError => e
|
97
|
-
e
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
m.load_bundler!
|
102
|
-
|
103
|
-
if m.invoked_as_script?
|
104
|
-
load Gem.bin_path("bundler", "bundle")
|
105
|
-
end
|
data/bin/console
DELETED
data/bin/install-bundler
DELETED
data/bin/rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'rake' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "pathname"
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
14
|
-
|
15
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
-
|
17
|
-
if File.file?(bundle_binstub)
|
18
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
-
load(bundle_binstub)
|
20
|
-
else
|
21
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
require "rubygems"
|
27
|
-
require "bundler/setup"
|
28
|
-
|
29
|
-
load Gem.bin_path("rake", "rake")
|
data/bin/setup
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -o errexit
|
3
|
-
set -o nounset
|
4
|
-
set -o pipefail
|
5
|
-
|
6
|
-
cd test/acceptance/infrastructure
|
7
|
-
|
8
|
-
rm -f .terraform.lock.hcl
|
9
|
-
|
10
|
-
terraform init --upgrade
|
11
|
-
|
12
|
-
terraform providers lock \
|
13
|
-
--platform=darwin_amd64 \
|
14
|
-
--platform=linux_amd64
|
data/bin/version-matrix
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
def minor_versions(name, requirement)
|
7
|
-
tuples, _errors = Gem::SpecFetcher.fetcher.search_for_dependency(Gem::Dependency.new(name, requirement))
|
8
|
-
tuples.map { |tuple, _source| tuple.version.segments.first(2).join(".") }.uniq
|
9
|
-
end
|
10
|
-
|
11
|
-
ruby_activerecord_requirements = {
|
12
|
-
"2.7" => ">= 6.0",
|
13
|
-
"3.0" => ">= 6.0",
|
14
|
-
"3.1" => ">= 6.0",
|
15
|
-
"3.2" => ">= 6.0"
|
16
|
-
}
|
17
|
-
|
18
|
-
ruby_pg_requirements = {
|
19
|
-
"2.7" => "> 0",
|
20
|
-
"3.0" => "> 0",
|
21
|
-
"3.1" => "> 0",
|
22
|
-
"3.2" => ">= 1.3"
|
23
|
-
}
|
24
|
-
|
25
|
-
activerecord_pg_requirements = {
|
26
|
-
"6.0" => [">= 0.18", "< 2.0"],
|
27
|
-
"6.1" => "~> 1.1",
|
28
|
-
"7.0" => "~> 1.1"
|
29
|
-
}
|
30
|
-
|
31
|
-
versions = ruby_activerecord_requirements.flat_map do |ruby_version, activerecord_requirement|
|
32
|
-
minor_versions("activerecord", activerecord_requirement).flat_map do |activerecord_version|
|
33
|
-
pg_requirement = [
|
34
|
-
ruby_pg_requirements.fetch(ruby_version),
|
35
|
-
activerecord_pg_requirements.fetch(activerecord_version)
|
36
|
-
].flatten
|
37
|
-
|
38
|
-
minor_versions("pg", pg_requirement).map do |pg_version|
|
39
|
-
{
|
40
|
-
ruby: ruby_version,
|
41
|
-
activerecord: activerecord_version,
|
42
|
-
pg: pg_version
|
43
|
-
}
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
matrix = { include: versions }
|
49
|
-
|
50
|
-
puts JSON.pretty_generate(matrix)
|
51
|
-
|
52
|
-
output_file = ENV.fetch("GITHUB_OUTPUT", false)
|
53
|
-
File.write output_file, "matrix=#{matrix.to_json}" if output_file
|
data/bin/yard
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# This file was generated by Bundler.
|
6
|
-
#
|
7
|
-
# The application 'yard' is installed as part of a gem, and
|
8
|
-
# this file is here to facilitate running it.
|
9
|
-
#
|
10
|
-
|
11
|
-
require "pathname"
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
-
Pathname.new(__FILE__).realpath)
|
14
|
-
|
15
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
-
|
17
|
-
if File.file?(bundle_binstub)
|
18
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
-
load(bundle_binstub)
|
20
|
-
else
|
21
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
require "rubygems"
|
27
|
-
require "bundler/setup"
|
28
|
-
|
29
|
-
load Gem.bin_path("yard", "yard")
|