Skip to content

Commit

Permalink
all: update swagger definitions and fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored and arekkas committed Oct 5, 2017
1 parent b5109f8 commit 92fe6bb
Show file tree
Hide file tree
Showing 24 changed files with 1,989 additions and 287 deletions.
2 changes: 1 addition & 1 deletion cmd/cli/handler_jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (h *JWKHandler) CreateKeys(cmd *cobra.Command, args []string) {
}

alg, _ := cmd.Flags().GetString("alg")
keys, response, err := m.CreateJsonWebKeySet(args[0], hydra.CreateJsonWebKeySetPayload{Alg: alg, Kid: kid})
keys, response, err := m.CreateJsonWebKeySet(args[0], hydra.JsonWebKeySetGeneratorRequest{Alg: alg, Kid: kid})
checkResponse(response, err, http.StatusCreated)
fmt.Printf("%s\n", formatResponse(keys))
}
Expand Down
11 changes: 10 additions & 1 deletion cmd/cli/handler_recovation.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"net/http"

"crypto/tls"

"github.com/ory/hydra/config"
hydra "github.com/ory/hydra/sdk/go/hydra/swagger"
"github.com/spf13/cobra"
Expand All @@ -24,7 +26,14 @@ func (h *RevocationHandler) RevokeToken(cmd *cobra.Command, args []string) {
}

handler := hydra.NewOAuth2ApiWithBasePath(h.Config.ClusterURL)
handler.Configuration.Transport = h.Config.OAuth2Client(cmd).Transport
handler.Configuration.Username = h.Config.ClientID
handler.Configuration.Password = h.Config.ClientSecret

if skip, _ := cmd.Flags().GetBool("skip-tls-verify"); skip {
handler.Configuration.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
}

if term, _ := cmd.Flags().GetBool("fake-tls-termination"); term {
handler.Configuration.DefaultHeader["X-Forwarded-Proto"] = "https"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestExecute(t *testing.T) {
return err != nil
},
},
{args: []string{"connect", "--id", "admin", "--secret", "pw", "--url", "https://127.0.0.1:4444/"}},
{args: []string{"connect", "--id", "admin", "--secret", "pw", "--url", "https://127.0.0.1:4444"}},
{args: []string{"clients", "create", "--id", "foobarbaz"}},
{args: []string{"clients", "get", "foobarbaz"}},
{args: []string{"clients", "create", "--id", "public-foo", "--is-public"}},
Expand Down
Loading

0 comments on commit 92fe6bb

Please sign in to comment.