Skip to content

Commit

Permalink
⚡ vendor: switch to versioned gorethink api (#81)
Browse files Browse the repository at this point in the history
* vendor: switch to versioned gorethink api
* readme: bug bounty / hall of fame
* readme: add fosite and ladon reference
  • Loading branch information
Aeneas committed May 30, 2016
1 parent ebfc9a9 commit 15242e2
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 35 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
[![Coverage Status](https://coveralls.io/repos/ory-am/hydra/badge.svg?branch=master&service=github)](https://coveralls.io/github/ory-am/hydra?branch=master)
[![Go Report Card](https://goreportcard.com/badge/github.com/ory-am/hydra)](https://goreportcard.com/report/github.com/ory-am/hydra)

Hydra is being developed by german-based company [Ory](https://ory.am). Join our [mailinglist](http://eepurl.com/bKT3N9) to stay on top of new developments. There is also a [Google Group](https://groups.google.com/forum/#!forum/ory-hydra/new) and a [Gitter Channel](https://gitter.im/ory-am/hydra).
Hydra is being developed by german-based company [Ory](https://ory.am). Join our [mailinglist](http://eepurl.com/bKT3N9) to stay on top of new developments.
There is also a [Google Group](https://groups.google.com/forum/#!forum/ory-hydra/new) and a [Gitter Channel](https://gitter.im/ory-am/hydra).

Hydra uses the security first OAuth2 and OpenID Connect SDK [Fosite](https://github.com/ory-am/fosite) and [Ladon](https://github.com/ory-am/ladon) for policy-based access control.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand All @@ -21,6 +24,7 @@ Hydra is being developed by german-based company [Ory](https://ory.am). Join our
- [REST API Documentation](#rest-api-documentation)
- [CLI Documentation](#cli-documentation)
- [Develop](#develop)
- [Hall of Fame](#hall-of-fame)

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

Expand Down Expand Up @@ -75,7 +79,7 @@ $ docker run -d -p 4444:4444 oryam/hydra --name my-hydra
ec91228cb105db315553499c81918258f52cee9636ea2a4821bdb8226872f54b
```

**The CLI client is available at **[gobuild.io](https://gobuild.io/ory-am/hydra)**.
**The CLI client is available at [gobuild.io](https://gobuild.io/ory-am/hydra)**.

There is currently no installer which adds the CLI to your path automatically. You have to set up the path yourself.
If you do not understand what that means, ask on our [Gitter channel](https://gitter.im/ory-am/hydra).
Expand Down Expand Up @@ -264,3 +268,9 @@ DATABASE_URL=rethinkdb://localhost:28015/hydra go run main.go
# Docker Terminal
DATABASE_URL=rethinkdb://$(docker-machine ip default):28015/hydra go run main.go
```

## Hall of Fame

A list of extraordinary contributors and [bug hunters](https://github.com/ory-am/hydra/issues/84).

* [Alexander Widerberg (leetal)](https://github.com/leetal) for implementing the prototype RethinkDB adapters.
2 changes: 1 addition & 1 deletion client/manager_rethinkdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (

"time"

r "github.com/dancannon/gorethink"
"github.com/go-errors/errors"
"github.com/ory-am/fosite"
"github.com/ory-am/fosite/hash"
"github.com/ory-am/hydra/pkg"
"github.com/pborman/uuid"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

type RethinkManager struct {
Expand Down
2 changes: 1 addition & 1 deletion client/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/url"
"testing"

r "github.com/dancannon/gorethink"
r "gopkg.in/dancannon/gorethink.v2"

"log"
"os"
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/handler_client_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package server

import (
"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/client"
"github.com/ory-am/hydra/config"
"github.com/ory-am/hydra/herodot"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

func newClientManager(c *config.Config) client.Manager {
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/handler_connection_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package server

import (
"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/hydra/config"
"github.com/ory-am/hydra/connection"
"github.com/ory-am/hydra/herodot"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

func newConnectionHandler(c *config.Config, router *httprouter.Router) *connection.Handler {
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/handler_jwk_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package server

import (
"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/hydra/config"
"github.com/ory-am/hydra/herodot"
"github.com/ory-am/hydra/jwk"
"github.com/square/go-jose"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

func newJWKHandler(c *config.Config, router *httprouter.Router) *jwk.Handler {
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/handler_oauth2_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/url"

"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/go-errors/errors"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/fosite"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/ory-am/hydra/oauth2"
"github.com/ory-am/hydra/pkg"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

func injectFositeStore(c *config.Config, clients client.Manager) {
Expand Down
2 changes: 1 addition & 1 deletion config/backend_connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"time"

"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/go-errors/errors"
"github.com/ory-am/hydra/pkg"
r "gopkg.in/dancannon/gorethink.v2"
)

type MemoryConnection struct{}
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
"github.com/go-errors/errors"
"github.com/ory-am/fosite/handler/core/strategy"
"github.com/ory-am/fosite/hash"
Expand All @@ -24,6 +23,7 @@ import (
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
r "gopkg.in/dancannon/gorethink.v2"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion connection/manager_rethinkdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package connection
import (
"sync"

r "github.com/dancannon/gorethink"
r "gopkg.in/dancannon/gorethink.v2"

"time"

Expand Down
4 changes: 2 additions & 2 deletions connection/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"os"
"time"

r "github.com/dancannon/gorethink"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/herodot"
Expand All @@ -21,11 +20,12 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
"gopkg.in/ory-am/dockertest.v2"
)

var connections = []*Connection{
&Connection{
{
ID: uuid.New(),
LocalSubject: "peter",
RemoteSubject: "peterson",
Expand Down
10 changes: 4 additions & 6 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/fosite_store_rethinkdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"sync"
"time"

r "github.com/dancannon/gorethink"
"github.com/go-errors/errors"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/client"
"github.com/ory-am/hydra/pkg"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
)

type RDBItems map[string]*RdbSchema
Expand Down
2 changes: 1 addition & 1 deletion internal/fosite_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"time"

"github.com/Sirupsen/logrus"
r "github.com/dancannon/gorethink"
c "github.com/ory-am/common/pkg"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/pkg"
"github.com/pborman/uuid"
"golang.org/x/net/context"
r "gopkg.in/dancannon/gorethink.v2"
"gopkg.in/ory-am/dockertest.v2"
)

Expand Down
3 changes: 2 additions & 1 deletion jwk/aead.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"github.com/go-errors/errors"
"io"

"github.com/go-errors/errors"
)

type AEAD struct {
Expand Down
3 changes: 2 additions & 1 deletion jwk/aead_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package jwk

import (
"testing"

"github.com/ory-am/fosite/rand"
"github.com/ory-am/hydra/pkg"
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"
"testing"
)

func TestAEAD(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions jwk/generator_ecdsa256.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ func (g *ECDSA256Generator) Generate(id string) (*jose.JsonWebKeySet, error) {

return &jose.JsonWebKeySet{
Keys: []jose.JsonWebKey{
jose.JsonWebKey{
{
Key: key,
KeyID: ider("private", id),
},
jose.JsonWebKey{
{
Key: &key.PublicKey,
KeyID: ider("public", id),
},
Expand Down
4 changes: 2 additions & 2 deletions jwk/generator_ecdsa521.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ func (g *ECDSA521Generator) Generate(id string) (*jose.JsonWebKeySet, error) {

return &jose.JsonWebKeySet{
Keys: []jose.JsonWebKey{
jose.JsonWebKey{
{
Key: key,
KeyID: ider("private", id),
},
jose.JsonWebKey{
{
Key: &key.PublicKey,
KeyID: ider("public", id),
},
Expand Down
2 changes: 1 addition & 1 deletion jwk/generator_hs256.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (g *HS256Generator) Generate(id string) (*jose.JsonWebKeySet, error) {

return &jose.JsonWebKeySet{
Keys: []jose.JsonWebKey{
jose.JsonWebKey{
{
Key: []byte(string(key)),
KeyID: id,
},
Expand Down
4 changes: 2 additions & 2 deletions jwk/generator_rs256.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ func (g *RS256Generator) Generate(id string) (*jose.JsonWebKeySet, error) {
key.Precomputed = rsa.PrecomputedValues{}
return &jose.JsonWebKeySet{
Keys: []jose.JsonWebKey{
jose.JsonWebKey{
{
Key: key,
KeyID: ider("private", id),
},
jose.JsonWebKey{
{
Key: &key.PublicKey,
KeyID: ider("public", id),
},
Expand Down
5 changes: 3 additions & 2 deletions jwk/manager_rethinkdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (

"encoding/json"

r "github.com/dancannon/gorethink"
"time"

"github.com/go-errors/errors"
"github.com/ory-am/hydra/pkg"
"github.com/square/go-jose"
"golang.org/x/net/context"
"time"
r "gopkg.in/dancannon/gorethink.v2"
)

type RethinkManager struct {
Expand Down
2 changes: 1 addition & 1 deletion jwk/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net/url"
"testing"

r "github.com/dancannon/gorethink"
"github.com/julienschmidt/httprouter"
"github.com/ory-am/fosite"
"github.com/ory-am/hydra/herodot"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/ory-am/hydra/pkg"
"github.com/ory-am/ladon"
"github.com/stretchr/testify/assert"
r "gopkg.in/dancannon/gorethink.v2"

"log"
"os"
Expand Down
4 changes: 2 additions & 2 deletions warden/warden_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
. "github.com/ory-am/hydra/firewall"
"github.com/ory-am/hydra/herodot"
"github.com/ory-am/hydra/oauth2"
"github.com/ory-am/hydra/pkg"
"github.com/ory-am/ladon"
"golang.org/x/net/context"
"github.com/ory-am/hydra/pkg"
)

type LocalWarden struct {
Warden ladon.Warden
TokenValidator *core.CoreValidator

Issuer string
Issuer string
}

func (w *LocalWarden) actionAllowed(ctx context.Context, a *ladon.Request, scopes []string, oauthRequest fosite.AccessRequester, session *oauth2.Session) (*Context, error) {
Expand Down

0 comments on commit 15242e2

Please sign in to comment.