google-auth-stores-aws_parameter_store 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6bac76602321f2ecc7134dd0b8cd3b97fe418111cde5a66f53a833fbdaae0da2
4
+ data.tar.gz: b859ffc7fac289858b0295b2f9e753aa1707fba58a605688d746f711088f7a96
5
+ SHA512:
6
+ metadata.gz: cc07c68b5d70618d46d3de0aaa9b987e795accf17771b7a1e0ea5b68701a27391eb8af124c1e932d4c2ebd642ecb1cc0c81852fb6b58c2f12049f438d61605af
7
+ data.tar.gz: 96123bf1c3afaa4072763de44bb29c10de980c7ead77e246e2be41ca3f59aba0b74a22942b41c325f47da44a76d904c6843e713942c088bebcca882e063286e7
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ Gemfile.lock
14
+ vendor/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.3
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in google-auth-stores-aws_parameter_store.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Google::Auth::Stores::AwsParameterStore
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/google/auth/stores/aws_parameter_store`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'google-auth-stores-aws_parameter_store'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install google-auth-stores-aws_parameter_store
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/google-auth-stores-aws_parameter_store.
36
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "google/auth/stores/aws_parameter_store"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "google-auth-stores-aws_parameter_store"
3
+ spec.version = "0.1.0"
4
+ spec.authors = ["Takahiro Ooishi"]
5
+ spec.email = ["taka0125@gmail.com"]
6
+
7
+ spec.summary = %q{Google Auth Store use AWS Parameter Store}
8
+ spec.description = %q{Google Auth Store use AWS Parameter Store}
9
+ spec.homepage = "https://github.com/taka0125/google-auth-stores-aws_parameter_store"
10
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
+
12
+ spec.metadata["homepage_uri"] = spec.homepage
13
+ spec.metadata["source_code_uri"] = spec.homepage
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency 'googleauth'
25
+ spec.add_dependency 'aws-sdk-ssm'
26
+ end
@@ -0,0 +1,42 @@
1
+ require "googleauth/token_store"
2
+
3
+ module Google
4
+ module Auth
5
+ module Stores
6
+ class AwsParameterStore < ::Google::Auth::TokenStore
7
+ VERSION = "0.1.0"
8
+ DEFAULT_KEY_PREFIX = "Google::Auth::Stores::AwsParameterStore::"
9
+
10
+ def initialize(options = {})
11
+ super()
12
+
13
+ @client = options.delete (:client)
14
+
15
+ prefix = options.delete :prefix
16
+ @prefix = prefix || DEFAULT_KEY_PREFIX
17
+ end
18
+
19
+ def load(id)
20
+ key = key_for(id)
21
+ @client.get_parameter(name: key, with_decryption: true)&.parameter&.value
22
+ rescue
23
+ nil
24
+ end
25
+
26
+ def store(id, token)
27
+ key = key_for(id)
28
+ @client.put_parameter(name: key, value: token, type: 'SecureString', overwrite: true)
29
+ end
30
+
31
+ def delete(id)
32
+ key = key_for(id)
33
+ @client.delete_parameter(name: key)
34
+ end
35
+
36
+ def key_for(id)
37
+ @prefix + id
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-auth-stores-aws_parameter_store
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takahiro Ooishi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-11-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: googleauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-ssm
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:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Google Auth Store use AWS Parameter Store
42
+ email:
43
+ - taka0125@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - google-auth-stores-aws_parameter_store.gemspec
57
+ - lib/google/auth/stores/aws_parameter_store.rb
58
+ homepage: https://github.com/taka0125/google-auth-stores-aws_parameter_store
59
+ licenses: []
60
+ metadata:
61
+ homepage_uri: https://github.com/taka0125/google-auth-stores-aws_parameter_store
62
+ source_code_uri: https://github.com/taka0125/google-auth-stores-aws_parameter_store
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.3.0
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.0.3
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Google Auth Store use AWS Parameter Store
82
+ test_files: []