Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
sudo: required
go test sudo: required

services:
- docker

env:
- DOCKER_BIND_LOCALHOST=true
- DOCKER_BIND_LOCALHOST=true GO15VENDOREXPERIMENT=1

language: go

go:
- 1.5
- 1.6

install:
- go get golang.org/x/tools/cmd/vet
- go get github.com/axw/gocov/gocov
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
- go get github.com/golang/lint/golint
- go get -t ./...
- go get github.com/pierrre/gotestcover
- go get -t $(go list ./... | grep -v /vendor/)

script:
# - go vet -x ./...
- ./coverage --coveralls
- gotestcover -coverprofile="cover.out" -race -covermode="count" $(go list ./... | grep -v /vendor/)
- goveralls -coverprofile="cover.out"
206 changes: 206 additions & 0 deletions Godeps/Godeps.json

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

5 changes: 5 additions & 0 deletions Godeps/Readme

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

21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ Join our [mailinglist](http://eepurl.com/bKT3N9) to stay on top of new developme
- [CLI Usage](#cli-usage)
- [Start server](#start-server)
- [Create client](#create-client)
- [Create user](#create-user)
- [Create Account](#create-account)
- [Create JWT RSA Key Pair](#create-jwt-rsa-key-pair)
- [Create a TLS certificate](#create-a-tls-certificate)
- [Import policies](#import-policies)
- [Security considerations](#security-considerations)
- [Good to know](#good-to-know)
- [Deploy with buildpacks (Heroku, Cloud Foundry, ...)](#deploy-with-buildpacks-heroku-cloud-foundry-)
- [Policies](#policies)
- [Everything is RESTful. No HTML. No Templates.](#everything-is-restful-no-html-no-templates)
- [Sign up workflow](#sign-up-workflow)
Expand Down Expand Up @@ -200,10 +201,10 @@ Make sure to prefix the url with the wanted database technology. e.g `rethinkdb:
| SIGNIN_URL | [Sign in URL](#sign-in) | url | empty |
| DROPBOX_CLIENT | Dropbox Client ID | string | empty |
| DROPBOX_SECRET | Dropbox Client Secret | string | empty |
| JWT_PUBLIC_KEY_PATH | JWT Signing Public Key | `./cert/rs256-public.pem` (local path) | "../../example/cert/rs256-public.pem" |
| JWT_PRIVATE_KEY_PATH | JWT Signing Private Key | `./cert/rs256-private.pem` (local path) | "../../example/cert/rs256-private.pem" |
| TLS_CERT_PATH | TLS Certificate Path | `./cert/cert.pem` | "../../example/cert/tls-cert.pem" |
| TLS_KEY_PATH | TLS Key Path | `./cert/key.pem` | "../../example/cert/tls-key.pem" |
| JWT_PUBLIC_KEY | JWT Signing Public Key | The public key or a path to it. | "../../example/cert/rs256-public.pem" |
| JWT_PRIVATE_KEY | JWT Signing Private Key | The private key or a path to it. | "../../example/cert/rs256-private.pem" |
| TLS_CERT | TLS Certificate Path | The TLS public certificate or a path to it. | "../../example/cert/tls-cert.pem" |
| TLS_KEY | TLS Key Path | The TLS private key or a path to it. | "../../example/cert/tls-key.pem" |
| DANGEROUSLY_FORCE_HTTP | Disable HTTPS | `force` | disabled |

### CLI Usage
Expand Down Expand Up @@ -376,6 +377,16 @@ Here's an exemplary *policies.json:*

This section covers information necessary for understanding how hydra works.

### Deploy with buildpacks (Heroku, Cloud Foundry, ...)

Hydra runs pretty much out of the box when using a Platform as a Service (PaaS).
Here are however a few notes which might assist you in your task:
* Heroku (and probably Cloud Foundry as well) *force* TLS termination, meaning that Hydra must be configured with `DANGEROUSLY_FORCE_HTTP=force`.
* Using bash, you can easily add multi-line environment variables to Heroku using `heroku config:set JWT_PUBLIC_KEY="$(my-public-key.pem)"`.
This does not work on Windows!



### Policies

Policies are something very powerful. I have to admit that I am a huge fan of how AWS handles policies and adopted their architecture for Hydra. Please find a more in depth documentation
Expand Down
4 changes: 2 additions & 2 deletions account/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/gorilla/mux"
chd "github.com/ory-am/common/handler"
. "github.com/ory-am/common/pkg"
"github.com/pborman/uuid"
"golang.org/x/net/context"
. "github.com/ory-am/hydra/account"
"github.com/ory-am/hydra/middleware"
"github.com/pborman/uuid"
"golang.org/x/net/context"
"net/http"
)

Expand Down
12 changes: 6 additions & 6 deletions account/handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import (
"github.com/dgrijalva/jwt-go"
"github.com/gorilla/mux"
chd "github.com/ory-am/common/handler"
"github.com/ory-am/hydra/account"
hydra "github.com/ory-am/hydra/account/postgres"
authcon "github.com/ory-am/hydra/context"
"github.com/ory-am/hydra/hash"
hjwt "github.com/ory-am/hydra/jwt"
middleware "github.com/ory-am/hydra/middleware/host"
"github.com/ory-am/ladon/policy"
"github.com/parnurzeal/gorequest"
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
"gopkg.in/ory-am/dockertest.v2"
"github.com/ory-am/hydra/account"
hydra "github.com/ory-am/hydra/account/postgres"
authcon "github.com/ory-am/hydra/context"
"github.com/ory-am/hydra/hash"
hjwt "github.com/ory-am/hydra/jwt"
middleware "github.com/ory-am/hydra/middleware/host"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion account/postgres/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/asaskevich/govalidator"
"github.com/go-errors/errors"
"github.com/ory-am/common/pkg"
"github.com/pborman/uuid"
"github.com/ory-am/hydra/account"
"github.com/ory-am/hydra/hash"
"github.com/pborman/uuid"
)

const accountSchema = `CREATE TABLE IF NOT EXISTS hydra_account (
Expand Down
2 changes: 1 addition & 1 deletion account/postgres/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"

"github.com/ory-am/common/pkg"
"github.com/ory-am/hydra/hash"
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"
"gopkg.in/ory-am/dockertest.v2"
"github.com/ory-am/hydra/hash"
//"reflect"
"testing"
"time"
Expand Down
2 changes: 1 addition & 1 deletion account/rethinkdb/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/asaskevich/govalidator"
"github.com/go-errors/errors"
"github.com/ory-am/common/pkg"
"github.com/pborman/uuid"
"github.com/ory-am/hydra/account"
"github.com/ory-am/hydra/hash"
"github.com/pborman/uuid"
)

const accountsTable = "hydra_account"
Expand Down
2 changes: 1 addition & 1 deletion account/rethinkdb/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

rdb "github.com/dancannon/gorethink"
"github.com/ory-am/common/pkg"
"github.com/ory-am/hydra/hash"
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"
"github.com/ory-am/hydra/hash"
//"reflect"
"testing"

Expand Down
8 changes: 0 additions & 8 deletions app.json

This file was deleted.

2 changes: 1 addition & 1 deletion cli/hydra-host/handler/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/codegangsta/cli"
"github.com/howeyc/gopass"
"github.com/pborman/uuid"
"github.com/ory-am/hydra/account"
"github.com/pborman/uuid"
)

type Account struct {
Expand Down
Loading