Commit Graph

107 Commits

Author SHA1 Message Date
hackerman 7311a794c7
chore: reduce registry code bloat and improve DI (#3794) 2024-07-16 11:32:45 +02:00
Patrik 5dd7d306ba
feat: re-enable legacy client IDs (#3628)
This patch changes the primary key of the `hydra_client` table. We do not expect issues, as that table is probably not overly huge in any deployment. We do however highly recommend to test the migration performance on a staging environment with a similar database setup.
2023-09-19 11:20:23 +02:00
Arne Luenser 1d73d83eb0
fix: reject invalid JWKS in client configuration / dependency cleanup and bump (#3603) 2023-08-11 16:33:22 +02:00
Henning Perl f29fe3af97
feat: stateless authorization code flow (#3515)
This patch optimizes the performance of authorization code grant flows by minimizing the number of database queries. We acheive this by storing the flow in an AEAD-encoded cookie and AEAD-encoded request parameters for the authentication and consent screens. 

BREAKING CHANGE:

* The client that is used as part of the authorization grant flow is stored in the AEAD-encoding. Therefore, running flows will not observe updates to the client after they were started.
* Because the login and consent challenge values now include the AEAD-encoded flow, their size increased to around 1kB for a flow without any metadata (and increases linearly with the amount of metadata). Please adjust your ingress / gateway accordingly.
2023-06-12 20:27:00 +02:00
Arne Luenser f56e5fad74 fix: append /v2 to module path 2023-01-28 08:40:41 +01:00
Kevin Goslar d768cf6580
docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
hackerman aea37d6a35
fix: use correct sdk tag (#3318) 2022-10-26 14:04:20 +02:00
aeneasr e800002d09 refactor(sdk): consent SDK
BREAKING CHANGE: SDK naming has changed for the following operations:

```patch
ory.
-   V0alpha2Api.AdminRevokeOAuth2ConsentSessions(cmd.Context()).
+   OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).
    Client(clientId).Execute()

ory.
-   V0alpha2Api.AdminListOAuth2SubjectConsentSessions(cmd.Context(), id).
+   OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).
    Client(clientId).Execute()

ory.
-   V0alpha2Api.AdminListOAuth2SubjectConsentSessions(context.Background()).
+   OAuth2Api.ListOAuth2ConsentSessions(context.Background()).
    Subject(subjectId).Execute()

ory.
-   V0alpha2Api.AdminRevokeOAuth2LoginSessions(context.Background()).
+   OAuth2Api.RevokeOAuth2LoginSessions(context.Background()).
    Subject(subjectId).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2LoginRequest(context.Background()).
+   OAuth2Api.GetOAuth2LoginRequest(context.Background()).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2LoginRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2LoginRequest(context.Background()).
    AcceptOAuth2LoginRequest(body).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2LoginRequest(context.Background()).
+   OAuth2Api.RejectOAuth2LoginRequest(context.Background()).
    RejectOAuth2Request(body).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.GetOAuth2ConsentRequest(context.Background()).
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2ConsentRequest(context.Background()).
    AcceptOAuth2ConsentRequest(body).
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.RejectOAuth2ConsentRequest(context.Background()).
    RejectOAuth2Request().
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.RejectOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

ory.
    V0alpha2Api.AdminGetOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.GetOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

- var AlreadyHandledError HandledOAuth2LoginRequest
+ var AlreadyHandledError ErrorOAuth2LoginRequestAlreadyHandled

- var AlreadyHandledError HandledOAuth2LoginRequest
+ var AlreadyHandledError ErrorOAuth2ConsentRequestAlreadyHandled

- var OAuth2SuccessResponse SuccessfulOAuth2RequestResponse
+ var OAuth2SuccessResponse OAuth2RedirectTo
```
2022-10-11 17:01:24 +02:00
aeneasr 6b601564c1 refactor(sdk): rename errors
BREAKING CHANGE: Error models in the generated SDK have been renamed:

```patch
- oAuth2ApiError
+ errorOAuth2
```
2022-10-11 17:01:24 +02:00
aeneasr cb742ad0d6 refactor(sdk): rename oauth2 client operations and payloads
BREAKING CHANGE: The SDK API for the following has changed:

```patch
// Go example
ory.
-   V0alpha2Api.AdminUpdateOAuth2Client(cmd.Context(), id)
+   Oauth2Api.SetOAuth2Client(cmd.Context(), id).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2Client(cmd.Context(), id).
+   Oauth2Api.GetOAuth2Client(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.AdminDeleteOAuth2Client(cmd.Context(), id).
+   Oauth2Api.DeleteOAuth2Client(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.AdminCreateOAuth2Client(cmd.Context()).
+   Oauth2Api.CreateOAuth2Client(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationGetOAuth2Client(cmd.Context(), id).
+   OidcApi.GetOidcDynamicClient(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationGetOAuth2Client(cmd.Context()).
+   OidcApi.CreateOidcDynamicClient(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationDeleteOAuth2Client(cmd.Context()).
+   OidcApi.DeleteOidcDynamicClient(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationUpdateOAuth2Client(cmd.Context(), id).
+   OidcApi.SetOidcDynamicClient(cmd.Context(), id).
    Execute()
```
2022-10-11 17:01:24 +02:00
Kevin Goslar 15cdb885b5
chore: format using Make (#3257) 2022-09-22 15:56:09 -04:00
aeneasr a364db4ff2 fix: move to v0alpha2 api spec 2022-09-07 08:10:31 +02:00
Grant Zvolský 9ef671f284 feat: custom client token ttl (#3206)
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType.

See #3157

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
Co-authored-by: Andreas Bucksteeg <andreas@bucksteeg.de>
2022-09-07 08:10:31 +02:00
aeneasr 937e6baabf fix: resolve internal SDK regressions 2022-09-07 08:10:31 +02:00
aeneasr bb51ba0c40 refactor(consent): rename SDK method from `adminListSubjectConsentSessions` to `adminListOAuth2SubjectConsentSessions`
BREAKING CHANGE: Rename SDK method from `adminListSubjectConsentSessions` to `adminListOAuth2SubjectConsentSessions`.
2022-09-07 08:10:31 +02:00
Grant Zvolsky 0752721dd8 refactor(client): rename SDK methods and introduce `/admin` prefix
BREAKING CHANGE: This release updates SDK services from `public` and `admin` to `v2`. Methods exposed at the admin interface are now prefixed with `admin` (e.g. `adminCreateOAuth2Client`). Administrative endpoints now have an `/admin` prefix (e.g. `POST /admin/clients`). Existing administrative endpoints will redirect to this new prefixed path for backwards compatibility.
2022-09-07 08:10:31 +02:00
aeneasr 23585b5797 refactor(client): replace limit and offset parameters with page_token and page_size
BREAKING CHANGES: To better support TB-scale environments, the OAuth2 Client HTTP API's query parameters for pagination have changed from `limit` and `offset` to `page_token` and `page_size`. The `page_token` is an opaque string contained in the HTTP `Link` Header, which expresses the next, previous, first, and last page.
2022-09-07 08:10:31 +02:00
aeneasr 1100aba1e1 test: fix flaky equal check 2022-09-07 08:10:31 +02:00
aeneasr 1fd6ea3df6 fix: resolve token prefix regression 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 a28bcf1f10 chore: styles 2022-09-07 08:10:31 +02:00
aeneasr a85bc7ab52 feat(sdk): add missing bearer security definition 2022-09-07 08:10:31 +02:00
aeneasr bbe0406df6 feat: config hot reloading architecture 2022-09-07 08:10:31 +02:00
Grant Zvolsky 8e961d0eb3 code review 2022-09-07 08:10:31 +02:00
Grant Zvolsky 10c146b49c code review: contextualize config 2022-09-07 08:10:31 +02:00
Grant Zvolsky b7fc2bff53 feat: implement NID 2022-09-07 08:10:31 +02:00
Grant Zvolský 9544c03a3b
feat: custom client token ttl (#3206)
This change introduces a new endpoint that allows you to control how long client tokens last. Now you can configure the lifespan for each valid combination of Client, GrantType, and TokenType.

See #3157

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
Co-authored-by: Andreas Bucksteeg <andreas@bucksteeg.de>
2022-07-28 21:12:09 +02:00
Jonas Hungershausen 87b20be6e1
chore: replace x/json.go with ory/x's jsonx patch (#3183) 2022-07-10 21:36:57 +02:00
Daniel Eichinger 9902ec7333
fix: swagger for dynamic client registration (#3141) 2022-06-08 10:35:13 +02:00
hackerman 6a18f62935
feat: OpenID Connect Dynamic Client Registration and OAuth2 Dynamic Client Registration Protocol (#2909)
This feature adds first-class support for two IETF RFCs and one OpenID Spec:

- [OpenID Connect Dynamic Client Registration 1.0](https://openid.net/specs/openid-connect-registration-1_0.html)
- [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)

To enable this feature, which is disabled by default, set

```yaml
oidc:
  dynamic_client_registration:
    enabled: true
```

in your Ory Hydra configuration. Once enabled, endpoints `POST`, `GET`, `PUT`, and `DELETE` for `/connect/register` will be available at the public port!

Closes #2568
Closes #2549

BREAKING CHANGES: Endpoint `PUT /clients` now returns a 404 error when the OAuth2 Client to be updated does not exist. It returned 401 previously. This change requires you to run SQL migrations!

Co-authored-by: fjviera <javier.viera@mindcurv.com>
2022-01-04 12:54:32 +02:00
Luis Pedrosa 895de0120f
fix: patch should not reset client secret (#2872)
Closes #2869
Closes https://github.com/ory/sdk/issues/129
2021-11-26 13:12:53 +01:00
pike1212 dee4fa2787
fix: update client filter to client_name (#2706)
Closes #2691
2021-09-01 18:19:18 +03:00
pike1212 ea6fdfd631
feat: add owner/name filter to list clients (#2637)
Closes #1485

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
2021-08-02 17:00:42 +02:00
aeneasr 1807e893fd
fix: resolve sdk build issues 2021-07-06 15:22:07 +02:00
Matt Bonnell 540c89d68e
feat: implement partial client updates (PATCH) with JSON Patch syntax (#2411)
Implements a new endpoint `PATCH /clients/{id}` which uses JSON Patch syntax to update an OAuth2 client partially. This removes the need to do `PUT /clients/{id}` with the full OAuth2 Client in the payload.

Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com>
2021-04-05 14:56:03 +02:00
aeneasr 24daede2a6 fix: add 400 as possible reply to /oauth2/token
Closes #2260
2021-01-12 12:11:39 +01:00
Thor Marius Henrichsen bc2bbd2f62
docs: client api upper bound on limit parameter (#2277)
Closes #2267
2021-01-08 09:36:33 +01:00
aeneasr fdf142cc7c feat: improve error stack trace wrapping 2020-11-17 17:25:54 +01:00
Patrik 7662917015
fix: client update breaks primary key (#2150)
Closes #2148
2020-10-29 15:06:45 +01:00
hackerman b36073af48
fix: bump deps to patch CVE-2020-15223 (#2067)
BREAKING CHANGES: As part of this patch, a few things have changed in a breaking fashion:

- OAuth2 Redirection URL error parameters `error_hint`, `error_debug` have been deprecated and now part of `error_description`. The parameters are still included for compatibility reasons but will be removed in a future release.
- OAuth2 Error `revocation_client_mismatch` was not standardized and has been removed. Instead, you will now receive `unauthorized_client` with a description explaning why the flow failed.
2020-09-29 10:01:13 +02:00
Helmuth Bederna 066a6cd5fb
docs: use NYT style capitalization for swagger (#2019) 2020-08-27 13:21:46 +02:00
hackerman 5097805473
fix: bump pop to v5.2 (#1922)
Closes #1892
2020-06-22 16:22:40 +02:00
hackerman 6147e119fe
fix(client): Remove 404 from GET responses (#1746)
Related to #1744
2020-03-03 11:51:37 -03:00
Joshua Obasaju 2bcd4321ca
fix: Send 401 instead of 404 for unknown client (#1707)
Closes #1617
2020-02-01 14:53:03 +01:00
hackerman d68838e99a
consent: Restrict fc & bc logout to sid parameter (#1691)
Closes #1660

Co-authored-by: Joshua Obasaju <41480580+obasajujoshua31@users.noreply.github.com>
2020-01-15 11:03:25 +01:00
DennisPattmann5012 bf2f0fe889
handler: Use generate secrets function as used in cmd (#1674)
If a client is being created by the api and the client_secret is not specified then the client_secret is being generated as a random string of length 26.
2020-01-07 16:12:02 +01:00
aeneasr 9f22545ea0
clients: Ensure order of paginated results
Closes #1554
2019-09-18 19:10:30 +02:00
hackerman b5cb1534cc
sdk: Fix missing and broken swagger annotations (#1440)
Closes #1435

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-05-17 11:05:33 +02:00
Kevin Minehart 9c6e4c120c ven dor: Fix pagination headers (#1362)
Closes #1361 

Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
2019-04-18 10:00:13 +02:00
Kevin Minehart f1ee77c0ba all: Add pagination headers to list results (#1358)
Closes #1047

Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
2019-04-15 16:26:50 +02:00