oxidecomputer / oxidecomputer/oxide.rs
When using json-body param to create idp saml, metadata param has to be in both command line and json-body
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 75
- Forks
- 21
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
With #162, when attempting to pass the full request body, including idp metadata, via --json-body, it complains that --metadata-url|--metadata-value is missing.
If I exclude the idp metadata block within the json file, i.e. removing
"idp_metadata_source": {
"type": "base64_encoded_xml",
"data": "..."
},
and try oxide silo idp saml create --silo test --json-body idp.json --metadata-value $IDP_METADATA, it also doesn't like it:
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unknown variant ``, expected `url` or `base64_encoded_xml`", line: 7, column: 15)', cli/src/generated_cli.rs:7683:86
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(9), ...)', cli/src/main.rs:59:10
To use json-body (which is required when specifying a signing key pair), the only way to make it work is to include in the json the idp metadata (type populated, data as an empty string) AND supply the actual base64-encoded xml or url via --metadata-value|--metadata-url in the command line.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the oxide silo idp saml create command and the panic locations in cli/src/generated_cli.rs and cli/src/main.rs. Reproduce the two --json-body metadata cases using the issue's idp.json examples, then verify that metadata is accepted consistently without requiring duplicate parameters or causing a panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100