fluent-plugin-filter-wms-auth 1.0.1

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
+ SHA1:
3
+ metadata.gz: 343b9b2dcd57a6b0cec18a5ea14ecaca2aed7ab2
4
+ data.tar.gz: 90ad7dab1f030059c55e79f6b80ac0f160006dc0
5
+ SHA512:
6
+ metadata.gz: df3ef5d5cb0928cfe4a3a08c6c4bb74950170d0e8f3668f3bd15a26e48e42bd6fd88a02fb28500bbf7c429f94c8a9c950249c41a57d03b7d340c33cab6458fe1
7
+ data.tar.gz: 91b94dae13061a6aaedf142434166480e38976f9ed1dc7286527a80cd5fc1c37310a3e698c392a7a1fe43084c014b56b21460e395f0ff849eca7bdae1054877d
@@ -0,0 +1,18 @@
1
+ require 'base64', 'fluent/plugin/filter'
2
+
3
+ class WmsAuth < Fluent::Plugin::Filter
4
+ Fluent::Plugin.register_filter('wms_auth', self)
5
+
6
+ def filter(tag, time, record)
7
+ path = record['path'.freeze]
8
+ if path.sub! /wmsAuthSign=([^&]+)/, ''.freeze
9
+ id,cookie,_ = Base64.decode64($1)[/id=([^&]+)/, 1].split('+'.freeze,3)
10
+ record['user_id'.freeze] = id unless id.empty?
11
+ record['cookie'.freeze] = cookie
12
+ end
13
+ if path.sub! /nimblesessionid=([^&]+)/, ''.freeze
14
+ record['nimble_session_id'.freeze] = $1
15
+ end
16
+ record
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fluent-plugin-filter-wms-auth
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - roma42427
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/fluent/plugin/filter_wms_auth.rb
20
+ homepage: https://github.com/roma42427/filter_wms_auth
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.11
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: fluent plugin to extract wms auth
44
+ test_files: []