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

Ruby client is not compatible with current version of Keto #243

Open
6 tasks done
EvanDaley opened this issue Jan 5, 2023 · 6 comments
Open
6 tasks done

Ruby client is not compatible with current version of Keto #243

EvanDaley opened this issue Jan 5, 2023 · 6 comments
Labels
bug Something is not working.

Comments

@EvanDaley
Copy link

EvanDaley commented Jan 5, 2023

Preflight checklist

Describe the bug

The permission_api.rb file has the wrong paths.

image

In this example local_var_path should have the value 'check' not '/relation-tuples/check/openapi'

The expand_permissions_with_http_info method should have local_var_path = '/expand'.

Reproducing the bug

In order to point the ruby client at your local docker container, you also have to override the server_settings method in configuration.rb. Ideally this should be driven with an env variable.

    def server_settings
      [
        {
          # url: "https://{project}.projects.oryapis.com", <- This should be an env var or configurable thru the configure() method
          url: "http://localhost:4466",
          description: "No description provided",
          variables: {
            project: {
                description: "Project slug as provided by the Ory Console.",
                default_value: "playground",
              }
            }
        }
      ]
    end

Relevant log output

No response

Relevant configuration

No response

Version

Latest for both the client and keto docker image

On which operating system are you observing this issue?

Mac

In which environment are you deploying?

None

Additional Context

I'm happy to PR a fix for this. I would just need some guidance on your preferred process. Thanks 🙏

@EvanDaley EvanDaley added the bug Something is not working. label Jan 5, 2023
@EvanDaley
Copy link
Author

EvanDaley commented Jan 5, 2023

Actually, after digging into it a bit more, it looks like the issue was because I was using the quickstart tutorial keto image and not the latest (oryd/keto:v0.7.0-alpha.1-sqlite vs v0.10.0-alpha.0).

  • The concern about setting configuration server_settings still applies.
  • We should consider updating the quickstart tutorial since the image it uses is no longer compatible with this ruby gem.

@aeneasr
Copy link
Member

aeneasr commented Jan 5, 2023

Hey Evan, thank you for giving Ory a try and sorry to see that you're having trouble. You've created numerous issues in several repositories in a short time - would it be possible to summarize your findings in this issue please? I will close the other issues, because it's hard to keep track of everything

@EvanDaley
Copy link
Author

Hey @aeneasr , thanks for the quick response. Sorry for the noise!

Yeah, I was using the version of the keto docker image from the quickstart tutorial (0.7.0), and that wasn't playing nice with the ruby gem. I thought that the gem was the problem, but it turned out to just be the mismatch between docker and gem vresions. The container older container calls the route check but the gem looks for /relation-tuples/check. Turns out /relation-tuples/check IS correct, and I just needed to use the newer docker container (0.10.0).

To avoid confusion, we may want to update the quickstart tutorial for keto.

The other big point of confusion is that there is no way to configure the host / base URL for the ruby gem. It pulls the server info from this method that has a hardcoded reference to the ory hosted infra.

image

Ideally, we would do something like this to allow it to point to local docker containers or other domains.

image

Wdyt?

@EvanDaley
Copy link
Author

EvanDaley commented Jan 6, 2023

How is the ruby client built? Are we able to change one line like that? Is the gem auto-generated by some OpenAPI library?

@jonas-jonas
Copy link
Member

How is the ruby client built?

To answer this question, all language SDKs are generated from our Open API schemas (which are generated from the source code) and committed/published as is. We don't have a process in place for changing parts of the SDK (yet) individually.

@seuros
Copy link

seuros commented Sep 24, 2023

OryClient.configure do |config|  
config.server_index = nil
end 

should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

4 participants