hydra icon indicating copy to clipboard operation
hydra copied to clipboard

CLI `clients create` command is missing flag to set Metadata

Open rikkuness opened this issue 2 years ago • 2 comments

Preflight checklist

Describe the bug

When creating clients from the CLI, it's not currently possible to set the OAuth2Client.Metadata property.

Reproducing the bug

  1. Run hydra clients create --help and check the flags.

Relevant log output

No response

Relevant configuration

No response

Version

Latest

On which operating system are you observing this issue?

No response

In which environment are you deploying?

Binary

Additional Context

I earlier submitted https://github.com/ory/x/pull/497 which will allow setting OAuth2Client.Metadata to a map[string]string value, which works well for my use case. However looking at the API reference it seems that metadata is a JSONRawMessage or interface{}, so should the CLI permit setting OAuth2Client.Metadata to be arbitrary JSON as a string input, or does a map[string]string suffice for most CLI use cases?

If map[string]string is sufficient I'll submit a PR to add that. Thanks.

rikkuness avatar Apr 26 '22 17:04 rikkuness

Thank you for the report! The metadata object is indeed a raw JSON string, and the CLI should be able to support it. It could be as easy as --metadata '{"my":"json"}'. WDYT?

aeneasr avatar Apr 26 '22 17:04 aeneasr

Sounds good, I've opened a PR :)

rikkuness avatar Apr 26 '22 18:04 rikkuness