Conversation
Codecov Report
@@ Coverage Diff @@
## master #2796 +/- ##
==========================================
- Coverage 79.26% 76.72% -2.55%
==========================================
Files 111 123 +12
Lines 8107 8846 +739
==========================================
+ Hits 6426 6787 +361
- Misses 1263 1634 +371
- Partials 418 425 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
SuperMohit
reviewed
Dec 21, 2021
7 tasks
6 tasks
|
|
||
| // NullDuration represents a nullable JSON and SQL compatible time.Duration. | ||
| // | ||
| // TODO delete this type and replace it with ory/x/sqlxx/NullDuration when applying the custom client token TTL patch to Hydra 2.x |
Contributor
There was a problem hiding this comment.
@aeneasr We user swagger:ignore here, but sqlxx uses a different swagger definition. Can you think of any way to depend on sqlxx's implementation while keeping our swagger:ignore?
33cd424 to
0594435
Compare
64644b0 to
72f7f1f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To Do
hydra clients createcommands and remove--idflag and rename--callbackto--redirect-uris--dangerous-force-httpin docsChanges Requiring Attention
Changes you must know about!
Cookies
New cookie configuration options have been introduced, allowing a higher degree of control:
The default names of cookies have changed:
Use the new configuration option to change the cookie names back to v1.x if required:
PBKDF2 and Bcrypt Client Secret Hashing
This release adds support for hashing OAuth2 Client Secrets using pbkdf2 instead of bcrypt, which might be a more appropriate algorithm in certain settings. As we assume that most environments fall in this category, we also changed the default to pbkdf2 with 25.000 rounds (roughly 1-3ms per hash on an Apple M1 Max core).
High hash costs are needed when hashing user-chosen passwords, as users often reuse passwords across sites. A high hash cost will make it much harder for the attacker to guess the user-chosen password and try using it on other sites (e.g. Google).
As most client secrets are auto-generated, using high hash costs is not useful. The password (OAuth2 Client Secret) is not user chosen and unlikely to be reused. As such, there is little point in using excessive hash costs to protect users. High hash costs in a system like Ory Hydra will cause high CPU costs from mostly automated traffic (OAuth2 Client interactions). It has also been a point of critizism from some who wish for better RPS on specific endpoints.
Other systems like Keycloak do not hash client secrets at all, referencing more secure authentication mechanisms such as assertion-based client authentication.
We and the IETF disagree though, as rfc6819#section-5.1.4.1.3 states:
For that reason, cleartext storage of client secrets is not going to be supported.
BREAKING CHANGE: This change is backwards compatible, but changes the default hashing algorithm to PBKDF2. To keep using BCrypt for hashing new OAuth2 Client Secrets set the following configuration option in your configuration file:
Token Prefixes
This release adds token prefixes to access tokens (
ory_at_), refresh tokens (ory_rt_), and authorize codes (ory_ac_). Token prefixes are useful when scanning for secrets in e.g. git repositories. Token prefixes are only use for opaque tokens, not JSON Web Tokens as that would invalidate the JSON Web Tokens.Tokens issued before this change will continue working!
OAuth2 Client ID Generated
It is no longer possible to set arbitrary OAuth 2.0 Client IDs. Instead, OAuth 2.0 Client IDs are generated by Ory Hydra. Clients created before the 2.0 release will continue to work with their legacy IDs.
This change was made to improve scalability of the number of clients in distributed databases such as CockroachDB. Ory Hydra v3.0 will most likely remove support for these legacy IDs. Please start migrating your users to new OAuth2 Clients.
New
--devmodeTo better support local development, a new flag
--devhas been added. With--devit is possible to use to usehttpandlocalhostURLs. If--devis not set, URLs (e.g. the consent url) must behttpsand non-localhost.issno longer has a forced trailing slashThe
iss(issuer) value no longer appends a trailing slash but instead uses the raw value set in the config.Setting
has changed
To set a trailing slash make sure to set it in the config value:
Database schema
This release comes with significant changes to the database schema, which affect most tables in Hydra. Some of the notable changes include:
We've also upgraded the databases used in tests and examples to the following versions:
Config hot reloading
Ory Hydra is now capable of hot reloading any OAuth2-related configuration setting and no longer needs to be restarted to change certain values (e.g. the access token strategy).
TLS
The CLI flag
--dangerous-force-httphas been removed. To control TLS, use the TLS configuration instead:serve: tls: # Defaults to **false**! + enabled: true # ... public: tls: # Overrides serve.tls.enabled + enabled: true # ... admin: tls: # Overrides serve.tls.enabled + enabled: true # ...Please keep in mind that TLS is disabled by default as we expect most deployments to run behind a proxy which does TLS termination.
TLS termination requirement
The TLS Termination Middleware Requirement has been removed. The TLS Termination configuration flags have no effect any more and can be removed.
JSON Web Key generation
Previously, JSON Web Keys were generated in public and private key pairs with
public:andprivate:prefixes. This practice has been removed. Generating new JSON Web Key will from now on return one key in the JSON Web Key Set{ "keys": [ - { - "kid": "private:some-id" - }, - { - "kid": "public:some-id" - } + { + "kid": "some-id" + // Contains both private and public key, and exposes the correct one depending on context automatically. + } ] }Deployments with keys generated in Ory Hydra v1.x will continue to work!
Admin routes
To match compatibility with other Ory services, we have moved all admin APIs under the
/adminprefix on the admin port. There are redirects set up, but we encourage to upgrade the SDK and paths in your system to match the new prefix.Breaking changes
Changes which require code adjustments.
CLI
The CLI has been reworked and now follows the structure of Ory Keto, Ory Kratos, and the Ory CLI. Mostly, commands and flags have been renamed, and support for output formats and STDIN have been added. Please head over to the CLI documentation to get a sense of the new Ory CLI.
To highlight the changes, here are some examples:
Please note that all environment variables named
HYDRA_ADMIN_URLandHYDRA_URLhave been renamed and unified underORY_SDK_URLHTTP Flush Endpoint Removed
The HTTP Endpoint
/oauth/flushhas been removed. The command was not useful and had a tendency to time out. Please use thehydra janitorcommand instead.SDKs
Ory Hydra 2.0 moved to the OpenAPI spec for SDK generation. API methods and payload names also were updated to match other services in the ecosystem. Please check the respective SDK code documentation when upgrading.