Commit Graph

1880 Commits

Author SHA1 Message Date
Iraq Jaber
5e3951c7f8 fixup! fixup! Merge branch 'main' into org_api 2025-05-21 16:36:44 +02:00
Iraq Jaber
5af4e3b7aa fixup! Merge branch 'main' into org_api 2025-05-21 14:50:00 +02:00
Iraq Jaber
01b263d7cb Merge branch 'main' into org_api 2025-05-21 14:36:09 +02:00
Iraq Jaber
390c694b46 fixup! fixup! Merge branch 'org_api_docs' into org_api 2025-05-21 14:28:19 +02:00
Iraq Jaber
cb2c2e77bf fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-21 12:52:12 +02:00
Iraq Jaber
83a5371fe6 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-21 10:34:52 +02:00
Iraq Jaber
733b0852d5 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 14:11:40 +02:00
Iraq Jaber
1fde70ff7c fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 11:37:11 +02:00
Iraq Jaber
477fb8aba6 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-20 10:35:23 +02:00
Iraq Jaber
5bdc19a6c0 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-19 18:15:18 +02:00
Iraq Jaber
fe74d6b88d fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-19 17:22:50 +02:00
Iraq Jaber
07ffc92481 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-12 09:01:28 +02:00
Iraq Jaber
f9e9f9cdff fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-12 09:00:03 +02:00
Iraq Jaber
5f014d6057 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-08 20:39:49 +02:00
Iraq Jaber
a26ccd5393 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-08 20:33:34 +02:00
Silvan
60ce32ca4f fix(setup): reenable index creation (#9868)
# Which Problems Are Solved

We saw high CPU usage if many events were created on the database. This
was caused by the new actions which query for all event types and
aggregate types.

# How the Problems Are Solved

- the handler of action execution does not filter for aggregate and
event types.
- the index for `instance_id` and `position` is reenabled.

# Additional Changes

none

# Additional Context

none
2025-05-08 15:13:57 +00:00
Livio Spring
867e9cb15a fix: correctly use single matching user (by loginname) (#9865)
# Which Problems Are Solved

In rare cases there was a possibility that multiple users were found by
a loginname. This prevented the corresponding user to sign in.

# How the Problems Are Solved

Fixed the corresponding query (to correctly respect the org domain
policy).

# Additional Changes

None

# Additional Context

Found during the investigation of a support request
2025-05-08 07:32:41 +00:00
Elio Bischof
898366c537 fix: allow user self deletion (#9828)
# Which Problems Are Solved

Currently, users can't delete themselves using the V2 RemoveUser API
because of the redunant API middleware permission check.

On main, using a machine user PAT to delete the same machine user:

```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
ERROR:
  Code: NotFound
  Message: membership not found (AUTHZ-cdgFk)
  Details:
  1)	{
    	  "@type": "type.googleapis.com/zitadel.v1.ErrorDetail",
    	  "id": "AUTHZ-cdgFk",
    	  "message": "membership not found"
    	}
```

Same on this PRs branch:

```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
{
  "details": {
    "sequence": "3",
    "changeDate": "2025-05-06T13:44:54.349048Z",
    "resourceOwner": "318838541083804033"
  }
}
```

Repeated call
```bash
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"userId": "318838604669387137"}' localhost:8080 zitadel.user.v2.UserService.DeleteUser
ERROR:
  Code: Unauthenticated
  Message: Errors.Token.Invalid (AUTH-7fs1e)
  Details:
  1)	{
    	  "@type": "type.googleapis.com/zitadel.v1.ErrorDetail",
    	  "id": "AUTH-7fs1e",
    	  "message": "Errors.Token.Invalid"
    	}
```

# How the Problems Are Solved

The middleware permission check is disabled and the
domain.PermissionCheck is used exclusively.

# Additional Changes

A new type command.PermissionCheck allows to optionally accept a
permission check for commands, so APIs with middleware permission checks
can omit redundant permission checks by passing nil while APIs without
middleware permission checks can pass one to the command.

# Additional Context

This is a subtask of #9763

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-05-07 15:24:24 +02:00
Iraq Jaber
34892286bf fixup! fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-07 14:04:51 +02:00
Iraq Jaber
06bc789b99 fixup! fixup! fixup! Merge branch 'main' into org_api 2025-05-07 13:57:08 +02:00
Iraq Jaber
73eb43bb87 fixup! fixup! Merge branch 'main' into org_api 2025-05-07 13:46:17 +02:00
Iraq Jaber
25d4f1af78 fixup! Merge branch 'main' into org_api 2025-05-07 13:36:50 +02:00
Iraq Jaber
7383c24931 Merge branch 'main' into org_api 2025-05-07 09:26:32 +02:00
Iraq Jaber
4eb67cebcc fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-07 09:02:56 +02:00
Iraq Jaber
1a05c41614 fixup! fixup! fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-06 17:29:26 +02:00
Iraq Jaber
6fa53113c5 fixup! fixup! fixup! adding more tests for ListOrganization() 2025-05-06 14:58:01 +02:00
Iraq Jaber
686079ba66 fixup! fixup! adding more tests for ListOrganization() 2025-05-06 14:04:17 +02:00
Iraq Jaber
1d7c414f87 fixup! adding more tests for ListOrganization() 2025-05-06 09:09:30 +02:00
Zach Hirschtritt
8cb1d24b36 fix: add user id index on sessions8 (#9834)
# Which Problems Are Solved

When a user changes their password, Zitadel needs to terminate all of
that user's active sessions. This query can take many seconds on
deployments with large session and user tables. This happens as part of
session projection handling, so doesn't directly impact user experience,
but potentially bogs down the projection handler which isn't great. In
the future, this index could be used to power a "see all of my current
sessions" feature in Zitadel.

# How the Problems Are Solved

Adds new index on `user_id` column on `projections.sessions8` table.
Alternatively, we can index on `(instance_id, user_id)` instead but
opted for keeping the index smaller as we already index on `instance_id`
separately.

# Additional Changes

None

# Additional Context

None

---------

Co-authored-by: Silvan <27845747+adlerhurst@users.noreply.github.com>
2025-05-06 06:38:19 +00:00
Iraq Jaber
4f340dc973 adding more tests for ListOrganization() 2025-05-05 15:23:28 +02:00
Iraq Jaber
932cebcd54 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 11:17:54 +02:00
Iraq Jaber
76cc92e5d7 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 11:03:25 +02:00
Iraq Jaber
c7b6a2f4df fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 10:46:41 +02:00
Iraq Jaber
2105dd232a fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-05 09:33:40 +02:00
Iraq Jaber
b8498e89ee fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 18:00:38 +02:00
Iraq Jaber
492ac01af4 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 16:58:25 +02:00
Iraq Jaber
e7d1939012 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-04 15:53:33 +02:00
Iraq Jaber
6878e2f6b5 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-03 12:43:51 +02:00
Iraq Jaber
80f61aefc9 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-03 12:42:05 +02:00
Iraq Jaber
3e482e501e fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based 2025-05-03 12:38:45 +02:00
Iraq Jaber
9dbcfc255d fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added all Domain related endpoinds, testing not complete
2025-05-02 19:00:09 +02:00
Livio Spring
b1e60e7398 Merge commit from fork
* fix: prevent intent token reuse and add expiry

* fix duplicate

* fix expiration
2025-05-02 13:44:24 +02:00
Iraq Jaber
4d5cbc94e2 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added AddOrganizationDomain & ListOrganizationDomain()
2025-05-02 12:10:30 +02:00
Iraq Jaber
96831fb5f5 fixup! fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added Deactivate/ActivateOrg
2025-05-01 12:37:14 +02:00
Elio Bischof
74ace1aec3 fix(actions): default sorting column to creation date (#9795)
# Which Problems Are Solved

The sorting column of action targets and executions defaults to the ID
column instead of the creation date column.
This is only relevant, if the sorting column is explicitly passed as
unspecified.
If the sorting column is not passed, it correctly defaults to the
creation date.

```bash
#  Sorts by ID
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"sortingColumn": "TARGET_FIELD_NAME_UNSPECIFIED"}' localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
#  Sorts by ID
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" -d '{"sortingColumn": 0}' localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
#  Sorts by creation date
grpcurl -plaintext -H "Authorization: Bearer ${ZITADEL_ACCESS_TOKEN}" localhost:8080 zitadel.action.v2beta.ActionService.ListTargets
``` 

# How the Problems Are Solved

`action.TargetFieldName_TARGET_FIELD_NAME_UNSPECIFIED` maps to the
sorting column `query.TargetColumnCreationDate`.

# Additional Context

As IDs are also generated in ascending, like creation dates, the the bug
probably only causes unexpected behavior for cases, where the ID is
specified during target or execution creation. This is currently not
supported, so this bug probably has no impact at all. It doesn't need to
be backported.

Found during implementation of #9763

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-05-01 05:41:57 +00:00
Stefan Benz
a05f7ce3fc fix: correct handling of removed targets (#9824)
# Which Problems Are Solved

In Actions v2, if a target is removed, which is still used in an
execution, the target is still listed when list executions.

# How the Problems Are Solved

Removed targets are now also removed from the executions.

# Additional Changes

To be sure the list executions include a check if the target is still
existing.

# Additional Context

None

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-30 12:58:10 +00:00
Stefan Benz
3953879fe9 fix: correct unmarshalling of IdP user when using Google (#9799)
# Which Problems Are Solved

Users from Google IDP's are not unmarshalled correctly in intent
endpoints and not returned to callers.

# How the Problems Are Solved

Provided correct type for unmarshalling of the information.

# Additional Changes

None

# Additional Context

None

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-30 09:12:48 +00:00
Tim Möhlmann
0465d5093e fix(features): remove the improved performance enumer (#9819)
# Which Problems Are Solved

Instance that had improved performance flags set, got event errors when
getting instance features. This is because the improved performance
flags were marshalled using the enumerated integers, but now needed to
be unmashalled using the added UnmarshallText method.

# How the Problems Are Solved

- Remove emnumer generation

# Additional Changes

- none

# Additional Context

- reported on QA
- Backport to next-rc / v3
2025-04-30 08:26:04 +00:00
Iraq Jaber
40de3d462a fixup! fixup! fixup! fixup! fixup! fixup! refactor(api): moving organization API resourced based
added DeleteOrganization()
2025-04-30 10:16:22 +02:00
Silvan
181186e477 fix(mirror): add max auth request age configuration (#9812)
# Which Problems Are Solved

The `auth.auth_requests` table is not cleaned up so long running Zitadel
installations can contain many rows.
 
The mirror command can take long because a the data are first copied
into memory (or disk) on cockroach and users do not get any output from
mirror. This is unfortunate because people don't know if Zitadel got
stuck.

# How the Problems Are Solved

Enhance logging throughout the projection processes and introduce a
configuration option for the maximum age of authentication requests.

# Additional Changes

None

# Additional Context

closes https://github.com/zitadel/zitadel/issues/9764

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2025-04-29 15:29:16 +00:00