secretservice 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ed02c40b4f781e3a90dc13119504653306ce62c4
4
+ data.tar.gz: 50b61d0465b945cb5512bf48de74ee25c1ab051a
5
+ SHA512:
6
+ metadata.gz: 042931c8556f2c8d24fa55e11b2d222e0859de5a16e65b5b9296164297b982ae56268acc3f9de23f75b8656b9a4f6f2bc188a0900c2615e07e33af4aac51530d
7
+ data.tar.gz: b6e39055501ac11d8732c6120c56a19393b0766967ff1809fe9eb6d3d9231793cb9c55a20a534b2716863b6a44e1a6039c81b6fd223d256b61a1d2f6a8cc5b79
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ /Gemfile.lock
3
+ /pkg
4
+ /tmp
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --order random
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rails", ">= 3.0.3", "< 4.3"
6
+
7
+ group :test do
8
+ gem "rspec", "~> 3.1"
9
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Kollegorna AB
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ ![Secret Service Rails Gem](http://www.kollegorna.se/images/secretservice.svg)
2
+
3
+ # Secret Service
4
+ [![Code Climate](https://codeclimate.com/github/kollegorna/secretservice/badges/gpa.svg)](https://codeclimate.com/github/kollegorna/secretservice)
5
+
6
+ Undercover secret service agents that check if you have set all the
7
+ required env variables in Rails secrets.yml
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'secretservice'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install secretservice
24
+
25
+ ## Usage
26
+ Once you include it in the Gemfile, Secret Service starts it's undercover operation.
27
+
28
+ If you violate the law then Secret Service will throw you messages like:
29
+
30
+ ```
31
+ bin/rails: HEY! SecretService got you! (SecretService::MissingSecrets)
32
+ Missing secrets: pusher_app_id, pusher_app_key, pusher_app_secret
33
+ ```
34
+
35
+ ## Contributing
36
+
37
+ 1. Fork it ( https://github.com/kollegorna/secretservice/fork )
38
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
39
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 4. Push to the branch (`git push origin my-new-feature`)
41
+ 5. Create a new Pull Request
@@ -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
@@ -0,0 +1,2 @@
1
+ require "secretservice/error"
2
+ require 'secretservice/railtie' if defined?(Rails)
@@ -0,0 +1,18 @@
1
+ module SecretService
2
+ class Error < StandardError; end
3
+
4
+ class MissingSecrets < Error
5
+ def initialize(keys)
6
+ super
7
+ @keys = keys
8
+ end
9
+
10
+ def backtrace
11
+ end
12
+
13
+ def message
14
+ str = "\033[31m HEY! SecretService got you! \033[0m \n"
15
+ str += "\033[31m Missing secrets: #{@keys.join ', '} \033[0m"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ module SecretService
2
+ class Railtie < Rails::Railtie
3
+ config.before_configuration do
4
+ missing_keys = []
5
+ Rails.application.secrets.each do |key, value|
6
+ missing_keys << key if value.nil?
7
+ end
8
+ raise MissingSecrets.new(missing_keys) if missing_keys.any?
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "secretservice"
5
+ gem.version = "1.0.0"
6
+
7
+ gem.author = "Henrik Sjökvist"
8
+ gem.email = "henrik.sjokvist@gmail.com"
9
+ gem.summary = "Ensures that secrets are present in secrets.yml"
10
+ gem.description = "Ensures that any secrets defined in secrets.yml are set."
11
+ gem.homepage = "https://github.com/kollegorna/secretservice"
12
+ gem.license = "MIT"
13
+
14
+ gem.add_development_dependency "bundler", "~> 1.7"
15
+ gem.add_development_dependency "rake", "~> 10.3"
16
+
17
+ gem.files = `git ls-files`.split($\)
18
+ gem.test_files = gem.files.grep(/^spec/)
19
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: secretservice
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Henrik Sjökvist
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.3'
41
+ description: Ensures that any secrets defined in secrets.yml are set.
42
+ email: henrik.sjokvist@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - ".gitignore"
48
+ - ".rspec"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/secretservice.rb
54
+ - lib/secretservice/error.rb
55
+ - lib/secretservice/railtie.rb
56
+ - secretservice.gemspec
57
+ homepage: https://github.com/kollegorna/secretservice
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubyforge_project:
77
+ rubygems_version: 2.4.2
78
+ signing_key:
79
+ specification_version: 4
80
+ summary: Ensures that secrets are present in secrets.yml
81
+ test_files: []