seekrit-sdk 0.4.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f230fc82fb27db0d54bfa68297258f0548223d055215a38f73c0e409c8bfa165
4
- data.tar.gz: 2f04d0d66d69fccdb7505e59e54dc6eee087f9c16663bbb575c80048991d07d9
3
+ metadata.gz: 94925c9efd5b2a421849a2d72da6018f5bb1d0a8fb49ad777f6858b71aaeb675
4
+ data.tar.gz: a02c6b4c8a8b6b948bab65275a1b7254b094089a763fa04e2172d83a6c79868b
5
5
  SHA512:
6
- metadata.gz: 3ee87b6ed2a34832fcc53b6b9bba22bdb3c1c46b743dfb145a3a93f294e391bb13a73ecb903342ea5033e53403e75db25d120ecd6cf16df1f6c841b527396348
7
- data.tar.gz: 8d8a7ce8d752735509690df6acac4fd9849c632072abf6d6e89661e81e46ae674e0dd93498a6f3c403f3e43cc7be91e0e36536c2b4914fae2c642aea9d3f77d2
6
+ metadata.gz: ac818da05068188ff375cd1df5c109e0a0ba7885db67f1716098d3593d61a917e4a099290811f7f833c05f7fe891071a0324142a10c119b6d370a1ce255e3559
7
+ data.tar.gz: 2d945562c9cda3ca8ff8b1e570171cf2083e08240449c69870498af9b5eff8648268f34d673ae2fc3901c8600920ad00c698f1b37f38481016cec3602cd1ed21
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # seekrit — Ruby SDK
2
2
 
3
- Read-path SDK for [seekrit](https://seekrit.dev). Authenticate with a service
3
+ Read-path SDK for [seekrit](https://seekrit.dev), a zero-knowledge secrets
4
+ manager and credential broker for AI agents. Authenticate with a service
4
5
  token, resolve your environment, and get **decrypted** secrets — the API only
5
6
  ever returns ciphertext; decryption happens in your process.
6
7
 
@@ -107,3 +108,12 @@ CLI, `seekrit run`, and every other seekrit client. See
107
108
  ## License
108
109
 
109
110
  MIT
111
+
112
+ ## Service token v2
113
+
114
+ Keep one `SEEKRIT_TOKEN`: `skt_<id>_v2.<auth-secret>.<private-key>`.
115
+ The client sends only `skt_<id>_v2.<auth-secret>` to the API and uses the private
116
+ key locally to decrypt. Legacy tokens are rejected before any API request;
117
+ upgrade clients and replace legacy tokens through the dashboard. A stolen
118
+ HTTP credential cannot decrypt environment payloads, but stealing the full
119
+ local bundle still exposes the private key. Treat the full bundle as a secret.
@@ -29,6 +29,7 @@ module Seekrit
29
29
  raise Error, "no service token: pass token: or set SEEKRIT_TOKEN" unless @token && !@token.empty?
30
30
 
31
31
  @key = Crypto::TokenKey.parse(@token) # fail fast on a bad token
32
+ @token = Crypto.service_token_auth(@token)
32
33
  @api_url = (api_url || ENV["SEEKRIT_API_URL"] || DEFAULT_API_URL).sub(%r{/+\z}, "")
33
34
  @with = with || {}
34
35
  @open_timeout = open_timeout
@@ -14,17 +14,24 @@ module Seekrit
14
14
  # 3. Decrypt each secret (Crypto.decrypt_secret).
15
15
  #
16
16
  # Blob formats (all segments base64url, no padding):
17
- # token skt_<id>_<pkcs8 private key>
17
+ # token skt_<id>_v2.<auth secret>.<pkcs8 private key>
18
18
  # wrapped DEK wd1.<ephemeral pub (raw SEC1)>.<hkdf salt>.<iv>.<ciphertext||tag>
19
19
  # secret sc1.<iv>.<ciphertext||tag>
20
20
  module Crypto
21
21
  HKDF_INFO = "seekrit/wrap-dek/v1"
22
22
  CURVE = "prime256v1" # NIST P-256 / secp256r1
23
23
  # Only the first two underscores are separators; the key segment may contain "_".
24
- TOKEN_RE = /\A(skt_[0-9A-Za-z]+)_([A-Za-z0-9_-]+)\z/.freeze
24
+ TOKEN_RE = /\A(skt_[0-9A-Za-z]+)_(?:v2\.[A-Za-z0-9_-]{43}\.)?([A-Za-z0-9_-]+)\z/.freeze
25
25
 
26
26
  module_function
27
27
 
28
+ def service_token_auth(token)
29
+ match = /\A(skt_[0-9A-Za-z]+_v2\.[A-Za-z0-9_-]{43})(?:\.[A-Za-z0-9_-]+)?\z/.match(token)
30
+ raise CryptoError, "a v2 service token is required for API access; replace legacy tokens in the dashboard" unless match
31
+
32
+ match[1]
33
+ end
34
+
28
35
  def b64url_decode(text)
29
36
  Base64.urlsafe_decode64(text + ("=" * ((4 - (text.length % 4)) % 4)))
30
37
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seekrit
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -1,5 +1,6 @@
1
1
  {
2
- "token": "skt_6EYgmoh8LuiPPAbM0SaVtc_MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgra6e_i8D2dIWlz-43EVbrHz-g698-kxY22MCp95L7VGhRANCAATA4nkyQKLq4hD5YvzXLtNtKAK_g-H4LF260zk0bInSWMbDfx0vTTtOg0tRWoDYWbuIN0vb1YMZ5z13xH5aBsDx",
2
+ "token": "skt_6EYgmoh8LuiPPAbM0SaVtc_v2.bh8OFkiEBdTJM4MBX75AMCPsR2Arp1i32sg8Ej0Vw7o.MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgra6e_i8D2dIWlz-43EVbrHz-g698-kxY22MCp95L7VGhRANCAATA4nkyQKLq4hD5YvzXLtNtKAK_g-H4LF260zk0bInSWMbDfx0vTTtOg0tRWoDYWbuIN0vb1YMZ5z13xH5aBsDx",
3
+ "authToken": "skt_6EYgmoh8LuiPPAbM0SaVtc_v2.bh8OFkiEBdTJM4MBX75AMCPsR2Arp1i32sg8Ej0Vw7o",
3
4
  "tokenId": "skt_6EYgmoh8LuiPPAbM0SaVtc",
4
5
  "publicKeyJwk": "{\"key_ops\":[],\"ext\":true,\"kty\":\"EC\",\"x\":\"wOJ5MkCi6uIQ-WL81y7TbSgCv4Ph-CxdutM5NGyJ0lg\",\"y\":\"xsN_HS9NO06DS1FagNhZu4g3S9vVgxnnPXfEfloGwPE\",\"crv\":\"P-256\"}",
5
6
  "resolve": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seekrit-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - seekrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-20 00:00:00.000000000 Z
11
+ date: 2026-11-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Read-path SDK for seekrit, the zero-knowledge secrets manager. Authenticate
@@ -38,8 +38,9 @@ licenses:
38
38
  - MIT
39
39
  metadata:
40
40
  homepage_uri: https://seekrit.dev
41
- documentation_uri: https://seekrit.dev/docs
41
+ documentation_uri: https://seekrit.dev/docs/guides/sdks
42
42
  source_code_uri: https://github.com/seekritdev/ruby-sdk
43
+ bug_tracker_uri: https://github.com/seekritdev/ruby-sdk/issues
43
44
  rubygems_mfa_required: 'true'
44
45
  post_install_message:
45
46
  rdoc_options: []