hydra: Go SDK is not "go get"-able

Describe the bug

When implementing a Hydra login/consent provider, I’d love to have a small Hydra Go SDK that’s go get-able in a simple way without having to depend on the entire Hydra project and all its dependencies.

From what I can tell from the docs, I’m supposed to be able to run go get -u -d github.com/ory/hydra/sdk/go/.... This gives the following error message:

% go get -u -d github.com/ory/hydra/sdk/go/...
go: github.com/go-resty/resty@v1.12.0: parsing go.mod: unexpected module path "gopkg.in/resty.v1"
go: error loading module requirements

I see something similar has been reported before in #1388, and it was resolved with a commit to some docs implying the go get command I ran above.

To Reproduce

  1. Start a new Go project using Go modules (outside of $GOPATH) by running go mod init github.com/myuser/myproject
  2. Install the Hydra Go SDK by running go get -u -d github.com/ory/hydra/sdk/go/...
  3. Observe an error message trying to resolve a Hydra Go SDK dependency.

Expected behavior

I was hoping to get a minimal dependency on the Swagger-generated Go-SDK in sdk/go/hydra/. Right now I’m workarounding it by just pulling in the entire Hydra project (go get github.com/ory/hydra) but this pulls in a huge host of dependencies that are not in use by the Go SDK.

Version:

  • Environment: Locally using Go 1.12.4 (darwin/amd64)
  • Version 1.0.0-rc.11

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 53 (27 by maintainers)

Commits related to this issue

Most upvoted comments

I will try to update the docs soon to make this process less painful!

I hate go modules… Thank you for the detailed report, I will try to get to the bottom of this.