Skip to content

Commit

Permalink
Move dependencies to ory/x (ory#1095)
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <[email protected]>
  • Loading branch information
aeneasr authored Oct 23, 2018
1 parent 8038a74 commit 65b7406
Show file tree
Hide file tree
Showing 272 changed files with 7,614 additions and 2,571 deletions.
23 changes: 11 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ jobs:
- image: circleci/golang:1.11
working_directory: /go/src/github.com/ory/hydra
steps:
- run:
name: Enable go1.11 modules
command: |
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
# This is disabled for now because goimports is really slow when go modules are used, see
# https://github.com/golang/go/issues/27287
#
# - run:
# name: Enable go1.11 modules
# command: |
# echo 'export GO111MODULE=on' >> $BASH_ENV
# source $BASH_ENV
- checkout
- run: curl -L https://git.io/vp6lP | sh
- run: mv ./bin/* $GOPATH/bin
Expand Down Expand Up @@ -57,13 +60,9 @@ jobs:
working_directory: /go/src/github.com/ory/hydra
steps:
- checkout
- run: go get github.com/go-swagger/go-swagger/cmd/swagger
- run: curl -L https://git.io/vp6lP | sh
- run: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- run: sudo apt-get install -y default-jre nodejs
- run: sudo npm i -g yarn
- run: yarn
- run: ./scripts/test-sdk.sh
- run: make init
- run: make sdk
- run: git add -A && git diff --exit-code

build-docker:
docker:
Expand Down
1 change: 1 addition & 0 deletions .goimportsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
init:
go get -u \
github.com/ory/x/tools/listx \
github.com/sqs/goreturns \
github.com/golang/mock/mockgen \
github.com/go-swagger/go-swagger/cmd/swagger

format:
goreturns -w -local github.com/ory $$(listx .)
# goimports -w -v -local github.com/ory $$(listx .)

mockgen:
mockgen -package oauth2_test -destination oauth2/oauth2_provider_mock_test.go github.com/ory/fosite OAuth2Provider

sdk:
swagger generate spec -m -o ./docs/api.swagger.json

rm -rf ./sdk/go/hydra/swagger
rm -rf ./sdk/js/swagger
rm -rf ./sdk/php/swagger
rm -rf ./sdk/java

# swagger generate client -f ./docs/api.swagger.json -t sdk/go
java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l go -o ./sdk/go/hydra/swagger
java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l javascript -o ./sdk/js/swagger
java -jar scripts/swagger-codegen-cli-2.2.3.jar generate -i ./docs/api.swagger.json -l php -o sdk/php/ \
--invoker-package Hydra\\SDK --git-repo-id swagger --git-user-id ory --additional-properties "packagePath=swagger,description=Client for Hydra"
java -DapiTests=false -DmodelTests=false -jar scripts/swagger-codegen-cli-2.2.3.jar generate \
--input-spec ./docs/api.swagger.json \
--lang java \
--library resttemplate \
--group-id com.github.ory \
--artifact-id hydra-client-resttemplate \
--invoker-package com.github.ory.hydra \
--api-package com.github.ory.hydra.api \
--model-package com.github.ory.hydra.model \
--output ./sdk/java/hydra-client-resttemplate

goreturns -w -i -local github.com/ory $$(listx ./sdk/go)

git checkout HEAD -- sdk/go/hydra/swagger/configuration.go
git checkout HEAD -- sdk/go/hydra/swagger/api_client.go

rm -f ./sdk/js/swagger/package.json
rm -rf ./sdk/js/swagger/test
rm -f ./sdk/php/swagger/composer.json ./sdk/php/swagger/phpunit.xml.dist
rm -rf ./sdk/php/swagger/test
11 changes: 10 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,16 @@ before finalizing the upgrade process.

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 1.0.0-beta.10
## 1.0.0-rc.1

### CLI Changes

Flags `https-tls-key-path` and `https-tls-cert-path` have been removed from the `hydra serve *` commands.
Use environment variables `HTTPS_TLS_CERT_PATH` and `HTTPS_TLS_KEY_PATH` instead.

### API Changes

Endpoint `/health/status`, which redirected to `/health/alive` and was deprecated has been removed.

### Schema Changes

Expand Down
5 changes: 2 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ package client
import (
"strings"

"github.com/ory/fosite"

// Naming the dependency jose is important for go-swagger to work, see https://github.com/go-swagger/go-swagger/issues/1587
jose "gopkg.in/square/go-jose.v2"

"github.com/ory/fosite" // Naming the dependency jose is important for go-swagger to work, see https://github.com/go-swagger/go-swagger/issues/1587
)

// Client represents an OAuth 2.0 Client.
Expand Down
3 changes: 2 additions & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ package client
import (
"testing"

"github.com/ory/fosite"
"github.com/stretchr/testify/assert"

"github.com/ory/fosite"
)

var _ fosite.OpenIDConnectClient = new(Client)
Expand Down
8 changes: 4 additions & 4 deletions client/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"net/http"

"github.com/julienschmidt/httprouter"
"github.com/ory/herodot"
"github.com/ory/x/pagination"
"github.com/pkg/errors"

"github.com/ory/hydra/rand/sequence"
"github.com/ory/herodot"
"github.com/ory/x/pagination"
"github.com/ory/x/randx"
)

type Handler struct {
Expand Down Expand Up @@ -94,7 +94,7 @@ func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Pa
}

if len(c.Secret) == 0 {
secret, err := sequence.RuneSequence(12, []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-.~"))
secret, err := randx.RuneSequence(12, []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-.~"))
if err != nil {
h.H.WriteError(w, r, errors.WithStack(err))
return
Expand Down
7 changes: 3 additions & 4 deletions client/manager_0_sql_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@
package client_test

import (
"context"
"fmt"
"log"
"sync"
"testing"

"context"

"github.com/jmoiron/sqlx"
"github.com/ory/fosite"
"github.com/ory/x/sqlcon/dockertest"
"github.com/rubenv/sql-migrate"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/fosite"
"github.com/ory/hydra/client"
"github.com/ory/x/sqlcon/dockertest"
)

var createClientMigrations = []*migrate.Migration{
Expand Down
3 changes: 2 additions & 1 deletion client/manager_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import (
"sync"

"github.com/imdario/mergo"
"github.com/pkg/errors"

"github.com/ory/fosite"
"github.com/ory/x/pagination"
"github.com/ory/x/sqlcon"
"github.com/pkg/errors"
)

type MemoryManager struct {
Expand Down
7 changes: 4 additions & 3 deletions client/manager_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import (
"strings"

"github.com/jmoiron/sqlx"
"github.com/ory/fosite"
"github.com/ory/go-convenience/stringsx"
"github.com/ory/x/sqlcon"
"github.com/pkg/errors"
"github.com/rubenv/sql-migrate"
"gopkg.in/square/go-jose.v2"

"github.com/ory/fosite"
"github.com/ory/go-convenience/stringsx"
"github.com/ory/x/sqlcon"
)

var sharedMigrations = []*migrate.Migration{
Expand Down
4 changes: 2 additions & 2 deletions client/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import (

_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/ory/fosite"
"github.com/ory/x/sqlcon/dockertest"
"github.com/stretchr/testify/require"

"github.com/ory/fosite"
. "github.com/ory/hydra/client"
"github.com/ory/x/sqlcon/dockertest"
)

var clientManagers = map[string]Manager{}
Expand Down
6 changes: 3 additions & 3 deletions client/manager_test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
package client

import (
"context"
"crypto/x509"
"testing"

"context"

"github.com/ory/fosite"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/square/go-jose.v2"

"github.com/ory/fosite"
)

func TestHelperClientAutoGenerateKey(k string, m Storage) func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion client/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"testing"

"github.com/julienschmidt/httprouter"
"github.com/ory/herodot"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/herodot"
"github.com/ory/hydra/client"
hydra "github.com/ory/hydra/sdk/go/hydra/swagger"
)
Expand Down
5 changes: 3 additions & 2 deletions client/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import (
"net/url"
"strings"

"github.com/pborman/uuid"
"github.com/pkg/errors"

"github.com/ory/fosite"
"github.com/ory/go-convenience/stringslice"
"github.com/ory/go-convenience/stringsx"
"github.com/pborman/uuid"
"github.com/pkg/errors"
)

type Validator struct {
Expand Down
Loading

0 comments on commit 65b7406

Please sign in to comment.