tkngate 1.0.0
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 +7 -0
- data/lib/tkngate/faraday_middleware.rb +30 -0
- data/lib/tkngate.rb +8 -0
- metadata +70 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b17a3caea617e1b849d28b3e00a50a788a8c0b0f5687cca92dfd6a962afad286
|
|
4
|
+
data.tar.gz: 66b0b6ee3da4f7d0a7ad3c80fa992d20267bc7c0ce891cb900c3acfa9287160e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f6f358344de8d96f0939b9263179ffcd2bb32eb7f9dcec9c2096a1a3d3ae945340d0174290b6adbf4782e9a3a90552f14dcaa2c4591f5291c1998e925ec1ae30
|
|
7
|
+
data.tar.gz: 77d40fbfb62baf855086de657faf4683baf1267bcb4c6e2c28984c4fb31f2488e0420b4ccc1ddab2588e0b568f5642edb867f14589593355d1d3c929b66fc6b1
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'faraday'
|
|
2
|
+
|
|
3
|
+
module Tkngate
|
|
4
|
+
class FaradayMiddleware < Faraday::Middleware
|
|
5
|
+
def initialize(app, options = {})
|
|
6
|
+
super(app)
|
|
7
|
+
@virtual_key = options[:virtual_key] || ENV['TKNGATE_VIRTUAL_KEY']
|
|
8
|
+
@provider = options[:provider]
|
|
9
|
+
@session_id = options[:session_id]
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def call(env)
|
|
13
|
+
if @virtual_key && !@virtual_key.empty?
|
|
14
|
+
env[:request_headers]['Authorization'] = "Bearer #{@virtual_key}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
if @provider && !@provider.empty?
|
|
18
|
+
env[:request_headers]['X-Tkngate-Provider'] = @provider
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
if @session_id && !@session_id.empty?
|
|
22
|
+
env[:request_headers]['X-Tkngate-Session-ID'] = @session_id
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
@app.call(env)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Faraday::Request.register_middleware tkngate: -> { Tkngate::FaradayMiddleware }
|
data/lib/tkngate.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tkngate
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Tkngate
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-07-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: faraday
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.0'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '3.0'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '1.0'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '3.0'
|
|
33
|
+
description: Official Ruby middleware SDK for Tkngate. This acts as a transparent
|
|
34
|
+
interceptor that automatically routes your Faraday traffic through the sidecar and
|
|
35
|
+
injects the necessary security credentials.
|
|
36
|
+
email:
|
|
37
|
+
- hello@tkngate.com
|
|
38
|
+
executables: []
|
|
39
|
+
extensions: []
|
|
40
|
+
extra_rdoc_files: []
|
|
41
|
+
files:
|
|
42
|
+
- lib/tkngate.rb
|
|
43
|
+
- lib/tkngate/faraday_middleware.rb
|
|
44
|
+
homepage: https://github.com/tkngate/tkngate
|
|
45
|
+
licenses:
|
|
46
|
+
- Apache-2.0
|
|
47
|
+
metadata:
|
|
48
|
+
homepage_uri: https://github.com/tkngate/tkngate
|
|
49
|
+
source_code_uri: https://github.com/tkngate/tkngate/tree/main/sdks/ruby
|
|
50
|
+
changelog_uri: https://github.com/tkngate/tkngate/blob/main/CHANGELOG.md
|
|
51
|
+
post_install_message:
|
|
52
|
+
rdoc_options: []
|
|
53
|
+
require_paths:
|
|
54
|
+
- lib
|
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: 2.6.0
|
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
|
+
requirements:
|
|
62
|
+
- - ">="
|
|
63
|
+
- !ruby/object:Gem::Version
|
|
64
|
+
version: '0'
|
|
65
|
+
requirements: []
|
|
66
|
+
rubygems_version: 3.4.19
|
|
67
|
+
signing_key:
|
|
68
|
+
specification_version: 4
|
|
69
|
+
summary: Zero-trust P2P gateway for LLM agents
|
|
70
|
+
test_files: []
|