Skip to content

Commit 24efcc8

Browse files
committed
fix(providers): document metadata runtime requirements
Remove required_platform_adapter and its gateway OS checks because metadata availability belongs to the sandbox runtime. Reserve the retired protobuf field number and name, update the reviewed schema fingerprints, and remove the adapter-specific validation and tests. Document the Linux runtime requirement in the Google Cloud example, provider reference, and 0.2.0 upgrade guide. Explain that import and attachment do not verify runtime support. Align the CLI skill and E2E profile import setup with this behavior, including atomic batch import guidance. Validation: 140 provider tests, 182 server provider tests, 12 schema tests, 33 Python tests, and all TypeScript SDK checks passed. Focused Clippy, formatting, Markdown, and E2E provider setup checks passed. Fern validation reported 0 errors and 3 existing warnings. git diff --check passed and sdk/go still matches the branch merge base. Signed-off-by: Philippe Martin <phmartin@redhat.com>
1 parent 0d61fd5 commit 24efcc8

17 files changed

Lines changed: 70 additions & 238 deletions

File tree

‎crates/openshell-providers/README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ select compiled provider plugins.
1414
- Discover credentials and non-secret config from declared environment keys.
1515
- Apply bounded, literal non-secret environment defaults without overwriting
1616
existing values.
17-
- Validate credential collisions and named platform adapter requirements.
17+
- Validate credential collisions and environment declarations.
1818
- Use the shared authored-YAML compatibility boundary for profile imports and
1919
exports: reject duplicate keys and null objects without coercion, retain
2020
optional nulls, and preserve string types for YAML 1.1 readers.
@@ -38,7 +38,7 @@ Those are owned by the gateway and sandbox supervisor.
3838
| Credential discovery | `discovery.credentials` and credential `env_vars` |
3939
| Vertex config discovery | `discovery.config_env_vars` |
4040
| Workload resolution of non-secret values | Gateway key classification, independent of provider names |
41-
| Platform service dependency | `required_platform_adapter`; GCP metadata is available for non-Windows sandbox runtimes |
41+
| GCP metadata runtime requirement | Documented in the example profile header; the supervisor provides metadata for Linux sandboxes |
4242
| Vertex service account JSON credential | Removed from the example; configure gateway refresh material directly |
4343
| ID-selected provider plugins | Removed |
4444
| ID-selected CLI credential hints | Removed; setup guidance applies to the imported profile |
@@ -47,8 +47,9 @@ Those are owned by the gateway and sandbox supervisor.
4747
| GCP project and region config-key catalog | Removed; profile data supplies these declarations |
4848

4949
Credential refresh strategies remain explicitly declared in credential metadata.
50-
The supervisor provides the `gcp-metadata` adapter for Linux sandboxes; the
51-
Windows/MXC runtime does not provide it.
50+
The supervisor provides the GCP metadata service for Linux sandboxes; the
51+
Windows/MXC runtime does not provide it. Profile import and attachment do not
52+
validate runtime support.
5253

5354
## Security Notes
5455

‎crates/openshell-providers/src/discovery.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ mod tests {
107107
config_env_vars: Vec::new(),
108108
},
109109
environment: EnvironmentProfile::default(),
110-
required_platform_adapter: String::new(),
111110
source: String::new(),
112111
scope: String::new(),
113112
}

‎crates/openshell-providers/src/environment_tests.rs‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ environment:
2525
discovery:
2626
credentials: [token]
2727
config_env_vars: [CUSTOM_PROJECT]
28-
required_platform_adapter: gcp-metadata
2928
",
3029
)
3130
.unwrap()
@@ -120,14 +119,6 @@ fn renamed_google_examples_keep_environment_and_discovery_behavior() {
120119
renamed.environment.inject(&config, &mut renamed_env);
121120
assert!(!canonical_env.is_empty());
122121
assert_eq!(canonical_env, renamed_env);
123-
assert_eq!(
124-
canonical
125-
.ensure_platform_adapter_available()
126-
.map_err(|error| error.to_string()),
127-
renamed
128-
.ensure_platform_adapter_available()
129-
.map_err(|error| error.to_string()),
130-
);
131122
assert_eq!(
132123
discover_from_profile(&canonical, &context).unwrap(),
133124
discover_from_profile(&renamed, &context).unwrap()
@@ -246,37 +237,3 @@ fn lint_enforces_declaration_count_limits() {
246237
.any(|diagnostic| diagnostic.message == "at most 64 discovery config keys are allowed")
247238
);
248239
}
249-
250-
#[test]
251-
fn platform_adapter_availability_and_unknown_adapter_errors() {
252-
let mut profile = profile();
253-
let availability = profile.ensure_platform_adapter_available();
254-
if cfg!(windows) {
255-
assert!(
256-
availability
257-
.unwrap_err()
258-
.to_string()
259-
.contains("unavailable")
260-
);
261-
} else {
262-
assert!(availability.is_ok());
263-
}
264-
profile.required_platform_adapter = "unknown".repeat(10_000);
265-
let diagnostics = validate_profile_set(&[("custom.yaml".into(), profile.clone())]);
266-
assert!(
267-
diagnostics
268-
.iter()
269-
.any(|d| d.field == "required_platform_adapter")
270-
);
271-
assert!(diagnostics.iter().all(|d| d.message.len() < 256));
272-
assert!(
273-
profile
274-
.ensure_platform_adapter_available()
275-
.unwrap_err()
276-
.to_string()
277-
.len()
278-
< 128
279-
);
280-
profile.required_platform_adapter.clear();
281-
assert!(profile.ensure_platform_adapter_available().is_ok());
282-
}

‎crates/openshell-providers/src/lib.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ pub enum ProviderError {
4141
profile_id: String,
4242
credential_name: String,
4343
},
44-
#[error("required platform adapter 'gcp-metadata' is unavailable in this build")]
45-
UnavailableGcpMetadataAdapter,
46-
#[error("unknown required platform adapter")]
47-
UnknownPlatformAdapter,
4844
}
4945

5046
#[derive(Debug, Clone, Default, PartialEq, Eq)]

‎crates/openshell-providers/src/profiles.rs‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,6 @@ pub struct ProviderTypeProfile {
758758
#[serde(default, skip_serializing_if = "EnvironmentProfile::is_empty")]
759759
pub environment: EnvironmentProfile,
760760
#[serde(default, skip_serializing_if = "String::is_empty")]
761-
pub required_platform_adapter: String,
762-
#[serde(default, skip_serializing_if = "String::is_empty")]
763761
pub source: String,
764762
#[serde(default, skip_serializing_if = "String::is_empty")]
765763
pub scope: String,
@@ -845,18 +843,6 @@ fn valid_file_config_key(key: &str) -> bool {
845843
// narrower shape; direct gRPC imports and CLI YAML imports must preserve the
846844
// same policy intent through storage and JIT composition.
847845
impl ProviderTypeProfile {
848-
/// Check runtime capability separately from schema lint. The supervisor
849-
/// provides GCP metadata for non-Windows sandbox runtimes.
850-
pub fn ensure_platform_adapter_available(&self) -> Result<(), crate::ProviderError> {
851-
match self.required_platform_adapter.as_str() {
852-
"gcp-metadata" if cfg!(windows) => {
853-
Err(crate::ProviderError::UnavailableGcpMetadataAdapter)
854-
}
855-
"" | "gcp-metadata" => Ok(()),
856-
_ => Err(crate::ProviderError::UnknownPlatformAdapter),
857-
}
858-
}
859-
860846
#[must_use]
861847
pub fn from_proto(profile: &ProviderProfile) -> Self {
862848
Self {
@@ -913,7 +899,6 @@ impl ProviderTypeProfile {
913899
fixed: environment.fixed.clone(),
914900
},
915901
),
916-
required_platform_adapter: profile.required_platform_adapter.clone(),
917902
}
918903
}
919904

@@ -1092,7 +1077,6 @@ impl ProviderTypeProfile {
10921077
config: self.environment.config.clone(),
10931078
fixed: self.environment.fixed.clone(),
10941079
}),
1095-
required_platform_adapter: self.required_platform_adapter.clone(),
10961080
}
10971081
}
10981082

@@ -3258,15 +3242,6 @@ fn collect_environment_diagnostics(
32583242
message,
32593243
));
32603244
};
3261-
if !matches!(
3262-
profile.required_platform_adapter.as_str(),
3263-
"" | "gcp-metadata"
3264-
) {
3265-
error(
3266-
"required_platform_adapter",
3267-
"unknown platform adapter; the only recognized adapter is gcp-metadata",
3268-
);
3269-
}
32703245
let environment = &profile.environment;
32713246
if environment.config.len() + environment.fixed.len() > MAX_ENVIRONMENT_ENTRIES {
32723247
error("environment", "at most 64 environment defaults are allowed");
@@ -6588,7 +6563,6 @@ binaries:
65886563
inference_capable: false,
65896564
discovery: DiscoveryProfile::default(),
65906565
environment: EnvironmentProfile::default(),
6591-
required_platform_adapter: String::new(),
65926566
source: String::new(),
65936567
scope: String::new(),
65946568
},
@@ -6609,7 +6583,6 @@ binaries:
66096583
inference_capable: false,
66106584
discovery: DiscoveryProfile::default(),
66116585
environment: EnvironmentProfile::default(),
6612-
required_platform_adapter: String::new(),
66136586
source: String::new(),
66146587
scope: String::new(),
66156588
},
@@ -6630,7 +6603,6 @@ binaries:
66306603
inference_capable: false,
66316604
discovery: DiscoveryProfile::default(),
66326605
environment: EnvironmentProfile::default(),
6633-
required_platform_adapter: String::new(),
66346606
source: String::new(),
66356607
scope: String::new(),
66366608
},

0 commit comments

Comments
 (0)