Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using json-body param to create idp saml, metadata param has to be in both command line and json-body #309

Open
askfongjojo opened this issue Aug 2, 2023 · 2 comments
Labels
customer For any bug reports or feature requests tied to customer requests

Comments

@askfongjojo
Copy link

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.

@ahl
Copy link
Collaborator

ahl commented Aug 3, 2023

Ugh. That's very annoying. I'll get to work on it.

@davepacheco
Copy link

I ran into similar behavior with oxide image create. I assume it's the same cause:

dap@ivanova ~ $ echo '{"source": { "type": "url", "url": "http://catacomb.eng.oxide.computer/media/cloud/debian-11-genericcloud-amd64.raw", "block_size": 512 } }' | oxide image create --name my-image --description my-description --os debian --version 11 --json-body /dev/stdin
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `description`", line: 1, column: 139)', cli/src/generated_cli.rs:5801:84
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(17), ...)', cli/src/main.rs:59:10

dap@ivanova ~ $ echo '{"description": "dummy", "source": { "type": "url", "url": "http://catacomb.eng.oxide.computer/media/cloud/debian-11-genericcloud-amd64.raw", "block_size": 512 } }' | oxide image create --name my-image --description my-description --os debian --version 11 --json-body /dev/stdin
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `name`", line: 1, column: 163)', cli/src/generated_cli.rs:5801:84
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(17), ...)', cli/src/main.rs:59:10

@twinfees twinfees added the customer For any bug reports or feature requests tied to customer requests label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer For any bug reports or feature requests tied to customer requests
Projects
None yet
Development

No branches or pull requests

4 participants