feat: allow using ory tunnel/proxy with project ID as well
Related Issue or Design Document
In the documentation we indicate that a user can spin up the tunnel/proxy using the project ID or the project slug.
The project ID is not currently supported and will show the user an error
{"error":{"code":404,"status":"Not Found","request":"cf6a5564-bca9-95a8-8ec6-c04e8f2e16f1","reason":"The requested host is not associated with any Ory Cloud Project. Are you sure the URL is correct?","message":"The requested resource could not be found"}}
The tunnel/proxy only takes the --project flag and does string manipulation to add the project slug into the ory api string.
https://www.ory.sh/docs/getting-started/local-development#local-development
Checklist
- [ ] I have read the contributing guidelines and signed the CLA.
- [ ] I have referenced an issue containing the design document if my change introduces a new feature.
- [ ] I have read the security policy.
- [ ] I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security vulnerability, I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added the necessary documentation within the code base (if appropriate).
Further comments
I had to do a small refactor of naming to get access to some of the proxy configs from a different package proxy_test.
I also added an interface to the CommandHelper to be able to mock it out since it was used to fetch the project on the given ID.
https://github.com/ory/cli/actions/runs/5455623971/jobs/9927330763?pr=311 tests fail with compile error
https://github.com/ory/cli/actions/runs/5455623971/jobs/9927330763?pr=311 tests fail with compile error
seems to be golangci-lint complaining about something. will update
I tried refreshing the snapshots locally with no change using make refresh.
I guess I need access to the project or something?