CLI add supports for non-http scheme#5043
Conversation
flyrain
left a comment
There was a problem hiding this comment.
LGTM. Thanks @MonkeyCanCode for the fix. I think we will need to update the doc to reflect the new option. I'm OK with a followup.
| current_client_secret = profiles[name].get("client_secret") | ||
| current_host = profiles[name].get("host") | ||
| current_port = profiles[name].get("port") | ||
| current_scheme = profiles[name].get(Arguments.SCHEME) or DEFAULT_SCHEME |
There was a problem hiding this comment.
Good backward-compat handling here! .get(SCHEME) or DEFAULT_SCHEME means profiles created before this change update cleanly to http. Same pattern in base_url.
Good point. Yes, let me update the PR for fixing changlog then I will sync and update this one. |
This is now completed along with updated CHANGEME.md. |
flyingImer
left a comment
There was a problem hiding this comment.
One gap worth closing: --scheme on the CLI flag is validated against choices=["http","https"], but profiles create/update take it through a raw input() prompt with no validation, so a typo there gets baked straight into base_url unchecked.
2 cents: run the prompt value through the same allowlist.
Thanks for the feedback. This had been handled now. |
This PR fixes #4993 where we default to
httpfor scheme when creating profile. Also, the CLI itself lacks scheme support unless usingbase_url(so this was not possible earlier when using--hostand--portoption.Here is sample output for this change:
Add profiles with http and https scheme:
Ensure scheme got persisted:
Validation to ensure scheme got honored during api requests:
Ensure change is backward compatible:
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)