hydra
hydra copied to clipboard
Can't import admin package in Golang project
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] This issue affects my Ory Cloud project.
- [X] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Describe the bug
Hi,
I'm following an online tutorial on how to implement Ory/Hydra over Golang project.
Right now, I want NewGetLoginRequestParams method from the following package
https://pkg.go.dev/github.com/ory/hydra-client-go/client/admin
but github.com/ory/hydra-client-go/client/admin returns 404.
I need to access the admin API to accept the login request but it is marked as "internal" inside Hydra package and I can't access it. How am I supposed to accept a login challenge? Am I wrong about anything?
Thanks in advance, Oreste
Reproducing the bug
Set up a Golang project with Ory/Hydra and try to accept a login request importing github.com/ory/hydra-client-go/client/admin (404) or github.com/ory/hydra/tree/master/internal/httpclient/client (internal)
Relevant log output
go get github.com/ory/hydra-client-go/client/admin
go: module github.com/ory/hydra-client-go@upgrade found (v1.11.8), but does not contain package github.com/ory/hydra-client-go/client/admin
Relevant configuration
No response
Version
1.11.10
On which operating system are you observing this issue?
Windows
In which environment are you deploying?
Binary
Additional Context
No response
What tutorial are you using? It seems to be outdated
What tutorial are you using? It seems to be outdated
Hi aeneasr, I've used the following link. I'm getting into Hydra but I'm still having some troubles with it (my bad for sure ;) ). Would you please link me a valid admin package for Golang (if any exists)?
Thanks, Oreste
I would like to know, is the openapi client the only way to access the admin interface from the go client? I haven't found any other way (except for calling the endpoint directly). The admin interface has been moved to the internal directory, and it's not anymore accessible from the go client.
Thanks, that tutorial is not written by us. We try to keep our content up to date always. You can still use the older version of the SDK if you want to just get it working, but starting with Ory Hydra 2.0 the old SDK is deprecated!
Sorry @aeneasr, I haven't understood. Which is the right way to call hydra admin from hydra-client-go? Openapi client? Thanks