secretspec 0.16.0-x86_64-linux → 0.17.0-x86_64-linux

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: 342614f94ce392512d32d2fc7beacce975deec8d27244057d3aea66925cb7fae
4
- data.tar.gz: 8b616ea574c2179205056266443d2abd677aab57def093dd6154fa3677e7235b
3
+ metadata.gz: 16f774260680b4aaf85a35802b7108b4328a307e8e7863853e4b828358586c14
4
+ data.tar.gz: 23f6f008f3cadce06dbd1ae8b6b72cb18df2a3dbb1958db5b163293917cf3feb
5
5
  SHA512:
6
- metadata.gz: 6dc3cb012db0d94d0cb2e87bf88177fd41a187b1236c81e7dc29e2f843f1d307f5e39ce64db8ab777d04454d064d061ecfd2539104d5ee3f9bf697cdcb237a62
7
- data.tar.gz: ca4cdf988d107d5b1cd78aec16cae43831c7870aaae3a70bd294821e78d02ccd913e0b601b353966ccc9060e0cd9f42142d640acd2e56e790f0ba0ea858694ca
6
+ metadata.gz: 2fd38176d59beb97550ff0f7ae5558ae92b33fcd4c369aee17f4354aaa2b6c6c4290862aa1a7c810581d36961484be3e93add67997027c37c0190b22603c57a1
7
+ data.tar.gz: 3fbcfdac431b62f45b79582e15de2cdef499b73bea61b70a38080f8ebbfea8271e6c8f4fe7b221d78163879809e524e62e46a5cd9670e9eef2e6455d93c7da1e
data/README.md CHANGED
@@ -24,6 +24,15 @@ resolved.set_as_env! # export everything into ENV
24
24
  A missing required secret raises `Secretspec::MissingRequiredError`; any other
25
25
  failure raises `Secretspec::Error` (with a stable `#kind`).
26
26
 
27
+ ## Scopes (0.17+)
28
+
29
+ Use `.with_scope("api")` to resolve only a named `[scopes.api]` subset. Both
30
+ `resolved.scope` and `report.scope` return the selected scope:
31
+
32
+ ```ruby
33
+ resolved = Secretspec::SecretSpec.builder.with_scope("api").load
34
+ ```
35
+
27
36
  ## Cleanup
28
37
 
29
38
  `as_path` secrets are materialized to temp files that outlive the call. Pass a
@@ -57,5 +57,9 @@ $INCFLAGS << " -I#{include_dir}"
57
57
  # for the referenced symbols) precedes the system libs it depends on.
58
58
  $LOCAL_LIBS << " #{staticlib}"
59
59
  $libs = "#{$libs} #{find_native_libs(vendor, repo_root)}"
60
+ # The Windows gem bundles MinGW import libraries next to the staticlib
61
+ # (libwindows.*.a / libwinapi_*.a ship inside cargo registry crates, so an
62
+ # installing machine has them nowhere else); let the linker search vendor/.
63
+ $LIBPATH << vendor if File.directory?(vendor)
60
64
 
61
65
  create_makefile("secretspec/secretspec_ext")
data/lib/secretspec.rb CHANGED
@@ -54,7 +54,7 @@ module Secretspec
54
54
  end
55
55
 
56
56
  # A successful resolution, mirroring the Rust Resolved wrapper.
57
- Resolved = Struct.new(:provider, :profile, :secrets, :missing_optional) do
57
+ Resolved = Struct.new(:provider, :profile, :secrets, :missing_optional, :scope) do
58
58
  # Export each resolved secret into ENV by its declared name. Secrets with no
59
59
  # usable value (e.g. under no_values) are skipped rather than deleted from
60
60
  # ENV (assigning nil would remove the variable).
@@ -97,7 +97,7 @@ module Secretspec
97
97
  # A value-free resolution snapshot. Unlike Resolved, a missing required secret
98
98
  # is a "missing_required" status here, not an error, so a report describes a
99
99
  # profile even when its secrets are not all available.
100
- Report = Struct.new(:provider, :profile, :secrets)
100
+ Report = Struct.new(:provider, :profile, :secrets, :scope)
101
101
 
102
102
  # The narrow C ABI, statically linked into the secretspec_ext extension. The
103
103
  # Native.c_resolve / c_abi_version C functions are defined in
@@ -145,6 +145,12 @@ module Secretspec
145
145
  self
146
146
  end
147
147
 
148
+ # Limit resolution to a named manifest scope (SecretSpec 0.17+).
149
+ def with_scope(scope)
150
+ @request["scope"] = scope if scope
151
+ self
152
+ end
153
+
148
154
  def with_reason(reason)
149
155
  @request["reason"] = reason if reason
150
156
  self
@@ -178,7 +184,7 @@ module Secretspec
178
184
 
179
185
  resolved = Resolved.new(
180
186
  response["provider"], response["profile"], secrets,
181
- response["missing_optional"] || []
187
+ response["missing_optional"] || [], response["scope"]
182
188
  )
183
189
  return resolved unless block_given?
184
190
 
@@ -202,7 +208,7 @@ module Secretspec
202
208
  s["source_provider"], s["default_applied"],
203
209
  s["generated"], s["as_path"])
204
210
  end
205
- Report.new(response["provider"], response["profile"], secrets)
211
+ Report.new(response["provider"], response["profile"], secrets, response["scope"])
206
212
  end
207
213
 
208
214
  private
Binary file
data/vendor/secretspec.h CHANGED
@@ -7,8 +7,10 @@
7
7
  *
8
8
  * Request JSON (all fields optional):
9
9
  * { "path": ".../secretspec.toml", "provider": "keyring://",
10
- * "profile": "production", "reason": "boot", "no_values": false,
11
- * "mode": "resolve" }
10
+ * "profile": "production", "scope": "api", "reason": "boot",
11
+ * "no_values": false, "mode": "resolve" }
12
+ *
13
+ * "scope" selects a named [scopes] subset of the active profile (0.17+).
12
14
  *
13
15
  * "mode" selects the response shape and defaults to "resolve":
14
16
  *
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secretspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Cachix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-18 00:00:00.000000000 Z
11
+ date: 2026-07-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Ruby bindings for SecretSpec: a native extension that statically links
14
14
  the secretspec-ffi C ABI.'