homebrew-core/Formula/ory-hydra.rb

36 lines
959 B
Ruby
Raw Normal View History

class OryHydra < Formula
desc "OpenID Certified OAuth 2.0 Server and OpenID Connect Provider"
homepage "https://www.ory.sh/hydra/"
url "https://github.com/ory/hydra/archive/v1.5.2.tar.gz"
sha256 "50f7c09b1d6186ff35eed717c75f77884d038120f8096f5f0456526e49976a94"
license "Apache-2.0"
depends_on "go" => :build
conflicts_with "hydra", :because => "both install `hydra` binaries"
def install
ENV["GOBIN"] = bin
system "make", "install"
end
test do
admin_port = free_port
(testpath/"config.yaml").write <<~EOS
dsn: memory
serve:
public:
port: #{free_port}
admin:
port: #{admin_port}
EOS
fork { exec bin/"hydra", "serve", "all", "--config", "config.yaml" }
sleep 5
endpoint = "https://127.0.0.1:#{admin_port}/"
output = shell_output("#{bin}/hydra clients list --endpoint #{endpoint} --skip-tls-verify")
assert_match "| CLIENT ID |", output
end
end