als 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 787a3b0847476ec8c3600f8372bee9d0eab149fd9bb5991b8bc019bbc4236f93
4
+ data.tar.gz: 2872934dd2c500e0dc4479e0c9691df2c9125abf2def0866c39384a79e985280
5
+ SHA512:
6
+ metadata.gz: 117b42b18f39e68801412368157f3cc8e60f8f36ff2aac69093ae7cd1ab4a5d4cfa1db329cfca4df520d8efd96e63e5abaa9b2b62efe651bfa1eaf552b38ff39
7
+ data.tar.gz: ccd015271ef87bfb62b4af362f3e399674a7a264b8a3691e77fe58a7bd8cbac4ea7481a77399c3cfa4f8cef2cfa066a6209bc7f583ee1a9274c6267cafceeb87
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in als.gemspec
4
+ gemspec
@@ -0,0 +1,35 @@
1
+ # Als
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/als`. 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 'als'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install als
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. 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]/als.
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,27 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "als/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "als"
7
+ spec.version = Als::VERSION
8
+ spec.authors = ["Dhi Aurrahman"]
9
+ spec.email = ["dio@rockybars.com"]
10
+ spec.licenses = ['MIT']
11
+ spec.summary = "This is a POC of Envoy ALS Server"
12
+ spec.description = "This is a POC of Envoy ALS Server, only do inspect for each received message"
13
+ spec.homepage = "https://github.com/dio/ruby-als-server"
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = "https://github.com/dio/ruby-als-server"
17
+ spec.metadata["changelog_uri"] = "https://github.com/dio/ruby-als-server/CHANGELOG.md"
18
+
19
+ spec.files = `git ls-files`.split($/)
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+
24
+ spec.add_dependency "grpc", "~> 1.22"
25
+ spec.add_development_dependency "bundler", "~> 2.0"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "als"
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__)
@@ -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,4 @@
1
+ #!/usr/bin/env ruby
2
+ require "als/server"
3
+
4
+ Als::Server.start
@@ -0,0 +1,2 @@
1
+ module Als
2
+ end
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+ require 'rubygems'
5
+ require 'envoy/service/accesslog/v2/als_services_pb'
6
+
7
+ module Als
8
+ class Server
9
+ def self.start
10
+ port = ENV["PORT"] ? ENV["PORT"] : '0.0.0.0:3000'
11
+ s = GRPC::RpcServer.new
12
+ s.add_http2_port(port, :this_port_is_insecure)
13
+ s.handle(ServerImpl.new)
14
+ s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT'])
15
+ end
16
+ end
17
+
18
+ class ServerImpl < Envoy::Service::Accesslog::V2::AccessLogService::Service
19
+ def stream_access_logs(call)
20
+ call.each_remote_read do |entry|
21
+ puts entry.to_json
22
+ end
23
+ Envoy::Service::Accesslog::V2::StreamAccessLogsResponse.new
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Als
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,64 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/api/v2/core/address.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'envoy/api/v2/core/base_pb'
7
+ require 'google/protobuf/wrappers_pb'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("envoy/api/v2/core/address.proto", :syntax => :proto3) do
10
+ add_message "envoy.api.v2.core.Pipe" do
11
+ optional :path, :string, 1
12
+ end
13
+ add_message "envoy.api.v2.core.SocketAddress" do
14
+ optional :protocol, :enum, 1, "envoy.api.v2.core.SocketAddress.Protocol"
15
+ optional :address, :string, 2
16
+ optional :resolver_name, :string, 5
17
+ optional :ipv4_compat, :bool, 6
18
+ oneof :port_specifier do
19
+ optional :port_value, :uint32, 3
20
+ optional :named_port, :string, 4
21
+ end
22
+ end
23
+ add_enum "envoy.api.v2.core.SocketAddress.Protocol" do
24
+ value :TCP, 0
25
+ value :UDP, 1
26
+ end
27
+ add_message "envoy.api.v2.core.TcpKeepalive" do
28
+ optional :keepalive_probes, :message, 1, "google.protobuf.UInt32Value"
29
+ optional :keepalive_time, :message, 2, "google.protobuf.UInt32Value"
30
+ optional :keepalive_interval, :message, 3, "google.protobuf.UInt32Value"
31
+ end
32
+ add_message "envoy.api.v2.core.BindConfig" do
33
+ optional :source_address, :message, 1, "envoy.api.v2.core.SocketAddress"
34
+ optional :freebind, :message, 2, "google.protobuf.BoolValue"
35
+ repeated :socket_options, :message, 3, "envoy.api.v2.core.SocketOption"
36
+ end
37
+ add_message "envoy.api.v2.core.Address" do
38
+ oneof :address do
39
+ optional :socket_address, :message, 1, "envoy.api.v2.core.SocketAddress"
40
+ optional :pipe, :message, 2, "envoy.api.v2.core.Pipe"
41
+ end
42
+ end
43
+ add_message "envoy.api.v2.core.CidrRange" do
44
+ optional :address_prefix, :string, 1
45
+ optional :prefix_len, :message, 2, "google.protobuf.UInt32Value"
46
+ end
47
+ end
48
+ end
49
+
50
+ module Envoy
51
+ module Api
52
+ module V2
53
+ module Core
54
+ Pipe = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.Pipe").msgclass
55
+ SocketAddress = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.SocketAddress").msgclass
56
+ SocketAddress::Protocol = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.SocketAddress.Protocol").enummodule
57
+ TcpKeepalive = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.TcpKeepalive").msgclass
58
+ BindConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.BindConfig").msgclass
59
+ Address = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.Address").msgclass
60
+ CidrRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.CidrRange").msgclass
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,138 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/api/v2/core/base.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'envoy/api/v2/core/http_uri_pb'
7
+ require 'google/protobuf/any_pb'
8
+ require 'google/protobuf/struct_pb'
9
+ require 'google/protobuf/wrappers_pb'
10
+ require 'envoy/type/percent_pb'
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_file("envoy/api/v2/core/base.proto", :syntax => :proto3) do
13
+ add_message "envoy.api.v2.core.Locality" do
14
+ optional :region, :string, 1
15
+ optional :zone, :string, 2
16
+ optional :sub_zone, :string, 3
17
+ end
18
+ add_message "envoy.api.v2.core.Node" do
19
+ optional :id, :string, 1
20
+ optional :cluster, :string, 2
21
+ optional :metadata, :message, 3, "google.protobuf.Struct"
22
+ optional :locality, :message, 4, "envoy.api.v2.core.Locality"
23
+ optional :build_version, :string, 5
24
+ end
25
+ add_message "envoy.api.v2.core.Metadata" do
26
+ map :filter_metadata, :string, :message, 1, "google.protobuf.Struct"
27
+ end
28
+ add_message "envoy.api.v2.core.RuntimeUInt32" do
29
+ optional :default_value, :uint32, 2
30
+ optional :runtime_key, :string, 3
31
+ end
32
+ add_message "envoy.api.v2.core.HeaderValue" do
33
+ optional :key, :string, 1
34
+ optional :value, :string, 2
35
+ end
36
+ add_message "envoy.api.v2.core.HeaderValueOption" do
37
+ optional :header, :message, 1, "envoy.api.v2.core.HeaderValue"
38
+ optional :append, :message, 2, "google.protobuf.BoolValue"
39
+ end
40
+ add_message "envoy.api.v2.core.HeaderMap" do
41
+ repeated :headers, :message, 1, "envoy.api.v2.core.HeaderValue"
42
+ end
43
+ add_message "envoy.api.v2.core.DataSource" do
44
+ oneof :specifier do
45
+ optional :filename, :string, 1
46
+ optional :inline_bytes, :bytes, 2
47
+ optional :inline_string, :string, 3
48
+ end
49
+ end
50
+ add_message "envoy.api.v2.core.RemoteDataSource" do
51
+ optional :http_uri, :message, 1, "envoy.api.v2.core.HttpUri"
52
+ optional :sha256, :string, 2
53
+ end
54
+ add_message "envoy.api.v2.core.AsyncDataSource" do
55
+ oneof :specifier do
56
+ optional :local, :message, 1, "envoy.api.v2.core.DataSource"
57
+ optional :remote, :message, 2, "envoy.api.v2.core.RemoteDataSource"
58
+ end
59
+ end
60
+ add_message "envoy.api.v2.core.TransportSocket" do
61
+ optional :name, :string, 1
62
+ oneof :config_type do
63
+ optional :config, :message, 2, "google.protobuf.Struct"
64
+ optional :typed_config, :message, 3, "google.protobuf.Any"
65
+ end
66
+ end
67
+ add_message "envoy.api.v2.core.SocketOption" do
68
+ optional :description, :string, 1
69
+ optional :level, :int64, 2
70
+ optional :name, :int64, 3
71
+ optional :state, :enum, 6, "envoy.api.v2.core.SocketOption.SocketState"
72
+ oneof :value do
73
+ optional :int_value, :int64, 4
74
+ optional :buf_value, :bytes, 5
75
+ end
76
+ end
77
+ add_enum "envoy.api.v2.core.SocketOption.SocketState" do
78
+ value :STATE_PREBIND, 0
79
+ value :STATE_BOUND, 1
80
+ value :STATE_LISTENING, 2
81
+ end
82
+ add_message "envoy.api.v2.core.RuntimeFractionalPercent" do
83
+ optional :default_value, :message, 1, "envoy.type.FractionalPercent"
84
+ optional :runtime_key, :string, 2
85
+ end
86
+ add_message "envoy.api.v2.core.ControlPlane" do
87
+ optional :identifier, :string, 1
88
+ end
89
+ add_enum "envoy.api.v2.core.RoutingPriority" do
90
+ value :DEFAULT, 0
91
+ value :HIGH, 1
92
+ end
93
+ add_enum "envoy.api.v2.core.RequestMethod" do
94
+ value :METHOD_UNSPECIFIED, 0
95
+ value :GET, 1
96
+ value :HEAD, 2
97
+ value :POST, 3
98
+ value :PUT, 4
99
+ value :DELETE, 5
100
+ value :CONNECT, 6
101
+ value :OPTIONS, 7
102
+ value :TRACE, 8
103
+ value :PATCH, 9
104
+ end
105
+ add_enum "envoy.api.v2.core.TrafficDirection" do
106
+ value :UNSPECIFIED, 0
107
+ value :INBOUND, 1
108
+ value :OUTBOUND, 2
109
+ end
110
+ end
111
+ end
112
+
113
+ module Envoy
114
+ module Api
115
+ module V2
116
+ module Core
117
+ Locality = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.Locality").msgclass
118
+ Node = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.Node").msgclass
119
+ Metadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.Metadata").msgclass
120
+ RuntimeUInt32 = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.RuntimeUInt32").msgclass
121
+ HeaderValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.HeaderValue").msgclass
122
+ HeaderValueOption = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.HeaderValueOption").msgclass
123
+ HeaderMap = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.HeaderMap").msgclass
124
+ DataSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.DataSource").msgclass
125
+ RemoteDataSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.RemoteDataSource").msgclass
126
+ AsyncDataSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.AsyncDataSource").msgclass
127
+ TransportSocket = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.TransportSocket").msgclass
128
+ SocketOption = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.SocketOption").msgclass
129
+ SocketOption::SocketState = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.SocketOption.SocketState").enummodule
130
+ RuntimeFractionalPercent = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.RuntimeFractionalPercent").msgclass
131
+ ControlPlane = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.ControlPlane").msgclass
132
+ RoutingPriority = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.RoutingPriority").enummodule
133
+ RequestMethod = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.RequestMethod").enummodule
134
+ TrafficDirection = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.TrafficDirection").enummodule
135
+ end
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,27 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/api/v2/core/http_uri.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/protobuf/duration_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("envoy/api/v2/core/http_uri.proto", :syntax => :proto3) do
9
+ add_message "envoy.api.v2.core.HttpUri" do
10
+ optional :uri, :string, 1
11
+ optional :timeout, :message, 3, "google.protobuf.Duration"
12
+ oneof :http_upstream_type do
13
+ optional :cluster, :string, 2
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ module Envoy
20
+ module Api
21
+ module V2
22
+ module Core
23
+ HttpUri = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.api.v2.core.HttpUri").msgclass
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,147 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/data/accesslog/v2/accesslog.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'envoy/api/v2/core/address_pb'
7
+ require 'envoy/api/v2/core/base_pb'
8
+ require 'google/protobuf/duration_pb'
9
+ require 'google/protobuf/timestamp_pb'
10
+ require 'google/protobuf/wrappers_pb'
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_file("envoy/data/accesslog/v2/accesslog.proto", :syntax => :proto3) do
13
+ add_message "envoy.data.accesslog.v2.TCPAccessLogEntry" do
14
+ optional :common_properties, :message, 1, "envoy.data.accesslog.v2.AccessLogCommon"
15
+ end
16
+ add_message "envoy.data.accesslog.v2.HTTPAccessLogEntry" do
17
+ optional :common_properties, :message, 1, "envoy.data.accesslog.v2.AccessLogCommon"
18
+ optional :protocol_version, :enum, 2, "envoy.data.accesslog.v2.HTTPAccessLogEntry.HTTPVersion"
19
+ optional :request, :message, 3, "envoy.data.accesslog.v2.HTTPRequestProperties"
20
+ optional :response, :message, 4, "envoy.data.accesslog.v2.HTTPResponseProperties"
21
+ end
22
+ add_enum "envoy.data.accesslog.v2.HTTPAccessLogEntry.HTTPVersion" do
23
+ value :PROTOCOL_UNSPECIFIED, 0
24
+ value :HTTP10, 1
25
+ value :HTTP11, 2
26
+ value :HTTP2, 3
27
+ end
28
+ add_message "envoy.data.accesslog.v2.AccessLogCommon" do
29
+ optional :sample_rate, :double, 1
30
+ optional :downstream_remote_address, :message, 2, "envoy.api.v2.core.Address"
31
+ optional :downstream_local_address, :message, 3, "envoy.api.v2.core.Address"
32
+ optional :tls_properties, :message, 4, "envoy.data.accesslog.v2.TLSProperties"
33
+ optional :start_time, :message, 5, "google.protobuf.Timestamp"
34
+ optional :time_to_last_rx_byte, :message, 6, "google.protobuf.Duration"
35
+ optional :time_to_first_upstream_tx_byte, :message, 7, "google.protobuf.Duration"
36
+ optional :time_to_last_upstream_tx_byte, :message, 8, "google.protobuf.Duration"
37
+ optional :time_to_first_upstream_rx_byte, :message, 9, "google.protobuf.Duration"
38
+ optional :time_to_last_upstream_rx_byte, :message, 10, "google.protobuf.Duration"
39
+ optional :time_to_first_downstream_tx_byte, :message, 11, "google.protobuf.Duration"
40
+ optional :time_to_last_downstream_tx_byte, :message, 12, "google.protobuf.Duration"
41
+ optional :upstream_remote_address, :message, 13, "envoy.api.v2.core.Address"
42
+ optional :upstream_local_address, :message, 14, "envoy.api.v2.core.Address"
43
+ optional :upstream_cluster, :string, 15
44
+ optional :response_flags, :message, 16, "envoy.data.accesslog.v2.ResponseFlags"
45
+ optional :metadata, :message, 17, "envoy.api.v2.core.Metadata"
46
+ optional :upstream_transport_failure_reason, :string, 18
47
+ optional :route_name, :string, 19
48
+ end
49
+ add_message "envoy.data.accesslog.v2.ResponseFlags" do
50
+ optional :failed_local_healthcheck, :bool, 1
51
+ optional :no_healthy_upstream, :bool, 2
52
+ optional :upstream_request_timeout, :bool, 3
53
+ optional :local_reset, :bool, 4
54
+ optional :upstream_remote_reset, :bool, 5
55
+ optional :upstream_connection_failure, :bool, 6
56
+ optional :upstream_connection_termination, :bool, 7
57
+ optional :upstream_overflow, :bool, 8
58
+ optional :no_route_found, :bool, 9
59
+ optional :delay_injected, :bool, 10
60
+ optional :fault_injected, :bool, 11
61
+ optional :rate_limited, :bool, 12
62
+ optional :unauthorized_details, :message, 13, "envoy.data.accesslog.v2.ResponseFlags.Unauthorized"
63
+ optional :rate_limit_service_error, :bool, 14
64
+ optional :downstream_connection_termination, :bool, 15
65
+ optional :upstream_retry_limit_exceeded, :bool, 16
66
+ optional :stream_idle_timeout, :bool, 17
67
+ optional :invalid_envoy_request_headers, :bool, 18
68
+ end
69
+ add_message "envoy.data.accesslog.v2.ResponseFlags.Unauthorized" do
70
+ optional :reason, :enum, 1, "envoy.data.accesslog.v2.ResponseFlags.Unauthorized.Reason"
71
+ end
72
+ add_enum "envoy.data.accesslog.v2.ResponseFlags.Unauthorized.Reason" do
73
+ value :REASON_UNSPECIFIED, 0
74
+ value :EXTERNAL_SERVICE, 1
75
+ end
76
+ add_message "envoy.data.accesslog.v2.TLSProperties" do
77
+ optional :tls_version, :enum, 1, "envoy.data.accesslog.v2.TLSProperties.TLSVersion"
78
+ optional :tls_cipher_suite, :message, 2, "google.protobuf.UInt32Value"
79
+ optional :tls_sni_hostname, :string, 3
80
+ optional :local_certificate_properties, :message, 4, "envoy.data.accesslog.v2.TLSProperties.CertificateProperties"
81
+ optional :peer_certificate_properties, :message, 5, "envoy.data.accesslog.v2.TLSProperties.CertificateProperties"
82
+ optional :tls_session_id, :string, 6
83
+ end
84
+ add_message "envoy.data.accesslog.v2.TLSProperties.CertificateProperties" do
85
+ repeated :subject_alt_name, :message, 1, "envoy.data.accesslog.v2.TLSProperties.CertificateProperties.SubjectAltName"
86
+ optional :subject, :string, 2
87
+ end
88
+ add_message "envoy.data.accesslog.v2.TLSProperties.CertificateProperties.SubjectAltName" do
89
+ oneof :san do
90
+ optional :uri, :string, 1
91
+ optional :dns, :string, 2
92
+ end
93
+ end
94
+ add_enum "envoy.data.accesslog.v2.TLSProperties.TLSVersion" do
95
+ value :VERSION_UNSPECIFIED, 0
96
+ value :TLSv1, 1
97
+ value :TLSv1_1, 2
98
+ value :TLSv1_2, 3
99
+ value :TLSv1_3, 4
100
+ end
101
+ add_message "envoy.data.accesslog.v2.HTTPRequestProperties" do
102
+ optional :request_method, :enum, 1, "envoy.api.v2.core.RequestMethod"
103
+ optional :scheme, :string, 2
104
+ optional :authority, :string, 3
105
+ optional :port, :message, 4, "google.protobuf.UInt32Value"
106
+ optional :path, :string, 5
107
+ optional :user_agent, :string, 6
108
+ optional :referer, :string, 7
109
+ optional :forwarded_for, :string, 8
110
+ optional :request_id, :string, 9
111
+ optional :original_path, :string, 10
112
+ optional :request_headers_bytes, :uint64, 11
113
+ optional :request_body_bytes, :uint64, 12
114
+ map :request_headers, :string, :string, 13
115
+ end
116
+ add_message "envoy.data.accesslog.v2.HTTPResponseProperties" do
117
+ optional :response_code, :message, 1, "google.protobuf.UInt32Value"
118
+ optional :response_headers_bytes, :uint64, 2
119
+ optional :response_body_bytes, :uint64, 3
120
+ map :response_headers, :string, :string, 4
121
+ map :response_trailers, :string, :string, 5
122
+ optional :response_code_details, :string, 6
123
+ end
124
+ end
125
+ end
126
+
127
+ module Envoy
128
+ module Data
129
+ module Accesslog
130
+ module V2
131
+ TCPAccessLogEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.TCPAccessLogEntry").msgclass
132
+ HTTPAccessLogEntry = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.HTTPAccessLogEntry").msgclass
133
+ HTTPAccessLogEntry::HTTPVersion = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.HTTPAccessLogEntry.HTTPVersion").enummodule
134
+ AccessLogCommon = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.AccessLogCommon").msgclass
135
+ ResponseFlags = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.ResponseFlags").msgclass
136
+ ResponseFlags::Unauthorized = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.ResponseFlags.Unauthorized").msgclass
137
+ ResponseFlags::Unauthorized::Reason = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.ResponseFlags.Unauthorized.Reason").enummodule
138
+ TLSProperties = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.TLSProperties").msgclass
139
+ TLSProperties::CertificateProperties = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.TLSProperties.CertificateProperties").msgclass
140
+ TLSProperties::CertificateProperties::SubjectAltName = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.TLSProperties.CertificateProperties.SubjectAltName").msgclass
141
+ TLSProperties::TLSVersion = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.TLSProperties.TLSVersion").enummodule
142
+ HTTPRequestProperties = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.HTTPRequestProperties").msgclass
143
+ HTTPResponseProperties = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.data.accesslog.v2.HTTPResponseProperties").msgclass
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,44 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/service/accesslog/v2/als.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'envoy/api/v2/core/base_pb'
7
+ require 'envoy/data/accesslog/v2/accesslog_pb'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("envoy/service/accesslog/v2/als.proto", :syntax => :proto3) do
10
+ add_message "envoy.service.accesslog.v2.StreamAccessLogsResponse" do
11
+ end
12
+ add_message "envoy.service.accesslog.v2.StreamAccessLogsMessage" do
13
+ optional :identifier, :message, 1, "envoy.service.accesslog.v2.StreamAccessLogsMessage.Identifier"
14
+ oneof :log_entries do
15
+ optional :http_logs, :message, 2, "envoy.service.accesslog.v2.StreamAccessLogsMessage.HTTPAccessLogEntries"
16
+ optional :tcp_logs, :message, 3, "envoy.service.accesslog.v2.StreamAccessLogsMessage.TCPAccessLogEntries"
17
+ end
18
+ end
19
+ add_message "envoy.service.accesslog.v2.StreamAccessLogsMessage.Identifier" do
20
+ optional :node, :message, 1, "envoy.api.v2.core.Node"
21
+ optional :log_name, :string, 2
22
+ end
23
+ add_message "envoy.service.accesslog.v2.StreamAccessLogsMessage.HTTPAccessLogEntries" do
24
+ repeated :log_entry, :message, 1, "envoy.data.accesslog.v2.HTTPAccessLogEntry"
25
+ end
26
+ add_message "envoy.service.accesslog.v2.StreamAccessLogsMessage.TCPAccessLogEntries" do
27
+ repeated :log_entry, :message, 1, "envoy.data.accesslog.v2.TCPAccessLogEntry"
28
+ end
29
+ end
30
+ end
31
+
32
+ module Envoy
33
+ module Service
34
+ module Accesslog
35
+ module V2
36
+ StreamAccessLogsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.service.accesslog.v2.StreamAccessLogsResponse").msgclass
37
+ StreamAccessLogsMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.service.accesslog.v2.StreamAccessLogsMessage").msgclass
38
+ StreamAccessLogsMessage::Identifier = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.service.accesslog.v2.StreamAccessLogsMessage.Identifier").msgclass
39
+ StreamAccessLogsMessage::HTTPAccessLogEntries = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.service.accesslog.v2.StreamAccessLogsMessage.HTTPAccessLogEntries").msgclass
40
+ StreamAccessLogsMessage::TCPAccessLogEntries = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.service.accesslog.v2.StreamAccessLogsMessage.TCPAccessLogEntries").msgclass
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,37 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: envoy/service/accesslog/v2/als.proto for package 'envoy.service.accesslog.v2'
3
+
4
+ require 'grpc'
5
+ require 'envoy/service/accesslog/v2/als_pb'
6
+
7
+ module Envoy
8
+ module Service
9
+ module Accesslog
10
+ module V2
11
+ module AccessLogService
12
+ # [#protodoc-title: gRPC Access Log Service (ALS)]
13
+ #
14
+ # Service for streaming access logs from Envoy to an access log server.
15
+ class Service
16
+
17
+ include GRPC::GenericService
18
+
19
+ self.marshal_class_method = :encode
20
+ self.unmarshal_class_method = :decode
21
+ self.service_name = 'envoy.service.accesslog.v2.AccessLogService'
22
+
23
+ # Envoy will connect and send StreamAccessLogsMessage messages forever. It does not expect any
24
+ # response to be sent as nothing would be done in the case of failure. The server should
25
+ # disconnect if it expects Envoy to reconnect. In the future we may decide to add a different
26
+ # API for "critical" access logs in which Envoy will buffer access logs for some period of time
27
+ # until it gets an ACK so it could then retry. This API is designed for high throughput with the
28
+ # expectation that it might be lossy.
29
+ rpc :StreamAccessLogs, stream(StreamAccessLogsMessage), StreamAccessLogsResponse
30
+ end
31
+
32
+ Stub = Service.rpc_stub_class
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: envoy/type/percent.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("envoy/type/percent.proto", :syntax => :proto3) do
8
+ add_message "envoy.type.Percent" do
9
+ optional :value, :double, 1
10
+ end
11
+ add_message "envoy.type.FractionalPercent" do
12
+ optional :numerator, :uint32, 1
13
+ optional :denominator, :enum, 2, "envoy.type.FractionalPercent.DenominatorType"
14
+ end
15
+ add_enum "envoy.type.FractionalPercent.DenominatorType" do
16
+ value :HUNDRED, 0
17
+ value :TEN_THOUSAND, 1
18
+ value :MILLION, 2
19
+ end
20
+ end
21
+ end
22
+
23
+ module Envoy
24
+ module Type
25
+ Percent = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.Percent").msgclass
26
+ FractionalPercent = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.FractionalPercent").msgclass
27
+ FractionalPercent::DenominatorType = Google::Protobuf::DescriptorPool.generated_pool.lookup("envoy.type.FractionalPercent.DenominatorType").enummodule
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: als
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dhi Aurrahman
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: grpc
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.22'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.22'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: This is a POC of Envoy ALS Server, only do inspect for each received
56
+ message
57
+ email:
58
+ - dio@rockybars.com
59
+ executables:
60
+ - als-server
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - Gemfile
66
+ - README.md
67
+ - Rakefile
68
+ - als.gemspec
69
+ - bin/console
70
+ - bin/setup
71
+ - exe/als-server
72
+ - lib/als.rb
73
+ - lib/als/server.rb
74
+ - lib/als/version.rb
75
+ - lib/envoy/api/v2/core/address_pb.rb
76
+ - lib/envoy/api/v2/core/base_pb.rb
77
+ - lib/envoy/api/v2/core/http_uri_pb.rb
78
+ - lib/envoy/data/accesslog/v2/accesslog_pb.rb
79
+ - lib/envoy/service/accesslog/v2/als_pb.rb
80
+ - lib/envoy/service/accesslog/v2/als_services_pb.rb
81
+ - lib/envoy/type/percent_pb.rb
82
+ homepage: https://github.com/dio/ruby-als-server
83
+ licenses:
84
+ - MIT
85
+ metadata:
86
+ homepage_uri: https://github.com/dio/ruby-als-server
87
+ source_code_uri: https://github.com/dio/ruby-als-server
88
+ changelog_uri: https://github.com/dio/ruby-als-server/CHANGELOG.md
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.7.7
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: This is a POC of Envoy ALS Server
109
+ test_files: []