Commit Graph

48 Commits

Author SHA1 Message Date
Kevin Goslar d768cf6580
docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
zepatrik cc9d9e5b5d
refactor: make commands easier to consume 2022-10-06 10:54:04 +02:00
aeneasr e466d7c9d2 refactor: `hydra keys` command
BREAKING CHANGE: The `hydra keys create|delete|get|import` commands have changed to follow other Ory project's guidelines, including structured output and improved handling. They are now:

```
hydra create jwks
hydra get jwks
hydra delete jwks
hydra import jwk
```

Please head over to the documentation for more information or use the `--help` CLI flag for each command.
2022-09-07 08:10:31 +02:00
aeneasr 17c226cc2a refactor: remove `/oauth2/flush` endpoint
BREAKING CHANGE: HTTP endpoint `/oauth2/flush`, used to flush inactive access token was deprecated and has been removed. Please use `hydra janitor` instead.
2022-09-07 08:10:31 +02:00
aeneasr 4002224439 refactor(client): make OAuth2 Client IDs system-chosen and immutable
BREAKING CHANGE: To improve security and scalability (in particular sharding), OAuth 2.0 Client IDs can no longer be chosen but are always assigned a random generated UUID V4. OAuth 2.0 Clients created with custom IDs before the v2.0 release will continue working with their legacy Client ID in Ory Hydra v2.x.

Additionally, the `hydra create client` command no longer supports flag `--id` and flag `--callbacks` has been renamed to `--redirect-uris`.

Closes #2911
2022-09-07 08:10:31 +02:00
aeneasr 77b1ac7496 fix: resolve test issues and regressions introduced by the new JWK generator 2022-09-07 08:10:31 +02:00
aeneasr 68cb7d511f fix: compile issues 2022-09-07 08:10:31 +02:00
aeneasr bbe0406df6 feat: config hot reloading architecture 2022-09-07 08:10:31 +02:00
Mart Aarma 7578aa9f3a
feat: Hardware Security Module support (#2625)
This change introduces support for Hardware Security Modules, a physical computing device that safeguards and manages digital keys, performs encryption and decryption functions for digital signatures, strong authentication, and other cryptographic functions.

If enabled, the Hardware Security Module is used to look up any keys. If no key is found, the software module is used as a fallback for lookup. This allows you to use the HSM for privileged keys, and the software module to manage lifecycle keys (e.g. for Token Exchange).

For more information, please [read the guide](https://www.ory.sh/hydra/docs/next/guides/hsm-support).

Thank you to [aarmam](https://github.com/aarmam) for this great contribution!

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
2022-01-11 16:33:22 +01:00
naveenpaul1 e874f4f300
feat: support updating keys in CLI (#2460)
Closes #2436
2021-09-20 18:42:30 +02:00
Alano Terblanche f039ebbdf3
feat: flush inactive/expired login and consent requests (#2381)
This patch resolves various table growth issues caused by expired/inactive login and consent flows never being purged from the database.

You may now use the new `hydra janitor` command to remove access & refresh tokens and login & consent requests which are no longer valid or used. The command follows the `notAfter` safe-guard approach to ensure records needed to be kept are not deleted.

To learn more, please use `hydra help janitor`.

This patch phases out the `/oauth2/flush` endpoint as the janitor is better suited for background tasks, is easier to run in a targeted fashion (e.g. as a singleton job), and does not cause HTTP timeouts.

Closes #1574
2021-03-24 20:58:44 +01:00
hackerman 7ab715402b
refactor(client): Reduce SQL boilerplate code (#1758)
Part of #1730
2020-03-15 00:34:18 +01:00
hackerman 95a51deb31
Improve configuration and service management (#1314)
This patch significantly refactors internal configuration and service management with the goal of making configuration changes possible without service restarts. This patch prepares the possibility to configure ORY Hydra from a remote source (etcd, consul) and watch for changes. This patch also introduces the possibility to configure ORY Hydra from a configuration file on top of environment variables.

The following issues have been fixed as well:

- Key rotation of the system secret is now much simpler (closes #1316)
- Database connectivity parameters such as max_conns no longer cause issues with older postgres versions (closes #1327)
- Non-existing routes now return a JSON error instead of `text/plain` when `application/json` was requested (clsoes #1244)
- We now push tags latest, X, X.Y, X.Y.Z to docker hub (closes #1289)
- The quickstart guide no longer builds the source code but instead pulls latest tag (closes #1309)
- We moved to goreleaser and godownloader for release management (closes #1107)
- The quickstart Docker Compose files are now reusable (closes #1196)

The following issues are also resolved:

- Closes #1121 

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-02 11:52:21 +02:00
Sawada Shota 468076e66e cmd: Add client secret encryption option (#1322)
Closes #1317 

Signed-off-by: Shota Sawada <xiootas@gmail.com>
2019-03-29 12:45:54 +01:00
hackerman 94dae2293c
cmd: Resolve panic in migration handler (#1151)
Closes #1137

Signed-off-by: aeneasr <aeneas@ory.sh>
2018-11-03 12:55:16 +01:00
hackerman 65b7406abe
Move dependencies to ory/x (#1095)
Signed-off-by: aeneasr <aeneas@ory.sh>
2018-10-23 06:59:31 -07:00
arekkas a68cca918c cmd: Fix flaky port finder
Closes #1054

Signed-off-by: arekkas <aeneas@ory.am>
2018-10-09 15:56:19 +02:00
arekkas ba34b0cbfc cmd: Improve CLI tests
Signed-off-by: arekkas <aeneas@ory.am>
2018-08-06 16:20:36 +02:00
arekkas cfee3eb3d0 cmd: Introduce public and administrative ports
This patch introduces two ports, public and administrative. The public
port is responsible for handling API requests to public endpoints such
as /oauth2/auth, while the administrative port handles requests to
JWK, OAuth 2.0 Client, and Login & Consent endpoints.

Closes #904

Signed-off-by: arekkas <aeneas@ory.am>
2018-08-06 11:29:38 +02:00
arekkas 1a2250d959 all: Resolve broken tests caused by public flag removal
Signed-off-by: arekkas <aeneas@ory.am>
2018-07-22 13:17:18 +02:00
arekkas 312f8d1765 cmd: Allows import of PEM/DER/JSON encoded keys
Closes #98

Signed-off-by: arekkas <aeneas@ory.am>
2018-07-11 17:28:42 +02:00
arekkas d25766c2b8 cmd: Improves key rotation logic 2018-06-24 17:24:12 +02:00
aeneasr a463d23ac9 jwk: Adds jwk rotation and improves jwk codebase 2018-06-24 17:24:12 +02:00
arekkas 0b5f4666d8 cmd: Deprecates connect command and introduces configurable credentials
This patch deprecates the `hydra connect` command as internal
access control has been removed from ORY Hydra and this command
no longer serves any purpose.

Instead, all commands are supplied with environment variables `HYDRA_URL`,
`OAUTH2_CLIENT_ID`, `OAUTH2_CLIENT_SECRET`, `OAUTH2_ACCESS_TOKEN`.

Please check out `hydra help <command>` for usage instructions. You
should also check out the upgrade guide for more detailed upgrade instructions.

This patch also renames some flags and command names which have been
documented in the upgrade guide.

Closes #841
Closes #840
2018-05-04 15:03:26 +02:00
arekkas a002e30577 oauth2: Improves the consent flow design
This patch makes significant changes to the consent flow. First,
the consent flow is being renamed to "User Login and Consent Flow"
and is split into two redirection flows, the "User Login Redirection Flow"
and the "User Consent Flow".

Conceptually, not a lot has changed but the APIs have been cleaned up
and the new flow is a huge step towards OpenID Connect Certification.

Besides easier implementation on the (previously known as) consent app,
this patch introduces a new set of features which lets ORY Hydra
detect previous logins and previously accepted consent requests. In turn,
the user does not need to login or consent on every OAuth2 Authorize Code
Flow.

This patch additionally lays the foundation for revoking tokens per
user or per user and client.

Awesome.

Closes #771
Closes #772
2018-05-04 14:07:36 +02:00
arekkas d72efbf577 all: Removes unused code and updates go dep 2018-04-29 18:25:42 +02:00
arekkas 3d0bf0bda5 Removes policy, warden and groups from this project
We have learned a lot over the last year in terms of how ORY Hydra is being used. Initially, we wanted to avoid the problems facing popular databases like MongoDB or others, which did not include authentication for their management APIs.

For this reason, the Warden API was born and primarily used internally and exposed via HTTP. We learned that access control policies are well received, but also add additional complexity to understanding the software. While we firmly believe that these policies implement best practices for access control in complex systems, we do understand that they add a barrier to getting started with ORY Hydra.

For this reason we are planning on moving the Warden API from this project to ORY Oathkeeper or potentially it's own server. We would add a migration path for existing policy definitions to the new service. The default docker image would combine the services in such a way, that ORY Hydra is protected. We would additionally have an (insecure) docker image without authentication which can be used for testing.

This also opens up the possibility of having more access control mechanisms than access control policies. For example, we can add ACL and RBAC and other mechanisms too.

First I think it makes good sense to move this functionality into a separate service and remove the warden calls internally completely. The reason being that not everyone wants to rely on Hydra's access control. Sometimes it's enough to use a gateway in front and require e.g. an API key for management or whatever. New adopters are always baffled by complexity involved with policies and scopes. Removing that from the core could really help. The user survey has also shown that this stuff is quite complex to grasp.

The idea is to have a separate service which is basically ladon as a HTTP API. I think it makes sense to add some functionality to resolve access tokens so it would basically be very similar to the current warden API - probably even equal. There would definitely be some backup mode where hydra's database tables and migrations are used as to make migration as easy as possible.

Then, we would ship docker images and example set ups where different configurations are shown. One of the configurations would be the current one, so basically what we have now in hydra but with the three services combined in one image.

Closes #807
2018-04-29 18:25:42 +02:00
Aeneas 366ed57d9c
all: Updates license headers (#793) 2018-03-08 10:27:18 +01:00
arekkas ed0aa28c58 oauth2: Adds ability to flush old access tokens
Previously, no way of removing old access tokens from the database.
This patch adds a new endpoint (`POST /oauth2/flush`) capable of
flushing old / stale access tokens.

Additionally, `hydra token flush` was added which is the CLI command
for flushing tokens using the api.

Closes #738
2018-02-06 16:49:23 +01:00
Aeneas 049f581d5b
cmd: Adds newsletter sign up capabilities to CLI commands (#759) 2018-02-05 15:34:19 +01:00
Aeneas dcbd6d8fcb
Add license header to all source files (#644)
Closes #643
2017-11-06 13:01:53 +01:00
arekkas 92fe6bbece all: update swagger definitions and fix failing tests 2017-10-05 18:12:34 +02:00
Aeneas Rekkas (arekkas) bb31d763f1 cmd: add test for get handler 2017-06-17 21:46:03 +02:00
Aeneas d91305baec cmd: resolve issuer test issue (#522) 2017-06-15 00:12:27 +02:00
Aeneas ab573c84c7 all: resolve failing test and data race (#501) 2017-06-14 13:01:09 +02:00
Aeneas a04e6f2f1b metrics: add metrics and telemetry package (#500) 2017-06-07 19:43:45 +02:00
Aeneas Rekkas (arekkas) 0985a594e1 all: goimports 2017-05-07 10:52:08 +02:00
Aeneas Rekkas (arekkas) 819d4b40de cmd: implement better migration handling 2017-05-07 10:52:08 +02:00
Aeneas Rekkas (arekkas) 2c3c8e3697 all: resolve test issues with memory adapter 2017-05-07 10:52:08 +02:00
Aeneas Rekkas (arekkas) b22d26f9b0 all: gofmt -w -s 2017-03-24 11:41:28 +01:00
Aeneas Rekkas (arekkas) 136453f269 cli: fix tests 2016-12-30 10:23:17 +01:00
Aeneas Rekkas (arekkas) ce46d45ebe warden: add group management - closes #68 2016-12-30 10:23:17 +01:00
Aeneas Rekkas (arekkas) 7d3cb4eb71 oauth2/revocation: token revocation fails silently with sql store - closes #311 2016-11-22 12:38:36 +01:00
Aeneas 8256356b9b 0.6.0 (#293)
* oauth2: scopes should be separated by %20 and not +, to ensure javascript compatibility - closes #277
* oauth2/introspect: make endpoint rfc7662 compatible - closes #289
* warden: make it clear that ladon.Request.Subject is not required or break bc and remove it - closes #270
* travis: execute gox build only when new commit is a new tag - closes #285
* docs: improve introduction (#267)
* core: (health) monitoring endpoint - closes #216
* oauth2/introspect: make endpoint rfc7662 compatible - closes #289
* connections: remove connections API - closes #265
* oauth2: token revocation endpoint - closes #233
* vendor: update to fosite 0.5.0
* core: add sql support #292
* connections: remove connections API - closes #265
* all: coverage report is missing covered lines of nested packages - closes #296
* cmd: prettify the `hydra token user` output - closes #281
* travis: make it possible for travis-ci to build forked repos - closes #295
2016-10-25 12:01:26 +02:00
Aeneas 76c23f86d1 core: versioned automated builds
* core: figure out a process to autobuild releases - closes #210
* cmd: add version command - closes #218
2016-09-01 22:44:37 +02:00
Aeneas a297f7e57b 🔥 0.2.0 (#165)
* warden: rename `assertion` to `token` - closes #158
* config: do not log database credentials - closes #147
* oauth2: upgrade fosite - close #160
* config: do not store database config in hydra config - closes #164
* oauth2: id_token at_hash / c_hash is null - closes #129
* jwk: improve error message of wrong system secrect - closes #104
* readme: improve images, add benchmarks - closes #161
* cmd: improve connect dialogue - closes #170
* cmd: fix --dry option - closes #157
* firewall: document warden interface sdk
* readme: link openid connect and oauth2 introduction
* cmd: introduce FORCE_ROOT_CLIENT_CREDENTIALS env var - closes #140
* readme: document error redirect to identity provider - closes #96
* internal: fosite store must be consistent to avoid errors - closes #176
* client: add GetConcreteClient to http manager
* cmd: host process now logs basic information on all http requests - closes #178
* all: add memory profiling - closes #179
* warden: resolve nil pointer issue - closes #181
* cmd: clean up env to struct mapping, add more controls
* cmd: bcrypt cost should be configurable - closes #184
* cmd: token lifespans should be configurable - closes #183
* cmd: resolve issues with envirnoment config - closes #182
* cmd: implement tls termination capability - closes #177
* cmd: resolve issues with redirect logic and TLS
* oauth2: implement default oauth2 consent endpoint - closes #185
* warden - closes #188 
* oauth2: id token claims should be set by using id_token - closes #188
* oauth2: oauth2 implicit flow should allow custom protocols - closes #180
* oauth2: core scope should not be mandatory - closes #189
* warden: warden sdk should not make distinction between token and request - closes #190
* warden: rename authorized / allowed endpoints to something more meaningful - closes #162
* ci: improve travis config
2016-08-09 14:05:18 +02:00
Aeneas 85936992ad 🔥 0.1-beta2 (#90) 🔥
* cli: key is now sha256(secret) - closes #86 

* client: creating clients with predefined credentials - closes #91

* client: always autogenerate secrets when using clients create

* cli: CLI should have `-dry` option to show what the HTTP request looks like - closes #99

* cli: fix issue where tls certificate is regenerated on boot - closes #93 

* cli: allow passing of tls certificates via env vars or files - closes #88

* oauth2: add offline scope for refresh tokens - closes #97 

* jwk: support for x5c certificate chains - closes #92 

* all: minor changes - closes #89
2016-06-14 11:49:24 +02:00
Aeneas 00fd93cab2 🔥 0.1-beta 🔥 2016-05-29 11:50:57 +02:00