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

feat: allow using ory tunnel/proxy with project ID as well #311

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Benehiko
Copy link
Contributor

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
    security@ory.sh) 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

cmd/cloudx/proxy/proxy.go Outdated Show resolved Hide resolved
@Benehiko
Copy link
Contributor Author

Benehiko commented Jul 4, 2023

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.

cmd/cloudx/client/handler.go Show resolved Hide resolved
cmd/cloudx/proxy/cmd_proxy.go Show resolved Hide resolved
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@aeneasr
Copy link
Member

aeneasr commented Jul 5, 2023

@Benehiko
Copy link
Contributor Author

Benehiko commented Jul 5, 2023

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

@Benehiko
Copy link
Contributor Author

Benehiko commented Jul 5, 2023

I tried refreshing the snapshots locally with no change using make refresh.
I guess I need access to the project or something?

@Benehiko Benehiko force-pushed the feat-project-id-and-slug branch 4 times, most recently from 0dc5f71 to fe590fa Compare July 11, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants