Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.0: Towards production friendliness #445

Merged
merged 57 commits into from
May 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7f4d582
docs: remove rethinkdb from readme
May 2, 2017
dc35a40
ci: go 1.7 no longer supported
May 2, 2017
af1d2bb
all: move move most writers in handlers to ory/herodot
May 2, 2017
97ff4c7
all: move move ory-am/ladon to ory/ladon
May 2, 2017
06e0c5c
all: reflect ladon memory manager changes
May 2, 2017
3ac3a63
all: remove context from herodot calls
May 2, 2017
d2df33c
all: move to new ladon structure
May 2, 2017
12405c5
all: finalize ladon and logrus changes
May 2, 2017
3d501ce
all: remove redis and rethinkdb adapters
May 2, 2017
5b49410
all: resolve test issues with memory adapter
May 2, 2017
acf1dc7
jwk: resolve issues with jwk manager
May 2, 2017
85a08b8
config/sql: implement ability to handle sql parallelism
May 2, 2017
bc25c2b
sql: limit maximum open connections, document timeout options through…
May 2, 2017
2ab853b
all: move to one logrus instance
May 2, 2017
ca27530
all: resolve remaining test issues
May 3, 2017
890ed72
ci: introduce more e2e tests
May 3, 2017
a28b9b2
cmd: introduce log_format and log_level
May 3, 2017
83e464a
all: move to new org
May 3, 2017
c08091f
all: goimports
May 3, 2017
2cfb976
cmd: improve openid connect error message - closes #439
May 3, 2017
c04b9ee
policies: implement list functionality
May 3, 2017
4d6cc25
docs: add swagger docs for the client endpoint
May 3, 2017
a73efb6
docs: add swagger spec for listing clients
May 3, 2017
7f92327
policy: implement listing policies
May 3, 2017
2b6052f
docs: improve client swagger specs and add jwk specs
May 3, 2017
865852e
warden/group: fix c&p typos
May 3, 2017
e80ff48
all: added swagger docs for the rest of the apis
May 4, 2017
367ed40
docs: update swagger description
May 4, 2017
cd8af7f
docs: add scopes docs, move swagger json to yaml
May 4, 2017
a6bde49
docs: add offline scope to swagger
May 4, 2017
472b8cc
docs: add history doc
May 4, 2017
073ea87
policy: rename GetAll to List
May 4, 2017
fd9b8e5
vendor: upgrade glide
May 4, 2017
6d78590
docs: add faq sections for ropc and mobile
May 4, 2017
88761f2
cmd: add migrate dummies
May 4, 2017
229e0af
config: fix typo
May 4, 2017
5e4437e
docker: upgrade consent app image
May 4, 2017
7ba03e4
docs: add security section
May 4, 2017
787f423
docs: add who is using it section
May 4, 2017
e7cac77
docs: beef up security docs
May 4, 2017
3a64fd5
docs: add oauth2 native link
May 4, 2017
aef0019
all: goimports
May 4, 2017
1baba15
docs: ✏️ minor grammar typo in security doc (#452)
therebelrobot May 5, 2017
fd34c81
docs: re-add tutorial on consent app by @matteosuppo
May 5, 2017
3f5cbe7
cmd: implement better migration handling
May 5, 2017
df24f39
docs: update security section in readme
May 5, 2017
23480e3
vendor: update glide lockfile
May 5, 2017
a94ae11
docker-demo: get dockerfile working again
May 5, 2017
5a67648
all: goimports
May 5, 2017
19339e3
docs: update typos in history
arekkas May 6, 2017
932f409
docs: improve documentation
May 6, 2017
14a1ca7
warden: resolve test issues
May 6, 2017
468db58
vendor: upgrade glide
May 6, 2017
6fb27ee
vendor: remove graceful
May 6, 2017
46eb3b0
all: goimports
May 6, 2017
0d982e1
ci: resolve travis issues
May 6, 2017
4b5e219
ci: resolve travis issues
May 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
sudo: required

go_import_path: github.com/ory-am/hydra
go_import_path: github.com/ory/hydra

services:
- docker

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

language: go

go:
- 1.7
- 1.8

go_import_path: github.com/ory-am/hydra
before_install:
- sudo apt-get install curl

install:
- go get github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/Masterminds/glide github.com/mitchellh/gox
- git clone https://github.com/docker-library/official-images.git ~/official-images
- glide install
- go install github.com/ory-am/hydra
- go install github.com/ory/hydra
- glide update
- go install github.com/ory-am/hydra
- go install github.com/ory/hydra

script:
- |-
Expand All @@ -31,13 +32,20 @@ script:
- go test -v -bench=.* -run=none $(glide novendor)
- docker build -t hydra-travis-ci .
- docker run -d hydra-travis-ci
- $GOPATH/bin/hydra host --dangerous-auto-logon &
- DATABASE_URL=memory hydra host --dangerous-auto-logon --dangerous-force-http &
- while ! echo exit | nc localhost 4444; do sleep 1; done
- $GOPATH/bin/hydra token client --skip-tls-verify
# Test clients
- hydra clients create --id foobar
- hydra clients delete foobar
# Test token on arbitrary endpoints
- |-
curl --header "Authorization: bearer $(hydra token client)" http://localhost:4444/clients
# Test token validation
- hydra token validate $(hydra token client)

after_success:
- |-
[ "${TRAVIS_TAG}" != "" ] && [ "${TRAVIS_GO_VERSION}" == "1.7" ] && gox -ldflags "-X github.com/ory-am/hydra/cmd.Version=`git describe --tags` -X github.com/ory-am/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory-am/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"
[ "${TRAVIS_TAG}" != "" ] && [ "${TRAVIS_GO_VERSION}" == "1.7" ] && gox -ldflags "-X github.com/ory/hydra/cmd.Version=`git describe --tags` -X github.com/ory/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}"

deploy:
provider: releases
Expand All @@ -47,4 +55,4 @@ deploy:
skip_cleanup: true
on:
tags: true
go: 1.7
go: 1.8
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.8-alpine

RUN apk add --no-cache git
RUN go get github.com/Masterminds/glide
WORKDIR /go/src/github.com/ory-am/hydra
WORKDIR /go/src/github.com/ory/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-demo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.8-alpine

RUN apk add --no-cache git && go get github.com/Masterminds/glide
WORKDIR /go/src/github.com/ory-am/hydra
WORKDIR /go/src/github.com/ory/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
Expand All @@ -10,6 +10,6 @@ RUN glide install --skip-test -v
ADD . .
RUN go install .

ENTRYPOINT /go/bin/hydra host --dangerous-auto-logon --dangerous-force-http
ENTRYPOINT /go/bin/hydra migrate sql $DATABASE_URL; /go/bin/hydra host --dangerous-auto-logon --dangerous-force-http

EXPOSE 4444
2 changes: 1 addition & 1 deletion Dockerfile-http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.8-alpine

RUN apk add --no-cache git && go get github.com/Masterminds/glide
WORKDIR /go/src/github.com/ory-am/hydra
WORKDIR /go/src/github.com/ory/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
Expand Down
87 changes: 87 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# History

This list makes you aware of (breaking) changes.

## 0.8.0

This PR improves some performance bottlenecks, offers more control over Hydra, moves to Go 1.8,
and moves the REST documentation to swagger.

**Before applying this update, please make a back up of your database. Do not upgrade directly from versions
below 0.7.0**.

To upgrade the database schemas, please run the following commands in exactly this order

```sh
$ hydra help migrate sql
$ hydra help migrate ladon
```

```sh
$ hydra migrate sql mysql://...
$ hydra migrate ladon 0.6.0 mysql://...
```

### Breaking changes

#### Ladon updated to 0.6.0

Ladon was greatly improved with version 0.6.0, resolving various performance bottlenecks. Please read more on this
release [here](https://github.com/ory/ladon/blob/master/HISTORY.md#060).

#### Redis and RethinkDB deprecated

Redis and RethinkDB are removed from the repository now and no longer supported, see
[this issue](https://github.com/ory/hydra/issues/425).

#### Moved to ory namespace

To reflect the GitHub organization rename, Hydra was moved from `https://github.com/ory-am/hydra` to
`https://github.com/ory/hydra`.

#### SDK

The method `FindPoliciesForSubject` of the policy SDK was removed. Instead, `List` was added. The HTTP endpoint `GET /policies`
no longer allows to query by subject.

#### JWK

To generate JWKs previously the payload at `POST /keys` was `{ "alg": "...", "id": "some-id" }`. `id` was changed to
`kid` so this is now `{ "alg": "...", "kid": "some-id" }`.

#### Migrations are no longer automatically applied

SQL Migrations are no longer automatically applied. Instead you need to run `hydra migrate sql` after upgrading
to a Hydra version that includes a breaking schema change.

### Changes

#### Log format: json

Set the log format to json using `export LOG_FORMAT=json`

#### SQL Connection Control

You can configure SQL connection limits by appending parameters `max_conns`, `max_idle_conns`, or `max_conn_lifetime`
to the DSN: `postgres://foo:bar@host:port/database?max_conns=12`.

#### REST API Docs are now generated from source code

... and are swagger 2.0 spec.

#### Documentation on scopes

Documentation on scopes (e.g. offline) was added.

#### New response writer library

Hydra now uses `github.com/ory/herodot` for writing REST responses. This increases compatibility with other libraries
and resolves a few other issues.

#### Graceful http handling

Hydra is now capable of gracefully handling SIGINT.

#### Best practice HTTP server config

Hydra now implements best practices for running HTTP servers that are exposed to the public internet.
61 changes: 40 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,23 @@ you build a bridge between Hydra and your authentication infrastructure.
Hydra is able to securely manage JSON Web Keys, and has a sophisticated policy-based access control you can use if you want to.

Hydra is suitable for green- (new) and brownfield (existing) projects. If you are not familiar with OAuth 2.0 and are working
on a greenfield project, we recommend evaluating if OAuth 2.0 really serves your purpose. **Knowledge of OAuth 2.0 is imperative in understanding what Hydra does and how it works.**
on a greenfield project, we recommend evaluating if OAuth 2.0 really serves your purpose.
**Knowledge of OAuth 2.0 is imperative in understanding what Hydra does and how it works.**

Hydra implements Open Standards set by IETF:

* [The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)
* [OAuth 2.0 Threat Model and Security Considerations](https://tools.ietf.org/html/rfc6819)
* [OAuth 2.0 Token Revocation](https://tools.ietf.org/html/rfc7009)
* [OAuth 2.0 Token Introspection](https://tools.ietf.org/html/rfc7662)
* [OAuth 2.0 Dynamic Client Registration Protocol](https://tools.ietf.org/html/rfc7591)
* [OAuth 2.0 Dynamic Client Registration Management Protocol](https://tools.ietf.org/html/rfc7592)
* [OAuth 2.0 for Native Apps](https://tools.ietf.org/html/draft-ietf-oauth-native-apps-10)

and the OpenID Foundation:

* [OpenID Connect Core 1.0](http://openid.net/specs/openid-connect-core-1_0.html)
* [OpenID Connect Discovery 1.0](https://openid.net/specs/openid-connect-discovery-1_0.html)

---

Expand All @@ -42,6 +58,7 @@ the access control SDK [Ladon](https://github.com/ory/ladon).
**Table of Contents**

- [What is Hydra?](#what-is-hydra)
- [Who is using it?](#who-is-using-it)
- [Enterprise Edition](#enterprise-edition)
- [Quickstart](#quickstart)
- [5 minutes tutorial: Run your very own OAuth2 environment](#5-minutes-tutorial-run-your-very-own-oauth2-environment)
Expand Down Expand Up @@ -77,6 +94,16 @@ or some template engine or a predefined front-end. Instead it relies on HTTP red
to verify user consent allowing you to use Hydra with any authentication endpoint, be it [authboss](https://github.com/go-authboss/authboss),
[auth0.com](https://auth0.com/) or your proprietary PHP authentication.

## Who is using it?

This is a curated list of Hydra adopters.

<img src="https://www.arduino.cc/en/uploads/Trademark/ArduinoCommunityLogo.png" align="left" width="30%" alt="arduino.cc">
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended
for anyone making interactive projects. Hydra secures Arduino's developer platform.

<br>

## Enterprise Edition

Hydra is available as an Apache 2.0-licensed Open Source technology. In enterprise environments however,
Expand Down Expand Up @@ -142,7 +169,7 @@ and execute the hydra command from there:
$ docker exec -i -t <hydra-container-id> /bin/bash
# e.g. docker exec -i -t ec91228 /bin/bash

root@ec91228cb105:/go/src/github.com/ory-am/hydra# hydra
root@ec91228cb105:/go/src/github.com/ory/hydra# hydra
Hydra is a twelve factor OAuth2 and OpenID Connect provider

[...]
Expand All @@ -154,11 +181,11 @@ If you wish to compile hydra yourself, you need to install and set up [Go 1.5+](
to your `$PATH`. To do so, run the following commands in a shell (bash, sh, cmd.exe, ...):

```
go get github.com/ory-am/hydra
go get github.com/ory/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory-am/hydra
cd $GOPATH/src/github.com/ory/hydra
glide install
go install github.com/ory-am/hydra
go install github.com/ory/hydra
hydra
```

Expand All @@ -169,11 +196,10 @@ rename Go packages.

*Why should I use Hydra? It's not that hard to implement two OAuth2 endpoints and there are numerous SDKs out there!*

OAuth2 and OAuth2 related specifications are over 200 written pages. Implementing OAuth2 is easy, getting it right is hard.
Even if you use a secure SDK (there are numerous SDKs not secure by design in the wild), messing up the implementation
is a real threat - no matter how good you or your team is. To err is human.

An in-depth list of security features is listed [in the security guide](https://ory.gitbooks.io/hydra/content/faq/security.html).
OAuth2 and OAuth2 related specifications are over 400 written pages. Implementing OAuth2 is easy, getting it right is hard.
Hydra is trusted by companies all around the world, has a vibrant community and faces millions of requests in production
each day. Of course, we also compiled a security guide with more details on cryptography and security concepts.
Read [the security guide now](https://ory.gitbooks.io/hydra/content/security.html).

## Reception

Expand Down Expand Up @@ -211,24 +237,17 @@ Run `hydra -h` or `hydra help`.
Developing with Hydra is as easy as:

```
go get github.com/ory-am/hydra
go get github.com/ory/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory-am/hydra
cd $GOPATH/src/github.com/ory/hydra
glide install
go test $(glide novendor)
```

If you want to run a Hydra instance, there are two possibilities:
Then run it with in-memory database:

Run without Database:
```
go run main.go host
```

Run against RethinkDB using Docker:
```
docker run --name some-rethink -d -p 8080:8080 -p 28015:28015 rethinkdb
DATABASE_URL=rethinkdb://localhost:28015/hydra go run main.go host
DATABASE_URL=memory go run main.go host
```

## Sponsors
Expand Down
Loading