proxy_auth 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proxy_auth/token.rb +1 -1
- data/lib/proxy_auth/version.rb +1 -1
- data/spec/controllers/proxy_auth/register_services_controller_spec.rb +10 -0
- data/spec/dummy/Rakefile +2 -0
- data/spec/dummy/app/assets/javascripts/application.js +1 -0
- data/spec/dummy/app/assets/stylesheets/application.css +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +13 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +11 -0
- data/spec/dummy/config/environments/production.rb +14 -0
- data/spec/dummy/config/environments/test.rb +13 -0
- data/spec/dummy/config/initializers/assets.rb +1 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +1 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +1 -0
- data/spec/dummy/config/initializers/proxy_auth.rb +1 -0
- data/spec/dummy/config/initializers/session_store.rb +1 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +3 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/public/404.html +1 -0
- data/spec/dummy/public/422.html +1 -0
- data/spec/dummy/public/500.html +1 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/proxy_auth/connection_spec.rb +9 -0
- data/spec/proxy_auth/token_spec.rb +15 -0
- data/spec/rails_helper.rb +6 -0
- data/spec/routing/proxy_auth/register_services_routing_spec.rb +12 -0
- data/spec/spec_helper.rb +9 -0
- metadata +74 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3929c5728e347894105ea301987185d422ae98d9
|
4
|
+
data.tar.gz: 72cb4b31b49a1079c0ca59fc15989e02a95ab4e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db07ef8688195b9ba8a355533b93a9e2d43564fdbdb64fa18f47b77758de1bb0f7a18719ea3c34ba394f6f7b450ceb2d1a8a7596afaace49bed2401e745d4f94
|
7
|
+
data.tar.gz: 25b3e6f8fd4276612c4817dcd66d8968e028627751bf0655f6fad3f8f1911c86184b2a1aefc7cb9cdd166e3b28ed5dd03081fdd0371ab586c2571bddb0f06959
|
data/lib/proxy_auth/token.rb
CHANGED
data/lib/proxy_auth/version.rb
CHANGED
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree .
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
require 'action_controller/railtie'
|
3
|
+
require 'action_mailer/railtie'
|
4
|
+
require 'sprockets/railtie'
|
5
|
+
require 'rails/test_unit/railtie'
|
6
|
+
|
7
|
+
Bundler.require(*Rails.groups)
|
8
|
+
require 'proxy_auth'
|
9
|
+
|
10
|
+
module Dummy
|
11
|
+
class Application < Rails::Application
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
config.cache_classes = false
|
3
|
+
config.eager_load = false
|
4
|
+
config.consider_all_requests_local = true
|
5
|
+
config.action_controller.perform_caching = false
|
6
|
+
config.action_mailer.raise_delivery_errors = false
|
7
|
+
config.active_support.deprecation = :log
|
8
|
+
config.assets.debug = true
|
9
|
+
config.assets.digest = true
|
10
|
+
config.assets.raise_runtime_errors = true
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
config.cache_classes = true
|
3
|
+
config.eager_load = true
|
4
|
+
config.consider_all_requests_local = false
|
5
|
+
config.action_controller.perform_caching = true
|
6
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
7
|
+
config.assets.js_compressor = :uglifier
|
8
|
+
config.assets.compile = false
|
9
|
+
config.assets.digest = true
|
10
|
+
config.log_level = :debug
|
11
|
+
config.i18n.fallbacks = true
|
12
|
+
config.active_support.deprecation = :notify
|
13
|
+
config.log_formatter = ::Logger::Formatter.new
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
config.cache_classes = true
|
3
|
+
config.eager_load = false
|
4
|
+
config.serve_static_files = true
|
5
|
+
config.static_cache_control = 'public, max-age=3600'
|
6
|
+
config.consider_all_requests_local = true
|
7
|
+
config.action_controller.perform_caching = false
|
8
|
+
config.action_dispatch.show_exceptions = false
|
9
|
+
config.action_controller.allow_forgery_protection = false
|
10
|
+
config.action_mailer.delivery_method = :test
|
11
|
+
config.active_support.test_order = :random
|
12
|
+
config.active_support.deprecation = :stderr
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.version = '1.0'
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.action_dispatch.cookies_serializer = :json
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.filter_parameters += [:password]
|
@@ -0,0 +1 @@
|
|
1
|
+
ProxyAuth::Token.instance
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.session_store :cookie_store, key: '_dummy_session'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
default: &default
|
2
|
+
proxy:
|
3
|
+
token: 0987
|
4
|
+
url: http://localhost:5100
|
5
|
+
service:
|
6
|
+
name: dummy
|
7
|
+
url: http://localhost:5300
|
8
|
+
admin_login: 'admin'
|
9
|
+
admin_password: 'secret'
|
10
|
+
|
11
|
+
development:
|
12
|
+
<<: *default
|
13
|
+
secret_key_base: 1fe9a5e4b1aaa07ad8bc3137f1e92cd09a5522e059c73f522922344704da8d2c34663305b458865ad6e933021d8dfa971d1f26cff8c94c1df4cd0624e61299b5
|
14
|
+
|
15
|
+
test:
|
16
|
+
<<: *default
|
17
|
+
secret_key_base: 94039740e5438c8d20e397386eb484c20e2852b976fbd85b0d60f658e0ba80392479b7b93ce681e18e44e602d2c44c23337f523ca49e02d3c16d440fec0e7326
|
18
|
+
|
19
|
+
production:
|
20
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
21
|
+
admin_login: <%= ENV["ADMIN_LOGIN"] %>
|
22
|
+
admin_password: <%= ENV["ADMIN_PASSWORD"] %>
|
@@ -0,0 +1 @@
|
|
1
|
+
404 Not Found
|
@@ -0,0 +1 @@
|
|
1
|
+
422 Unprocessable Entity
|
@@ -0,0 +1 @@
|
|
1
|
+
500 Internal Server Error
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe ProxyAuth::Token do
|
4
|
+
subject { described_class.instance }
|
5
|
+
|
6
|
+
context '#valid?' do
|
7
|
+
it 'returns true for valid token' do
|
8
|
+
expect(subject.valid? subject.token).to be_truthy
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'returns false for invalid token' do
|
12
|
+
expect(subject.valid? "#{subject.token}1").to be_falsey
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe ProxyAuth::RegisterServicesController, type: :routing do
|
4
|
+
routes { ProxyAuth::Engine.routes }
|
5
|
+
|
6
|
+
it 'POST #show' do
|
7
|
+
expect(post 'register_service').to route_to(
|
8
|
+
controller: 'proxy_auth/register_services',
|
9
|
+
action: 'create'
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Lisowski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -60,6 +60,41 @@ files:
|
|
60
60
|
- lib/proxy_auth/token.rb
|
61
61
|
- lib/proxy_auth/version.rb
|
62
62
|
- lib/tasks/proxy_auth.rake
|
63
|
+
- spec/controllers/proxy_auth/register_services_controller_spec.rb
|
64
|
+
- spec/dummy/Rakefile
|
65
|
+
- spec/dummy/app/assets/javascripts/application.js
|
66
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
67
|
+
- spec/dummy/app/controllers/application_controller.rb
|
68
|
+
- spec/dummy/app/helpers/application_helper.rb
|
69
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
70
|
+
- spec/dummy/bin/bundle
|
71
|
+
- spec/dummy/bin/rails
|
72
|
+
- spec/dummy/bin/rake
|
73
|
+
- spec/dummy/bin/setup
|
74
|
+
- spec/dummy/config.ru
|
75
|
+
- spec/dummy/config/application.rb
|
76
|
+
- spec/dummy/config/boot.rb
|
77
|
+
- spec/dummy/config/environment.rb
|
78
|
+
- spec/dummy/config/environments/development.rb
|
79
|
+
- spec/dummy/config/environments/production.rb
|
80
|
+
- spec/dummy/config/environments/test.rb
|
81
|
+
- spec/dummy/config/initializers/assets.rb
|
82
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
83
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
84
|
+
- spec/dummy/config/initializers/proxy_auth.rb
|
85
|
+
- spec/dummy/config/initializers/session_store.rb
|
86
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
87
|
+
- spec/dummy/config/routes.rb
|
88
|
+
- spec/dummy/config/secrets.yml
|
89
|
+
- spec/dummy/public/404.html
|
90
|
+
- spec/dummy/public/422.html
|
91
|
+
- spec/dummy/public/500.html
|
92
|
+
- spec/dummy/public/favicon.ico
|
93
|
+
- spec/proxy_auth/connection_spec.rb
|
94
|
+
- spec/proxy_auth/token_spec.rb
|
95
|
+
- spec/rails_helper.rb
|
96
|
+
- spec/routing/proxy_auth/register_services_routing_spec.rb
|
97
|
+
- spec/spec_helper.rb
|
63
98
|
homepage:
|
64
99
|
licenses:
|
65
100
|
- MIT
|
@@ -80,8 +115,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
115
|
version: '0'
|
81
116
|
requirements: []
|
82
117
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.4.
|
118
|
+
rubygems_version: 2.4.6
|
84
119
|
signing_key:
|
85
120
|
specification_version: 4
|
86
121
|
summary: Proxy authentication client
|
87
|
-
test_files:
|
122
|
+
test_files:
|
123
|
+
- spec/controllers/proxy_auth/register_services_controller_spec.rb
|
124
|
+
- spec/spec_helper.rb
|
125
|
+
- spec/routing/proxy_auth/register_services_routing_spec.rb
|
126
|
+
- spec/proxy_auth/token_spec.rb
|
127
|
+
- spec/proxy_auth/connection_spec.rb
|
128
|
+
- spec/rails_helper.rb
|
129
|
+
- spec/dummy/config.ru
|
130
|
+
- spec/dummy/config/secrets.yml
|
131
|
+
- spec/dummy/config/routes.rb
|
132
|
+
- spec/dummy/config/application.rb
|
133
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
134
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
135
|
+
- spec/dummy/config/initializers/proxy_auth.rb
|
136
|
+
- spec/dummy/config/initializers/assets.rb
|
137
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
138
|
+
- spec/dummy/config/initializers/session_store.rb
|
139
|
+
- spec/dummy/config/environment.rb
|
140
|
+
- spec/dummy/config/boot.rb
|
141
|
+
- spec/dummy/config/environments/production.rb
|
142
|
+
- spec/dummy/config/environments/development.rb
|
143
|
+
- spec/dummy/config/environments/test.rb
|
144
|
+
- spec/dummy/app/controllers/application_controller.rb
|
145
|
+
- spec/dummy/app/helpers/application_helper.rb
|
146
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
147
|
+
- spec/dummy/app/assets/javascripts/application.js
|
148
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
149
|
+
- spec/dummy/bin/setup
|
150
|
+
- spec/dummy/bin/rails
|
151
|
+
- spec/dummy/bin/bundle
|
152
|
+
- spec/dummy/bin/rake
|
153
|
+
- spec/dummy/Rakefile
|
154
|
+
- spec/dummy/public/422.html
|
155
|
+
- spec/dummy/public/500.html
|
156
|
+
- spec/dummy/public/favicon.ico
|
157
|
+
- spec/dummy/public/404.html
|