omniauth-remote-user 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-remote-user/version.rb +1 -1
- data/omniauth-remote-user.gemspec +2 -2
- metadata +2 -6
- data/.gitignore +0 -10
- data/.rspec +0 -1
- data/references/teste.rb +0 -29
- data/test_notes.txt +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd824137a8e9bd71876e088ceb577e95d243283
|
4
|
+
data.tar.gz: 3a8b8245e16cbbe26e6dae68ba7fb518253b17af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 931785e9e77573544b3612e42d9f77617568f6bd393c585f694f7c2d1bb14cc131e5d79811af4759d6abe34e7a65c1d80c2898e7de97e2ca3498a70d8769b682
|
7
|
+
data.tar.gz: b020d9030e2225464e81488dd7f62b6080d9caec84a71237e9ed0176c66f8758229c95176e7554ff6f6843bb7d6e75265cb46714c27106fd819c0922ea718b7e
|
@@ -10,8 +10,8 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.homepage = 'http://beta.softwarepublico.gov.br/gitlab/softwarepublico/omniauth-remote-user'
|
11
11
|
gem.authors = ['Lucas Kanashiro', 'Thiago Ribeiro', 'Rodrigo Siqueira','Macartur Sousa', 'Antonio Terceiro']
|
12
12
|
gem.require_paths = %w(lib)
|
13
|
-
gem.files =
|
14
|
-
|
13
|
+
gem.files = %w{Rakefile LICENSE.md README.md config.ru Gemfile} + Dir.glob("*.gemspec") +
|
14
|
+
Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
|
15
15
|
gem.license = "Expat"
|
16
16
|
gem.required_rubygems_version = '>= 1.3.5'
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-remote-user
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Kanashiro
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-03-
|
15
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: omniauth
|
@@ -39,8 +39,6 @@ executables: []
|
|
39
39
|
extensions: []
|
40
40
|
extra_rdoc_files: []
|
41
41
|
files:
|
42
|
-
- ".gitignore"
|
43
|
-
- ".rspec"
|
44
42
|
- Gemfile
|
45
43
|
- LICENSE.md
|
46
44
|
- README.md
|
@@ -51,10 +49,8 @@ files:
|
|
51
49
|
- lib/omniauth/remote-user.rb
|
52
50
|
- lib/omniauth/strategies/remote_user.rb
|
53
51
|
- omniauth-remote-user.gemspec
|
54
|
-
- references/teste.rb
|
55
52
|
- spec/omniauth/strategies/remote_user_spec.rb
|
56
53
|
- spec/spec_helper.rb
|
57
|
-
- test_notes.txt
|
58
54
|
homepage: http://beta.softwarepublico.gov.br/gitlab/softwarepublico/omniauth-remote-user
|
59
55
|
licenses:
|
60
56
|
- Expat
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
-c
|
data/references/teste.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# references: http://ruby-doc.org/stdlib-2.1.1/libdoc/net/http/rdoc/Net/HTTPHeader.html#method-i-add_field
|
2
|
-
# import the netHTTP
|
3
|
-
require 'net/http'
|
4
|
-
|
5
|
-
# uri get the url http headers
|
6
|
-
uri = URI('http://google.com')
|
7
|
-
|
8
|
-
# new request and result the http_readers
|
9
|
-
http_request = Net::HTTP::Get.new(uri)
|
10
|
-
|
11
|
-
# o metodo each_header retorna um map com o nome do header e o conteudo
|
12
|
-
http_request.each_header { |header,value| puts header + " " + value }
|
13
|
-
#http_request.set_form_data({"REMOTE_USER" => "siqueira"})
|
14
|
-
#http_request.set_form_data({"q" => "ruby", "lang" => "en"}, ';')
|
15
|
-
|
16
|
-
### add_field adicona um campo novo ou seja um novo HTTP_HEADER no nosso caso o REMOTE_USER
|
17
|
-
http_request.add_field 'REMOTE_USER', 'siqueira'
|
18
|
-
|
19
|
-
# Com o get_field podemos pegar o conteudo do header REMOTE_USER
|
20
|
-
puts http_request.get_fields('REMOTE_USER')
|
21
|
-
|
22
|
-
# => accept-encoding
|
23
|
-
# => accept
|
24
|
-
# => user-agent
|
25
|
-
# => host
|
26
|
-
|
27
|
-
http_response = Net::HTTP.start(uri.hostname, uri.port) do |http|
|
28
|
-
http.request(http_request)
|
29
|
-
end
|
data/test_notes.txt
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
Configurando apache para setar header Remote-User:
|
2
|
-
|
3
|
-
1 - Instalar apache2
|
4
|
-
2 - Criar arquivo de configuração (ex: proxy.conf) em /etc/apache2/sites-available
|
5
|
-
|
6
|
-
<VirtualHost *:80>
|
7
|
-
|
8
|
-
ProxyPass / http://localhost:9292/
|
9
|
-
|
10
|
-
RequestHeader set Remote-User "terceiro"
|
11
|
-
|
12
|
-
ErrorLog ${APACHE_LOG_DIR}/error.log
|
13
|
-
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
14
|
-
|
15
|
-
</VirtualHost>
|
16
|
-
|
17
|
-
3 - Habilitar site criado (a2ensite <conf>)
|
18
|
-
4 - Habilitar módulos (proxy, proxy-http, headers) utilizando o comando a2enmod
|
19
|
-
5 - Startar apache2 (service apache2 start)
|
20
|
-
|
21
|
-
Referência:
|
22
|
-
http://stackoverflow.com/questions/567814/apache2-reverse-proxy-to-an-end-point-that-requires-basicauth-but-want-to-hide-t
|
23
|
-
|
24
|
-
Executando aplicação sinatra:
|
25
|
-
|
26
|
-
1 - Entrar no diretório que contem o arquivo conf.ru
|
27
|
-
2 - Executar aplicação (rackup)
|